Skip to content

Commit

Permalink
drm: Allow vblank support without DRIVER_HAVE_IRQ
Browse files Browse the repository at this point in the history
Drivers that register interrupt handlers without the DRM core helpers
don't initialize the .irq_enabled field and drm_dev_to_irq() may fail
when called on them. This shouldn't preclude them from implementing
the vblank IOCTL.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Thierry Reding authored and Dave Airlie committed Feb 8, 2013
1 parent 1e6d17a commit 03f6509
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,9 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
int ret;
unsigned int flags, seq, crtc, high_crtc;

if ((!drm_dev_to_irq(dev)) || (!dev->irq_enabled))
return -EINVAL;
if (drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
if ((!drm_dev_to_irq(dev)) || (!dev->irq_enabled))
return -EINVAL;

if (vblwait->request.type & _DRM_VBLANK_SIGNAL)
return -EINVAL;
Expand Down

0 comments on commit 03f6509

Please sign in to comment.