linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: l.stach@pengutronix.de (Lucas Stach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] imx-drm: parallel-display: Fix dpms mode handling
Date: Mon, 03 Nov 2014 16:19:15 +0100	[thread overview]
Message-ID: <1415027955.26755.3.camel@pengutronix.de> (raw)
In-Reply-To: <1415026488-25309-4-git-send-email-mpa@pengutronix.de>

Am Montag, den 03.11.2014, 15:54 +0100 schrieb Markus Pargmann:
> We have to call drm_panel_prepare() and drm_panel_unprepare() when
> switching on or off. This patch also replaces the if statement with an
> switch statement to only catch ON and OFF modes.

... which is wrong. A driver is expected to map all 4 DPMS states to
something sane, so the if statement did exactly the right thing here.

Regards,
Lucas

> 
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---
>  drivers/staging/imx-drm/parallel-display.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/imx-drm/parallel-display.c b/drivers/staging/imx-drm/parallel-display.c
> index 0992bbf01adc..62788177c9d4 100644
> --- a/drivers/staging/imx-drm/parallel-display.c
> +++ b/drivers/staging/imx-drm/parallel-display.c
> @@ -106,10 +106,18 @@ static void imx_pd_encoder_dpms(struct drm_encoder *encoder, int mode)
>  {
>  	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
>  
> -	if (mode != DRM_MODE_DPMS_ON)
> -		drm_panel_disable(imxpd->panel);
> -	else
> +	switch (mode) {
> +	case DRM_MODE_DPMS_ON:
> +		drm_panel_prepare(imxpd->panel);
>  		drm_panel_enable(imxpd->panel);
> +		break;
> +	case DRM_MODE_DPMS_OFF:
> +		drm_panel_disable(imxpd->panel);
> +		drm_panel_unprepare(imxpd->panel);
> +		break;
> +	default:
> +		break;
> +	}
>  }
>  
>  static bool imx_pd_encoder_mode_fixup(struct drm_encoder *encoder,

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

  reply	other threads:[~2014-11-03 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 14:54 [PATCH v2 0/3] staging: drm/imx: parallel-display fixes Markus Pargmann
2014-11-03 14:54 ` [PATCH v2 1/3] staging: drm/imx: parallel-display: Add 24-bit BGR support Markus Pargmann
2014-11-04  0:15   ` Greg Kroah-Hartman
2014-11-03 14:54 ` [PATCH v2 2/3] imx-drm: parallel-display: Fix drm_panel support Markus Pargmann
2014-11-03 14:54 ` [PATCH v2 3/3] imx-drm: parallel-display: Fix dpms mode handling Markus Pargmann
2014-11-03 15:19   ` Lucas Stach [this message]
2014-11-03 15:28     ` Markus Pargmann

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=1415027955.26755.3.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).