All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "Daniel Vetter" <daniel.vetter@intel.com>,
	"Intel Graphics Development" <intel-gfx@lists.freedesktop.org>,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"DRI Development" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] drm/fb-helper: Automatically clean up fb_info
Date: Tue, 7 Feb 2017 14:34:48 +0000	[thread overview]
Message-ID: <20170207143448.GD11545@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <20170207141050.1129-2-daniel.vetter@ffwll.ch>

On Tue, Feb 07, 2017 at 03:10:50PM +0100, Daniel Vetter wrote:
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 5220a7b5e6ff..074ab22a7cf3 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -781,7 +781,9 @@ EXPORT_SYMBOL(drm_fb_helper_init);
>   * @fb_helper: driver-allocated fbdev helper
>   *
>   * A helper to alloc fb_info and the members cmap and apertures. Called
> - * by the driver within the fb_probe fb_helper callback function.
> + * by the driver within the fb_probe fb_helper callback function. Drivers do not
> + * need to release the allocated fb_info structure themselves, this is
> + * automatically done when calling drm_fb_helper_fini().
>   *
>   * RETURNS:
>   * fb_info pointer if things went okay, pointer containing error code
> @@ -866,9 +868,19 @@ EXPORT_SYMBOL(drm_fb_helper_release_fbi);

I was expecting to see drm_fb_helper_release_fbi() removed.

>   */
>  void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
>  {
> -	if (!drm_fbdev_emulation)
> +	struct fb_info *info;
> +
> +	if (!drm_fbdev_emulation || !fb_helper)
>  		return;
>  
> +	info = fb_helper->fbdev;
> +	if (info) {
> +		if (info->cmap.len)
> +			fb_dealloc_cmap(&info->cmap);
> +		framebuffer_release(info);
> +	}
> +	fb_helper->fbdev = NULL;
> +
>  	mutex_lock(&kernel_fb_helper_lock);
>  	if (!list_empty(&fb_helper->kernel_fb_list)) {
>  		list_del(&fb_helper->kernel_fb_list);
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-02-07 14:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 14:10 [PATCH 1/2] drm/fb-helper: Explain unload sequence a bit better Daniel Vetter
2017-02-07 14:10 ` [PATCH 2/2] drm/fb-helper: Automatically clean up fb_info Daniel Vetter
2017-02-07 14:29   ` [PATCH] " Daniel Vetter
2017-02-07 14:38     ` Emil Velikov
2017-02-07 14:49       ` [Intel-gfx] " Chris Wilson
2017-02-07 16:09         ` Daniel Vetter
2017-02-08  0:49         ` Emil Velikov
2017-02-07 16:16     ` Daniel Vetter
2017-02-07 16:27       ` Sean Paul
2017-02-07 14:34   ` Chris Wilson [this message]
2017-02-07 15:51   ` [PATCH 2/2] " Sean Paul
2017-02-07 14:28 ` [PATCH 1/2] drm/fb-helper: Explain unload sequence a bit better Chris Wilson
2017-02-07 17:32 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/fb-helper: Explain unload sequence a bit better (rev3) Patchwork

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=20170207143448.GD11545@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=noralf@tronnes.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.