dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Liu Ying <Ying.Liu@freescale.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/imx: ipuv3 crtc: Cleanup ipu planes in ipu_drm_unbind()
Date: Tue, 24 Nov 2015 13:23:11 +0800	[thread overview]
Message-ID: <20151124052310.GB25692@shlinux2> (raw)
In-Reply-To: <1448279294.4008.32.camel@pengutronix.de>

On Mon, Nov 23, 2015 at 12:48:14PM +0100, Philipp Zabel wrote:
> Am Freitag, den 20.11.2015, 16:14 +0800 schrieb Liu Ying:
> > To avoid memory leakage, we need to cleanup ipu planes in ipu_drm_unbind().
> > 
> > Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
> > ---
> > This patch applies to the imx-drm/fixes branch of Philipp Zabel's open git.
> > 
> >  drivers/gpu/drm/imx/ipuv3-crtc.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
> > index 59f44df..467905c 100644
> > --- a/drivers/gpu/drm/imx/ipuv3-crtc.c
> > +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
> > @@ -446,6 +446,11 @@ static void ipu_drm_unbind(struct device *dev, struct device *master,
> >  	imx_drm_remove_crtc(ipu_crtc->imx_crtc);
> >  
> >  	ipu_plane_put_resources(ipu_crtc->plane[0]);
> > +
> > +	if (ipu_crtc->plane[1])
> > +		ipu_plane_cleanup(ipu_crtc->plane[1]);
> > +	ipu_plane_cleanup(ipu_crtc->plane[0]);
> > +
> >  	ipu_put_resources(ipu_crtc);
> >  }
> >  
> 
> Shouldn't this already be handled by the DRM core calling the
> plane->destroy callbacks from drm_mode_config_cleanup (called by
> imx_drm_driver_unload shortly after component_unbind_all)?

I take drm_mode_config_cleanup() as the final goal keeper.  The component
->unbind() may clean things up by itself other than rely on the master's
behaviour.  Otherwise, we even don't need to call ipu_plane_put_resources()
here.

Regards,
Liu Ying

> regards
> Philipp
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-11-24  5:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  8:14 [PATCH 1/5] drm/imx: ipuv3 plane: Introduce ipu_plane_cleanup() Liu Ying
2015-11-20  8:14 ` [PATCH 2/5] drm/imx: ipuv3 crtc: Cleanup ipu planes in ipu_crtc_init() when necessary Liu Ying
2015-11-23 11:48   ` Philipp Zabel
2015-11-20  8:14 ` [PATCH 3/5] drm/imx: ipuv3 crtc: Cleanup ipu planes in ipu_drm_unbind() Liu Ying
2015-11-23 11:48   ` Philipp Zabel
2015-11-24  5:23     ` Liu Ying [this message]
2015-11-20  8:14 ` [PATCH 4/5] drm/imx: ipuv3 plane: Use the helper ipu_plane_cleanup() in ipu_plane_destroy() Liu Ying
2015-11-23 11:48   ` Philipp Zabel
2015-11-24  5:29     ` Liu Ying
2015-11-20  8:14 ` [PATCH 5/5] drm/imx: ipuv3 plane: Replace dev_info with dev_dbg if a plane's CRTC changes Liu Ying
2015-11-23 11:48   ` Philipp Zabel
2016-01-22  2:29     ` Liu Ying
2016-01-25  9:56       ` Philipp Zabel
2015-11-23 11:48 ` [PATCH 1/5] drm/imx: ipuv3 plane: Introduce ipu_plane_cleanup() Philipp Zabel
2015-11-24  3:31   ` Liu Ying

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=20151124052310.GB25692@shlinux2 \
    --to=ying.liu@freescale.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=p.zabel@pengutronix.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;
as well as URLs for NNTP newsgroup(s).