[PATCH 3/5] drm/imx: ipuv3 crtc: Cleanup ipu planes in ipu_drm_unbind()

2015-11-24 Thread Liu Ying
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 
> > ---
> > 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
> 


[PATCH 3/5] drm/imx: ipuv3 crtc: Cleanup ipu planes in ipu_drm_unbind()

2015-11-23 Thread Philipp Zabel
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 
> ---
> 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)?

regards
Philipp



[PATCH 3/5] drm/imx: ipuv3 crtc: Cleanup ipu planes in ipu_drm_unbind()

2015-11-20 Thread Liu Ying
To avoid memory leakage, we need to cleanup ipu planes in ipu_drm_unbind().

Signed-off-by: Liu Ying 
---
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);
 }

-- 
2.5.0