diff options
author | Jordan Crouse <jcrouse@codeaurora.org> | 2010-05-27 15:40:25 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-31 20:07:39 -0400 |
commit | dcdb167402cbdca1d021bdfa5f63995ee0a79317 (patch) | |
tree | 3cd0ab1189d972b59daaaf863f518d7b94d2de7a /drivers/gpu/drm/drm_irq.c | |
parent | 01d73a6967f12fe6c4bbde1834a9fe662264a2eb (diff) |
drm: Add support for platform devices to register as DRM devices
Allow platform devices without PCI resources to be DRM devices.
[airlied: fixup warnings with dev pointers]
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index a263b7070fc6..6353b625e099 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -57,6 +57,9 @@ int drm_irq_by_busid(struct drm_device *dev, void *data, | |||
57 | { | 57 | { |
58 | struct drm_irq_busid *p = data; | 58 | struct drm_irq_busid *p = data; |
59 | 59 | ||
60 | if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE)) | ||
61 | return -EINVAL; | ||
62 | |||
60 | if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) | 63 | if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) |
61 | return -EINVAL; | 64 | return -EINVAL; |
62 | 65 | ||
@@ -211,7 +214,7 @@ int drm_irq_install(struct drm_device *dev) | |||
211 | if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) | 214 | if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) |
212 | return -EINVAL; | 215 | return -EINVAL; |
213 | 216 | ||
214 | if (dev->pdev->irq == 0) | 217 | if (drm_dev_to_irq(dev) == 0) |
215 | return -EINVAL; | 218 | return -EINVAL; |
216 | 219 | ||
217 | mutex_lock(&dev->struct_mutex); | 220 | mutex_lock(&dev->struct_mutex); |
@@ -229,7 +232,7 @@ int drm_irq_install(struct drm_device *dev) | |||
229 | dev->irq_enabled = 1; | 232 | dev->irq_enabled = 1; |
230 | mutex_unlock(&dev->struct_mutex); | 233 | mutex_unlock(&dev->struct_mutex); |
231 | 234 | ||
232 | DRM_DEBUG("irq=%d\n", dev->pdev->irq); | 235 | DRM_DEBUG("irq=%d\n", drm_dev_to_irq(dev)); |
233 | 236 | ||
234 | /* Before installing handler */ | 237 | /* Before installing handler */ |
235 | dev->driver->irq_preinstall(dev); | 238 | dev->driver->irq_preinstall(dev); |
@@ -302,14 +305,14 @@ int drm_irq_uninstall(struct drm_device * dev) | |||
302 | if (!irq_enabled) | 305 | if (!irq_enabled) |
303 | return -EINVAL; | 306 | return -EINVAL; |
304 | 307 | ||
305 | DRM_DEBUG("irq=%d\n", dev->pdev->irq); | 308 | DRM_DEBUG("irq=%d\n", drm_dev_to_irq(dev)); |
306 | 309 | ||
307 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | 310 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
308 | vga_client_register(dev->pdev, NULL, NULL, NULL); | 311 | vga_client_register(dev->pdev, NULL, NULL, NULL); |
309 | 312 | ||
310 | dev->driver->irq_uninstall(dev); | 313 | dev->driver->irq_uninstall(dev); |
311 | 314 | ||
312 | free_irq(dev->pdev->irq, dev); | 315 | free_irq(drm_dev_to_irq(dev), dev); |
313 | 316 | ||
314 | return 0; | 317 | return 0; |
315 | } | 318 | } |
@@ -341,7 +344,7 @@ int drm_control(struct drm_device *dev, void *data, | |||
341 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | 344 | if (drm_core_check_feature(dev, DRIVER_MODESET)) |
342 | return 0; | 345 | return 0; |
343 | if (dev->if_version < DRM_IF_VERSION(1, 2) && | 346 | if (dev->if_version < DRM_IF_VERSION(1, 2) && |
344 | ctl->irq != dev->pdev->irq) | 347 | ctl->irq != drm_dev_to_irq(dev)) |
345 | return -EINVAL; | 348 | return -EINVAL; |
346 | return drm_irq_install(dev); | 349 | return drm_irq_install(dev); |
347 | case DRM_UNINST_HANDLER: | 350 | case DRM_UNINST_HANDLER: |
@@ -651,7 +654,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data, | |||
651 | int ret = 0; | 654 | int ret = 0; |
652 | unsigned int flags, seq, crtc; | 655 | unsigned int flags, seq, crtc; |
653 | 656 | ||
654 | if ((!dev->pdev->irq) || (!dev->irq_enabled)) | 657 | if ((!drm_dev_to_irq(dev)) || (!dev->irq_enabled)) |
655 | return -EINVAL; | 658 | return -EINVAL; |
656 | 659 | ||
657 | if (vblwait->request.type & _DRM_VBLANK_SIGNAL) | 660 | if (vblwait->request.type & _DRM_VBLANK_SIGNAL) |