From 0f5334be2bc6ceca971a7a6ab3ca1c23a707867c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 15 Jun 2007 11:01:51 +0200 Subject: Remove DRIVER_IRQ_VBL(2). If the driver doesn't support vertical blank interrupts, it won't call drm_vblank_init(), and dev->num_crtcs will be 0. Also fix an off-by-one test against dev->num_crtcs. --- linux-core/drm_irq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'linux-core/drm_irq.c') diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index f673a97c..c9d1c0d2 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -405,7 +405,7 @@ int drm_modeset_ctl(DRM_IOCTL_ARGS) } crtc = modeset.arg; - if (crtc > dev->num_crtcs) { + if (crtc >= dev->num_crtcs) { ret = -EINVAL; goto out; } @@ -474,8 +474,7 @@ int drm_wait_vblank(DRM_IOCTL_ARGS) flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK; crtc = flags & _DRM_VBLANK_SECONDARY ? 1 : 0; - if (!drm_core_check_feature(dev, (flags & _DRM_VBLANK_SECONDARY) ? - DRIVER_IRQ_VBL2 : DRIVER_IRQ_VBL)) + if (crtc >= dev->num_crtcs) return -EINVAL; drm_update_vblank_count(dev, crtc); -- cgit v1.2.3