diff mbox

[02/13] drm/irq: Remove negative CRTC index special-case

Message ID 1439391635-29166-2-git-send-email-thierry.reding@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding Aug. 12, 2015, 3 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

The drm_send_vblank_event() function treats negative CRTC indices as
meaning that a driver doesn't have proper VBLANK handling. This is the
only place where DRM needs negative CRTC indices, so in order to enable
subsequent cleanup, remove this special case and replace it by the more
obvious check for whether or not VBLANK support was initialized.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/drm/drm_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter Aug. 12, 2015, 3:28 p.m. UTC | #1
On Wed, Aug 12, 2015 at 05:00:24PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> The drm_send_vblank_event() function treats negative CRTC indices as
> meaning that a driver doesn't have proper VBLANK handling. This is the
> only place where DRM needs negative CRTC indices, so in order to enable
> subsequent cleanup, remove this special case and replace it by the more
> obvious check for whether or not VBLANK support was initialized.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Applied to drm-misc, thansk.
-Daniel

> ---
>  drivers/gpu/drm/drm_irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index ee14324522ce..5c666c780fe9 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -971,7 +971,7 @@ void drm_send_vblank_event(struct drm_device *dev, int crtc,
>  	struct timeval now;
>  	unsigned int seq;
>  
> -	if (crtc >= 0) {
> +	if (dev->num_crtcs > 0) {
>  		seq = drm_vblank_count_and_time(dev, crtc, &now);
>  	} else {
>  		seq = 0;
> -- 
> 2.4.5
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index ee14324522ce..5c666c780fe9 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -971,7 +971,7 @@  void drm_send_vblank_event(struct drm_device *dev, int crtc,
 	struct timeval now;
 	unsigned int seq;
 
-	if (crtc >= 0) {
+	if (dev->num_crtcs > 0) {
 		seq = drm_vblank_count_and_time(dev, crtc, &now);
 	} else {
 		seq = 0;