drm/radeon: Sync to Linux 3.11
[dragonfly.git] / sys / dev / drm / radeon / radeon_drv.c
CommitLineData
926deccb
FT
1/**
2 * \file radeon_drv.c
3 * ATI Radeon driver
4 *
5 * \author Gareth Hughes <gareth@valinux.com>
7f3c3d6f 6 */
926deccb
FT
7
8/*
7f3c3d6f
HT
9 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
10 * All Rights Reserved.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice (including the next
20 * paragraph) shall be included in all copies or substantial portions of the
21 * Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29 * OTHER DEALINGS IN THE SOFTWARE.
30 *
926deccb 31 * $FreeBSD: head/sys/dev/drm2/radeon/radeon_drv.c 254885 2013-08-25 19:37:15Z dumbbell $
7f3c3d6f
HT
32 */
33
18e26a6d 34#include <drm/drmP.h>
926deccb 35#include <uapi_drm/radeon_drm.h>
c4a9e910 36#include "radeon_drv.h"
926deccb
FT
37#include "radeon_gem.h"
38#include "radeon_kms.h"
39#include "radeon_irq_kms.h"
40
18e26a6d 41#include <drm/drm_pciids.h>
7f3c3d6f 42
926deccb
FT
43/*
44 * KMS wrapper.
45 * - 2.0.0 - initial interface
46 * - 2.1.0 - add square tiling interface
47 * - 2.2.0 - add r6xx/r7xx const buffer support
48 * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
49 * - 2.4.0 - add crtc id query
50 * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen
51 * - 2.6.0 - add tiling config query (r6xx+), add initial HiZ support (r300->r500)
52 * 2.7.0 - fixups for r600 2D tiling support. (no external ABI change), add eg dyn gpr regs
53 * 2.8.0 - pageflip support, r500 US_FORMAT regs. r500 ARGB2101010 colorbuf, r300->r500 CMASK, clock crystal query
54 * 2.9.0 - r600 tiling (s3tc,rgtc) working, SET_PREDICATION packet 3 on r600 + eg, backend query
55 * 2.10.0 - fusion 2D tiling
56 * 2.11.0 - backend map, initial compute support for the CS checker
57 * 2.12.0 - RADEON_CS_KEEP_TILING_FLAGS
58 * 2.13.0 - virtual memory support, streamout
59 * 2.14.0 - add evergreen tiling informations
60 * 2.15.0 - add max_pipes query
61 * 2.16.0 - fix evergreen 2D tiled surface calculation
62 * 2.17.0 - add STRMOUT_BASE_UPDATE for r7xx
63 * 2.18.0 - r600-eg: allow "invalid" DB formats
64 * 2.19.0 - r600-eg: MSAA textures
65 * 2.20.0 - r600-si: RADEON_INFO_TIMESTAMP query
66 * 2.21.0 - r600-r700: FMASK and CMASK
67 * 2.22.0 - r600 only: RESOLVE_BOX allowed
68 * 2.23.0 - allow STRMOUT_BASE_UPDATE on RS780 and RS880
69 * 2.24.0 - eg only: allow MIP_ADDRESS=0 for MSAA textures
70 * 2.25.0 - eg+: new info request for num SE and num SH
71 * 2.26.0 - r600-eg: fix htile size computation
72 * 2.27.0 - r600-SI: Add CS ioctl support for async DMA
73 * 2.28.0 - r600-eg: Add MEM_WRITE packet support
74 * 2.29.0 - R500 FP16 color clear registers
b403bed8 75 * 2.30.0 - fix for FMASK texturing
f43cf1b1
MN
76 * 2.31.0 - Add fastfb support for rs690
77 * 2.32.0 - new info request for rings working
78 * 2.33.0 - Add SI tiling mode array query
57e252bf 79 * 2.34.0 - Add CIK tiling mode array query
926deccb
FT
80 */
81#define KMS_DRIVER_MAJOR 2
57e252bf 82#define KMS_DRIVER_MINOR 34
926deccb
FT
83#define KMS_DRIVER_PATCHLEVEL 0
84int radeon_suspend_kms(struct drm_device *dev);
85int radeon_resume_kms(struct drm_device *dev);
86extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc,
87 int *vpos, int *hpos);
88extern struct drm_ioctl_desc radeon_ioctls_kms[];
89extern int radeon_max_kms_ioctl;
90#ifdef DUMBBELL_WIP
91int radeon_mmap(struct file *filp, struct vm_area_struct *vma);
92#endif /* DUMBBELL_WIP */
93int radeon_mode_dumb_mmap(struct drm_file *filp,
94 struct drm_device *dev,
95 uint32_t handle, uint64_t *offset_p);
96int radeon_mode_dumb_create(struct drm_file *file_priv,
97 struct drm_device *dev,
98 struct drm_mode_create_dumb *args);
99int radeon_mode_dumb_destroy(struct drm_file *file_priv,
100 struct drm_device *dev,
101 uint32_t handle);
b403bed8
MN
102struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj);
103struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev,
104 size_t size,
105 struct sg_table *sg);
106int radeon_gem_prime_pin(struct drm_gem_object *obj);
57e252bf 107void radeon_gem_prime_unpin(struct drm_gem_object *obj);
b403bed8
MN
108void *radeon_gem_prime_vmap(struct drm_gem_object *obj);
109void radeon_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
926deccb
FT
110
111#if defined(CONFIG_DEBUG_FS)
112int radeon_debugfs_init(struct drm_minor *minor);
113void radeon_debugfs_cleanup(struct drm_minor *minor);
114#endif
115
b403bed8
MN
116/* atpx handler */
117#if defined(CONFIG_VGA_SWITCHEROO)
118void radeon_register_atpx_handler(void);
119void radeon_unregister_atpx_handler(void);
120#else
121static inline void radeon_register_atpx_handler(void) {}
122static inline void radeon_unregister_atpx_handler(void) {}
123#endif
124
7f3c3d6f 125int radeon_no_wb;
926deccb
FT
126int radeon_modeset = 1;
127int radeon_dynclks = -1;
128int radeon_r4xx_atom = 0;
129int radeon_agpmode = 0;
130int radeon_vram_limit = 0;
131int radeon_gart_size = 512; /* default gart size */
132int radeon_benchmarking = 0;
133int radeon_testing = 0;
134int radeon_connector_table = 0;
135int radeon_tv = 1;
136int radeon_audio = 0;
137int radeon_disp_priority = 0;
138int radeon_hw_i2c = 0;
139int radeon_pcie_gen2 = -1;
140int radeon_msi = -1;
141int radeon_lockup_timeout = 10000;
f43cf1b1 142int radeon_fastfb = 0;
57e252bf
MN
143int radeon_dpm = -1;
144int radeon_aspm = -1;
926deccb 145
b403bed8
MN
146static drm_pci_id_list_t pciidlist[] = {
147 radeon_PCI_IDS
148};
149
150#ifdef CONFIG_DRM_RADEON_UMS
151
926deccb
FT
152#ifdef DUMBBELL_WIP
153MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
154module_param_named(no_wb, radeon_no_wb, int, 0444);
155
156MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
157module_param_named(modeset, radeon_modeset, int, 0400);
158
159MODULE_PARM_DESC(dynclks, "Disable/Enable dynamic clocks");
160module_param_named(dynclks, radeon_dynclks, int, 0444);
161
162MODULE_PARM_DESC(r4xx_atom, "Enable ATOMBIOS modesetting for R4xx");
163module_param_named(r4xx_atom, radeon_r4xx_atom, int, 0444);
164
165MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing");
166module_param_named(vramlimit, radeon_vram_limit, int, 0600);
167
168MODULE_PARM_DESC(agpmode, "AGP Mode (-1 == PCI)");
169module_param_named(agpmode, radeon_agpmode, int, 0444);
170
171MODULE_PARM_DESC(gartsize, "Size of PCIE/IGP gart to setup in megabytes (32, 64, etc)");
172module_param_named(gartsize, radeon_gart_size, int, 0600);
173
174MODULE_PARM_DESC(benchmark, "Run benchmark");
175module_param_named(benchmark, radeon_benchmarking, int, 0444);
176
177MODULE_PARM_DESC(test, "Run tests");
178module_param_named(test, radeon_testing, int, 0444);
179
180MODULE_PARM_DESC(connector_table, "Force connector table");
181module_param_named(connector_table, radeon_connector_table, int, 0444);
182
183MODULE_PARM_DESC(tv, "TV enable (0 = disable)");
184module_param_named(tv, radeon_tv, int, 0444);
185
186MODULE_PARM_DESC(audio, "Audio enable (1 = enable)");
187module_param_named(audio, radeon_audio, int, 0444);
188
189MODULE_PARM_DESC(disp_priority, "Display Priority (0 = auto, 1 = normal, 2 = high)");
190module_param_named(disp_priority, radeon_disp_priority, int, 0444);
191
192MODULE_PARM_DESC(hw_i2c, "hw i2c engine enable (0 = disable)");
193module_param_named(hw_i2c, radeon_hw_i2c, int, 0444);
7f3c3d6f 194
926deccb
FT
195MODULE_PARM_DESC(pcie_gen2, "PCIE Gen2 mode (-1 = auto, 0 = disable, 1 = enable)");
196module_param_named(pcie_gen2, radeon_pcie_gen2, int, 0444);
197
198MODULE_PARM_DESC(msi, "MSI support (1 = enable, 0 = disable, -1 = auto)");
199module_param_named(msi, radeon_msi, int, 0444);
200
201MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (defaul 10000 = 10 seconds, 0 = disable)");
202module_param_named(lockup_timeout, radeon_lockup_timeout, int, 0444);
203
f43cf1b1
MN
204MODULE_PARM_DESC(fastfb, "Direct FB access for IGP chips (0 = disable, 1 = enable)");
205module_param_named(fastfb, radeon_fastfb, int, 0444);
206
57e252bf
MN
207MODULE_PARM_DESC(dpm, "DPM support (1 = enable, 0 = disable, -1 = auto)");
208module_param_named(dpm, radeon_dpm, int, 0444);
209
210MODULE_PARM_DESC(aspm, "ASPM support (1 = enable, 0 = disable, -1 = auto)");
211module_param_named(aspm, radeon_aspm, int, 0444);
212
926deccb
FT
213static int radeon_suspend(struct drm_device *dev, pm_message_t state)
214{
215 drm_radeon_private_t *dev_priv = dev->dev_private;
216
217 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
218 return 0;
219
220 /* Disable *all* interrupts */
221 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600)
222 RADEON_WRITE(R500_DxMODE_INT_MASK, 0);
223 RADEON_WRITE(RADEON_GEN_INT_CNTL, 0);
224 return 0;
225}
226
227static int radeon_resume(struct drm_device *dev)
228{
229 drm_radeon_private_t *dev_priv = dev->dev_private;
230
231 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
232 return 0;
233
234 /* Restore interrupt registers */
235 if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600)
236 RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
237 RADEON_WRITE(RADEON_GEN_INT_CNTL, dev_priv->irq_enable_reg);
238 return 0;
239}
240#endif /* DUMBBELL_WIP */
241
926deccb
FT
242#ifdef DUMBBELL_WIP
243static const struct file_operations radeon_driver_old_fops = {
244 .owner = THIS_MODULE,
245 .open = drm_open,
246 .release = drm_release,
247 .unlocked_ioctl = drm_ioctl,
248 .mmap = drm_mmap,
249 .poll = drm_poll,
250 .fasync = drm_fasync,
251 .read = drm_read,
252#ifdef CONFIG_COMPAT
253 .compat_ioctl = radeon_compat_ioctl,
254#endif
255 .llseek = noop_llseek,
256};
257
258static struct drm_driver driver_old = {
259 .driver_features =
9edbd4a0 260 DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG |
926deccb
FT
261 DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED,
262 .dev_priv_size = sizeof(drm_radeon_buf_priv_t),
263 .load = radeon_driver_load,
264 .firstopen = radeon_driver_firstopen,
265 .open = radeon_driver_open,
266 .preclose = radeon_driver_preclose,
267 .postclose = radeon_driver_postclose,
268 .lastclose = radeon_driver_lastclose,
269 .unload = radeon_driver_unload,
270#ifdef DUMBBELL_WIP
271 .suspend = radeon_suspend,
272 .resume = radeon_resume,
273#endif /* DUMBBELL_WIP */
274 .get_vblank_counter = radeon_get_vblank_counter,
275 .enable_vblank = radeon_enable_vblank,
276 .disable_vblank = radeon_disable_vblank,
277 .master_create = radeon_master_create,
278 .master_destroy = radeon_master_destroy,
279 .irq_preinstall = radeon_driver_irq_preinstall,
280 .irq_postinstall = radeon_driver_irq_postinstall,
281 .irq_uninstall = radeon_driver_irq_uninstall,
282 .irq_handler = radeon_driver_irq_handler,
283 .ioctls = radeon_ioctls,
284 .dma_ioctl = radeon_cp_buffers,
285 .fops = &radeon_driver_old_fops,
286 .name = DRIVER_NAME,
287 .desc = DRIVER_DESC,
288 .date = DRIVER_DATE,
289 .major = DRIVER_MAJOR,
290 .minor = DRIVER_MINOR,
291 .patchlevel = DRIVER_PATCHLEVEL,
292};
293#endif /* DUMBBELL_WIP */
294
b403bed8
MN
295#endif
296
9a567f76 297static struct drm_driver kms_driver;
926deccb
FT
298
299#ifdef DUMBBELL_WIP
300static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
301{
302 struct apertures_struct *ap;
303 bool primary = false;
304
305 ap = alloc_apertures(1);
306 if (!ap)
307 return -ENOMEM;
308
309 ap->ranges[0].base = pci_resource_start(pdev, 0);
310 ap->ranges[0].size = pci_resource_len(pdev, 0);
311
312#ifdef CONFIG_X86
313 primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
314#endif
315 remove_conflicting_framebuffers(ap, "radeondrmfb", primary);
316 kfree(ap);
317
318 return 0;
319}
320
321static int radeon_pci_probe(struct pci_dev *pdev,
322 const struct pci_device_id *ent)
323{
324 int ret;
325
326 /* Get rid of things like offb */
327 ret = radeon_kick_out_firmware_fb(pdev);
328 if (ret)
329 return ret;
330
331 return drm_get_pci_dev(pdev, ent, &kms_driver);
332}
333
334static void
335radeon_pci_remove(struct pci_dev *pdev)
336{
337 struct drm_device *dev = pci_get_drvdata(pdev);
338
339 drm_put_dev(dev);
340}
341
342static int
343radeon_pci_suspend(struct pci_dev *pdev, pm_message_t state)
344{
345 struct drm_device *dev = pci_get_drvdata(pdev);
346 return radeon_suspend_kms(dev, state);
347}
348
349static int
350radeon_pci_resume(struct pci_dev *pdev)
351{
352 struct drm_device *dev = pci_get_drvdata(pdev);
353 return radeon_resume_kms(dev);
354}
355
356static const struct file_operations radeon_driver_kms_fops = {
357 .owner = THIS_MODULE,
358 .open = drm_open,
359 .release = drm_release,
360 .unlocked_ioctl = drm_ioctl,
361 .mmap = radeon_mmap,
362 .poll = drm_poll,
363 .fasync = drm_fasync,
364 .read = drm_read,
365#ifdef CONFIG_COMPAT
366 .compat_ioctl = radeon_kms_compat_ioctl,
367#endif
368};
369#endif /* DUMBBELL_WIP */
370
9a567f76 371static struct drm_driver kms_driver = {
926deccb 372 .driver_features =
9edbd4a0 373 DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG |
926deccb
FT
374 DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_GEM |
375 DRIVER_PRIME /* | DRIVE_MODESET */,
376#ifdef DUMBBELL_WIP
377 .dev_priv_size = 0,
378#endif /* DUMBBELL_WIP */
379 .load = radeon_driver_load_kms,
380 .use_msi = radeon_msi_ok,
381 .firstopen = radeon_driver_firstopen_kms,
382 .open = radeon_driver_open_kms,
383 .preclose = radeon_driver_preclose_kms,
384 .postclose = radeon_driver_postclose_kms,
385 .lastclose = radeon_driver_lastclose_kms,
386 .unload = radeon_driver_unload_kms,
387#ifdef DUMBBELL_WIP
388 .suspend = radeon_suspend_kms,
389 .resume = radeon_resume_kms,
390#endif /* DUMBBELL_WIP */
391 .get_vblank_counter = radeon_get_vblank_counter_kms,
392 .enable_vblank = radeon_enable_vblank_kms,
393 .disable_vblank = radeon_disable_vblank_kms,
394 .get_vblank_timestamp = radeon_get_vblank_timestamp_kms,
395 .get_scanout_position = radeon_get_crtc_scanoutpos,
396 .irq_preinstall = radeon_driver_irq_preinstall_kms,
397 .irq_postinstall = radeon_driver_irq_postinstall_kms,
398 .irq_uninstall = radeon_driver_irq_uninstall_kms,
399 .irq_handler = radeon_driver_irq_handler_kms,
400 .ioctls = radeon_ioctls_kms,
926deccb
FT
401 .gem_free_object = radeon_gem_object_free,
402 .gem_open_object = radeon_gem_object_open,
403 .gem_close_object = radeon_gem_object_close,
404 .dma_ioctl = radeon_dma_ioctl_kms,
405 .dumb_create = radeon_mode_dumb_create,
406 .dumb_map_offset = radeon_mode_dumb_mmap,
407 .dumb_destroy = radeon_mode_dumb_destroy,
408#ifdef DUMBBELL_WIP
409 .fops = &radeon_driver_kms_fops,
410#endif /* DUMBBELL_WIP */
411
412#ifdef DUMBBELL_WIP
413 .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
414 .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
b403bed8
MN
415 .gem_prime_export = drm_gem_prime_export,
416 .gem_prime_import = drm_gem_prime_import,
417 .gem_prime_pin = radeon_gem_prime_pin,
57e252bf 418 .gem_prime_unpin = radeon_gem_prime_unpin,
b403bed8
MN
419 .gem_prime_get_sg_table = radeon_gem_prime_get_sg_table,
420 .gem_prime_import_sg_table = radeon_gem_prime_import_sg_table,
421 .gem_prime_vmap = radeon_gem_prime_vmap,
422 .gem_prime_vunmap = radeon_gem_prime_vunmap,
926deccb
FT
423#endif /* DUMBBELL_WIP */
424
425 .name = DRIVER_NAME,
426 .desc = DRIVER_DESC,
427 .date = DRIVER_DATE,
428 .major = KMS_DRIVER_MAJOR,
429 .minor = KMS_DRIVER_MINOR,
430 .patchlevel = KMS_DRIVER_PATCHLEVEL,
431};
432
433#ifdef DUMBBELL_WIP
434static int __init radeon_init(void)
435{
926deccb
FT
436 if (radeon_modeset == 1) {
437 DRM_INFO("radeon kernel modesetting enabled.\n");
438 driver = &kms_driver;
439 pdriver = &radeon_kms_pci_driver;
440 driver->driver_features |= DRIVER_MODESET;
441 driver->num_ioctls = radeon_max_kms_ioctl;
442 radeon_register_atpx_handler();
b403bed8
MN
443
444 } else {
445#ifdef CONFIG_DRM_RADEON_UMS
446 DRM_INFO("radeon userspace modesetting enabled.\n");
447 driver = &driver_old;
448 pdriver = &radeon_pci_driver;
449 driver->driver_features &= ~DRIVER_MODESET;
450 driver->num_ioctls = radeon_max_ioctl;
451#else
452 DRM_ERROR("No UMS support in radeon module!\n");
453 return -EINVAL;
454#endif
926deccb 455 }
b403bed8
MN
456
457 /* let modprobe override vga console setting */
926deccb
FT
458 return drm_pci_init(driver, pdriver);
459}
460
461static void __exit radeon_exit(void)
7f3c3d6f 462{
926deccb
FT
463 drm_pci_exit(driver, pdriver);
464 radeon_unregister_atpx_handler();
7f3c3d6f 465}
926deccb
FT
466#endif /* DUMBBELL_WIP */
467
468/* =================================================================== */
7f3c3d6f 469
7f3c3d6f 470static int
b3705d71 471radeon_probe(device_t kdev)
7f3c3d6f 472{
926deccb
FT
473
474 return drm_probe(kdev, pciidlist);
7f3c3d6f
HT
475}
476
477static int
b3705d71 478radeon_attach(device_t kdev)
7f3c3d6f 479{
926deccb
FT
480 struct drm_device *dev;
481
482 dev = device_get_softc(kdev);
483 if (radeon_modeset == 1) {
484 kms_driver.driver_features |= DRIVER_MODESET;
8e6138a1 485 kms_driver.num_ioctls = radeon_max_kms_ioctl;
926deccb
FT
486 radeon_register_atpx_handler();
487 }
488 dev->driver = &kms_driver;
489 return (drm_attach(kdev, pciidlist));
490}
b3705d71 491
926deccb
FT
492static int
493radeon_suspend(device_t kdev)
494{
495 struct drm_device *dev;
496 int ret;
7f3c3d6f 497
926deccb
FT
498 dev = device_get_softc(kdev);
499 ret = radeon_suspend_kms(dev);
b3705d71 500
926deccb 501 return (-ret);
b3705d71
HT
502}
503
504static int
926deccb 505radeon_resume(device_t kdev)
b3705d71 506{
926deccb 507 struct drm_device *dev;
b3705d71
HT
508 int ret;
509
926deccb
FT
510 dev = device_get_softc(kdev);
511 ret = radeon_resume_kms(dev);
b3705d71 512
926deccb 513 return (-ret);
7f3c3d6f
HT
514}
515
516static device_method_t radeon_methods[] = {
517 /* Device interface */
518 DEVMETHOD(device_probe, radeon_probe),
519 DEVMETHOD(device_attach, radeon_attach),
926deccb
FT
520 DEVMETHOD(device_suspend, radeon_suspend),
521 DEVMETHOD(device_resume, radeon_resume),
d0cc45b6 522 DEVMETHOD(device_detach, drm_release),
d3c9c58e 523 DEVMETHOD_END
7f3c3d6f
HT
524};
525
526static driver_t radeon_driver = {
527 "drm",
528 radeon_methods,
b3705d71 529 sizeof(struct drm_device)
7f3c3d6f
HT
530};
531
532extern devclass_t drm_devclass;
926deccb
FT
533DRIVER_MODULE_ORDERED(radeonkms, vgapci, radeon_driver, drm_devclass,
534 NULL, NULL, SI_ORDER_ANY);
535MODULE_DEPEND(radeonkms, drm, 1, 1, 1);
536MODULE_DEPEND(radeonkms, agp, 1, 1, 1);
537MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1);
538MODULE_DEPEND(radeonkms, iic, 1, 1, 1);
539MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1);