From: Thierry Reding Date: Mon, 14 Jan 2013 16:05:56 +0000 (+0000) Subject: drm: Allow vblank support without DRIVER_HAVE_IRQ X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03f6509df9218c760ae74f41a609233220d33f19;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: Allow vblank support without DRIVER_HAVE_IRQ 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 Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 19c01ca3cc76..71f820565637 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -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;