On Thursday 19 February 2009 06:55:28 Chris Wilson wrote:
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 3795dbc..93e677a 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -435,6 +435,8 @@ EXPORT_SYMBOL(drm_vblank_get);
>   */
>  void drm_vblank_put(struct drm_device *dev, int crtc)
>  {
> +     BUG_ON (atomic_read (&dev->vblank_refcount[crtc]) == 0);
> +
>       /* Last user schedules interrupt disable */
>       if (atomic_dec_and_test(&dev->vblank_refcount[crtc]))
>               mod_timer(&dev->vblank_disable_timer, jiffies + 5*DRM_HZ);
> @@ -460,8 +462,9 @@ void drm_vblank_pre_modeset(struct drm_device *dev,
> int crtc)
>        * so that interrupts remain enabled in the interim.
>        */
>       if (!dev->vblank_inmodeset[crtc]) {
> -             dev->vblank_inmodeset[crtc] = 1;
> -             drm_vblank_get(dev, crtc);
> +             dev->vblank_inmodeset[crtc] = 0x1;
> +             if (drm_vblank_get(dev, crtc) == 0)
> +                     dev->vblank_inmodeset[crtc] |= 0x2;
>       }
>  }
>  EXPORT_SYMBOL(drm_vblank_pre_modeset);
> @@ -473,9 +476,12 @@ void drm_vblank_post_modeset(struct drm_device
> *dev, int crtc)
>       if (dev->vblank_inmodeset[crtc]) {
>               spin_lock_irqsave(&dev->vbl_lock, irqflags);
>               dev->vblank_disable_allowed = 1;
> -             dev->vblank_inmodeset[crtc] = 0;
>               spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
> -             drm_vblank_put(dev, crtc);
> +
> +             if (dev->vblank_inmodeset[crtc] & 0x2)
> +                     drm_vblank_put(dev, crtc);
> +
> +             dev->vblank_inmodeset[crtc] = 0;
>       }
>  }
>  EXPORT_SYMBOL(drm_vblank_post_modeset);

Looks fine to me; checking for errors when calling functions is probably a 
good idea!

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to