public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Lukas Wunner <lukas@wunner.de>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Don't unregister fbdev twice
Date: Wed, 8 Jun 2016 14:09:40 +0200	[thread overview]
Message-ID: <20160608120940.GC3363@phenom.ffwll.local> (raw)
In-Reply-To: <5031860caad67faa0f1be5965331ef048a311a01.1465383212.git.lukas@wunner.de>

On Wed, Jun 08, 2016 at 01:15:22PM +0200, Lukas Wunner wrote:
> Calling drm_framebuffer_unregister_private() in intel_fbdev_destroy() is
> superfluous because the framebuffer will subsequently be unregistered by
> drm_framebuffer_free() when unreferenced in drm_framebuffer_remove().
> The call is a leftover, when it was introduced by commit 362063619cf6
> ("drm: revamp framebuffer cleanup interfaces"), struct intel_framebuffer
> was still embedded in struct intel_fbdev rather than being a pointer as
> it is today, and drm_framebuffer_remove() wasn't used yet.
> 
> As a bonus, the ID of the framebuffer is no longer 0 in the debug log:
> 
> Before:
>     [   39.680874] [drm:drm_mode_object_unreference] OBJ ID: 0 (3)
>     [   39.680878] [drm:drm_mode_object_unreference] OBJ ID: 0 (2)
>     [   39.680884] [drm:drm_mode_object_unreference] OBJ ID: 0 (1)
> 
> After:
>     [  102.504649] [drm:drm_mode_object_unreference] OBJ ID: 45 (3)
>     [  102.504651] [drm:drm_mode_object_unreference] OBJ ID: 45 (2)
>     [  102.504654] [drm:drm_mode_object_unreference] OBJ ID: 45 (1)
> 
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Hm yeah. But there's a pile of that particaluar cargo-culting copied all
over the place, would be really good to audit all callers of
unregister_private and fix them all up. A few older drivers still embed
the fbdev fb, but most don't but still use the unregister_private +
cleanup combo.

Nitpick in your subject: s/fbdev/fbdev's fb/

Cheers, Daniel

> ---
>  drivers/gpu/drm/i915/intel_fbdev.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index ef8e676..4c7ea46 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -552,8 +552,6 @@ static void intel_fbdev_destroy(struct drm_device *dev,
>  	drm_fb_helper_fini(&ifbdev->helper);
>  
>  	if (ifbdev->fb) {
> -		drm_framebuffer_unregister_private(&ifbdev->fb->base);
> -
>  		mutex_lock(&dev->struct_mutex);
>  		intel_unpin_fb_obj(&ifbdev->fb->base, BIT(DRM_ROTATE_0));
>  		mutex_unlock(&dev->struct_mutex);
> -- 
> 2.8.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-06-08 12:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08 11:15 [PATCH] drm/i915: Don't unregister fbdev twice Lukas Wunner
2016-06-08 12:05 ` ✓ Ro.CI.BAT: success for " Patchwork
2016-06-08 12:09 ` Daniel Vetter [this message]
2016-06-08 17:03   ` [PATCH] " Lukas Wunner
2016-06-13 14:28     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160608120940.GC3363@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lukas@wunner.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox