public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: shawn.guo@freescale.com (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] imx-drm: ipuv3-plane: fix kernel Oops in ipu_dp_put()
Date: Tue, 19 Aug 2014 22:41:54 +0800	[thread overview]
Message-ID: <20140819144152.GB26734@dragon> (raw)
In-Reply-To: <1408456778.2899.6.camel@paszta.hi.pengutronix.de>

On Tue, Aug 19, 2014 at 03:59:38PM +0200, Philipp Zabel wrote:
> > diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c
> > index 6f393a11f44d..a79ae7731a03 100644
> > --- a/drivers/staging/imx-drm/ipuv3-plane.c
> > +++ b/drivers/staging/imx-drm/ipuv3-plane.c
> > @@ -274,15 +274,10 @@ static void ipu_plane_dpms(struct ipu_plane *ipu_plane, int mode)
> >  	if (enable == ipu_plane->enabled)
> >  		return;
> >  
> > -	if (enable) {
> > +	if (enable)
> >  		ipu_plane_enable(ipu_plane);
> > -	} else {
> > +	else
> >  		ipu_plane_disable(ipu_plane);
> > -
> > -		ipu_idmac_put(ipu_plane->ipu_ch);
> > -		ipu_dmfc_put(ipu_plane->dmfc);
> > -		ipu_dp_put(ipu_plane->dp);
> > -	}
> >  }
> >  
> >  /*
> 
> we could then remove ipu_plane_dpms completely:

Yeah, you're right, Philipp.  I will fold your code change below into my
v2 of the patch.  Thanks.

Shawn

> 
> ---
>  drivers/staging/imx-drm/ipuv3-plane.c | 23 ++++-------------------
>  1 file changed, 4 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c
> index b2d1bb2..6987e16 100644
> --- a/drivers/staging/imx-drm/ipuv3-plane.c
> +++ b/drivers/staging/imx-drm/ipuv3-plane.c
> @@ -290,23 +290,6 @@ void ipu_plane_disable(struct ipu_plane *ipu_plane)
>  		ipu_dp_disable(ipu_plane->ipu);
>  }
>  
> -static void ipu_plane_dpms(struct ipu_plane *ipu_plane, int mode)
> -{
> -	bool enable;
> -
> -	DRM_DEBUG_KMS("mode = %d", mode);
> -
> -	enable = (mode == DRM_MODE_DPMS_ON);
> -
> -	if (enable == ipu_plane->enabled)
> -		return;
> -
> -	if (enable)
> -		ipu_plane_enable(ipu_plane);
> -	else
> -		ipu_plane_disable(ipu_plane);
> -}
> -
>  /*
>   * drm_plane API
>   */
> @@ -340,7 +323,8 @@ static int ipu_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
>  				plane->crtc, crtc);
>  	plane->crtc = crtc;
>  
> -	ipu_plane_dpms(ipu_plane, DRM_MODE_DPMS_ON);
> +	if (!ipu_plane->enabled)
> +		ipu_plane_enable(ipu_plane);
>  
>  	return 0;
>  }
> @@ -351,7 +335,8 @@ static int ipu_disable_plane(struct drm_plane *plane)
>  
>  	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
>  
> -	ipu_plane_dpms(ipu_plane, DRM_MODE_DPMS_OFF);
> +	if (ipu_plane->enabled)
> +		ipu_plane_disable(ipu_plane);
>  
>  	ipu_plane_put_resources(ipu_plane);
>  
> -- 
> 2.1.0.rc1
> 
> regards
> Philipp
> 

      reply	other threads:[~2014-08-19 14:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19  9:49 [PATCH 0/2] Fixes kernel Oops in imx-drm drivers Shawn Guo
2014-08-19  9:49 ` [PATCH 1/2] imx-drm: imx-ldb: fix kernel Oops in imx_ldb_unbind() Shawn Guo
2014-08-19 14:29   ` Philipp Zabel
2014-08-19  9:49 ` [PATCH 2/2] imx-drm: ipuv3-plane: fix kernel Oops in ipu_dp_put() Shawn Guo
2014-08-19 13:59   ` Philipp Zabel
2014-08-19 14:41     ` Shawn Guo [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=20140819144152.GB26734@dragon \
    --to=shawn.guo@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.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