[PATCH 03/15] drm/modes: drop __drm_framebuffer_unregister.

Daniel Vetter daniel at ffwll.ch
Thu Apr 21 08:05:04 UTC 2016


On Fri, Apr 15, 2016 at 03:10:34PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> Just use the generic function.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>

Maybe mention in the commit message that a side effect of this is that we
now also protect fb->base.id (at least when we clear it) with the idr
mutex.

Either way: Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  drivers/gpu/drm/drm_crtc.c | 16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index e69aac4..0ad1a92 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -389,15 +389,6 @@ struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
>  }
>  EXPORT_SYMBOL(drm_mode_object_find);
>  
> -/* dev->mode_config.fb_lock must be held! */
> -static void __drm_framebuffer_unregister(struct drm_device *dev,
> -					 struct drm_framebuffer *fb)
> -{
> -	drm_mode_object_put(dev, &fb->base);
> -
> -	fb->base.id = 0;
> -}
> -
>  static void drm_framebuffer_free(struct kref *kref)
>  {
>  	struct drm_framebuffer *fb =
> @@ -409,10 +400,7 @@ static void drm_framebuffer_free(struct kref *kref)
>  	 * removed at this point. Check for that.
>  	 */
>  	mutex_lock(&dev->mode_config.fb_lock);
> -	if (fb->base.id) {
> -		/* Mark fb as reaped and drop idr ref. */
> -		__drm_framebuffer_unregister(dev, fb);
> -	}
> +	drm_mode_object_unregister(dev, &fb->base);
>  	mutex_unlock(&dev->mode_config.fb_lock);
>  
>  	fb->funcs->destroy(fb);
> @@ -549,7 +537,7 @@ void drm_framebuffer_unregister_private(struct drm_framebuffer *fb)
>  
>  	mutex_lock(&dev->mode_config.fb_lock);
>  	/* Mark fb as reaped and drop idr ref. */
> -	__drm_framebuffer_unregister(dev, fb);
> +	drm_mode_object_unregister(dev, &fb->base);
>  	mutex_unlock(&dev->mode_config.fb_lock);
>  }
>  EXPORT_SYMBOL(drm_framebuffer_unregister_private);
> -- 
> 2.5.5
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list