From: Daniel Vetter <daniel@ffwll.ch>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: unbind fbs from crtcs during driver unload
Date: Tue, 11 Feb 2014 23:12:07 +0100 [thread overview]
Message-ID: <20140211221207.GP17001@phenom.ffwll.local> (raw)
In-Reply-To: <1392156070-32623-1-git-send-email-imre.deak@intel.com>
On Wed, Feb 12, 2014 at 12:01:10AM +0200, Imre Deak wrote:
> So far during driver unload we called drm_framebuffer_cleanup() for the
> fbdev fb, which only removes the fb from the drm fb list regardless of
> its reference count, but leaves the fb bound on an active crtc. Since
> the fb's backing storage was freed this could mean we scan some random
> memory content out afterwards. It's not a big issue since the fb is
> allocated from stolen memory and afaik there is no other user for that
> than i915. It's still cleaner to properly unbind the fb and disable the
> crtc, which is what drm_framebuffer_remove() does.
>
> Note that after
>
> commit 88891eb1e9eca0ba619518bed31580f91e9cf84d
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Mon Feb 10 18:00:38 2014 +0100
>
> we call drm_framebuffer_cleanup() only after dropping the last reference
> on the fb, but that won't happen since we don't unbind the fb. This
> results in a drm core warn about a leaked fb.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
Yeah, makes more sense. Apparently I really don't know my own fb lifetime
rules :( Queued for -next, thanks for the patch.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index cf46273..3a53ee3 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -265,7 +265,7 @@ static void intel_fbdev_destroy(struct drm_device *dev,
> drm_fb_helper_fini(&ifbdev->helper);
>
> drm_framebuffer_unregister_private(&ifbdev->fb->base);
> - drm_framebuffer_unreference(&ifbdev->fb->base);
> + drm_framebuffer_remove(&ifbdev->fb->base);
> }
>
> int intel_fbdev_init(struct drm_device *dev)
> --
> 1.8.3.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
prev parent reply other threads:[~2014-02-11 22:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 22:01 [PATCH] drm/i915: unbind fbs from crtcs during driver unload Imre Deak
2014-02-11 22:12 ` Daniel Vetter [this message]
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=20140211221207.GP17001@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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