mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: Meng Yi <meng.yi@nxp.com>
Cc: dri-devel@lists.freedesktop.org, alison.wang@freescale.com,
	jianwei.wang.chn@gmail.com, linux-kernel@vger.kernel.org
Subject: RE: [PATCH v3 1/5] drm/fsl-dcu: enable TCON bypass mode by default
Date: Wed, 19 Oct 2016 17:01:45 -0700	[thread overview]
Message-ID: <a9d2871d25e5b311a83ddd8bd6d34979@agner.ch> (raw)
In-Reply-To: <DB6PR0401MB263101EAFD080C2BA06F6E02ECD20@DB6PR0401MB2631.eurprd04.prod.outlook.com>

On 2016-10-19 02:35, Meng Yi wrote:
>>
>> Do not use encoder disable/enable callbacks to control bypass mode as this
>> seems to mess with the signals not liked by displays. This also makes more
>> sense since the encoder is already defined to be parallel RGB/LVDS at creation
>> time.
>>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>> ---
>>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |  2 ++  drivers/gpu/drm/fsl-
>> dcu/fsl_dcu_drm_rgb.c | 39 ++++---------------------------
>>  2 files changed, 7 insertions(+), 34 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-
>> dcu/fsl_dcu_drm_drv.c
>> index 0884c45..3897f56 100644
>> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
>> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
>> @@ -273,6 +273,8 @@ static int fsl_dcu_drm_pm_resume(struct device *dev)
>>  		goto disable_dcu_clk;
>>  	}
>>
>> +	if (fsl_dev->tcon)
>> +		fsl_tcon_bypass_enable(fsl_dev->tcon);
>>  	fsl_dcu_drm_init_planes(fsl_dev->drm);
>>  	drm_atomic_helper_resume(fsl_dev->drm, fsl_dev->state);
>>
>> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-
>> dcu/fsl_dcu_drm_rgb.c
>> index 26edcc8..e1dd75b 100644
>> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
>> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
>> @@ -20,38 +20,6 @@
>>  #include "fsl_dcu_drm_drv.h"
>>  #include "fsl_tcon.h"
>>
>> -static int
>> -fsl_dcu_drm_encoder_atomic_check(struct drm_encoder *encoder,
>> -				 struct drm_crtc_state *crtc_state,
>> -				 struct drm_connector_state *conn_state)
>> -{
>> -	return 0;
>> -}
>> -
>> -static void fsl_dcu_drm_encoder_disable(struct drm_encoder *encoder) -{
>> -	struct drm_device *dev = encoder->dev;
>> -	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
>> -
>> -	if (fsl_dev->tcon)
>> -		fsl_tcon_bypass_disable(fsl_dev->tcon);
>> -}
>> -
>> -static void fsl_dcu_drm_encoder_enable(struct drm_encoder *encoder) -{
>> -	struct drm_device *dev = encoder->dev;
>> -	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
>> -
>> -	if (fsl_dev->tcon)
>> -		fsl_tcon_bypass_enable(fsl_dev->tcon);
>> -}
>> -
>> -static const struct drm_encoder_helper_funcs encoder_helper_funcs = {
>> -	.atomic_check = fsl_dcu_drm_encoder_atomic_check,
>> -	.disable = fsl_dcu_drm_encoder_disable,
>> -	.enable = fsl_dcu_drm_encoder_enable,
>> -};
>> -
>>  static void fsl_dcu_drm_encoder_destroy(struct drm_encoder *encoder)  {
>>  	drm_encoder_cleanup(encoder);
>> @@ -68,13 +36,16 @@ int fsl_dcu_drm_encoder_create(struct
>> fsl_dcu_drm_device *fsl_dev,
>>  	int ret;
>>
>>  	encoder->possible_crtcs = 1;
>> +
>> +	/* Use bypass mode for parallel RGB/LVDS encoder */
>> +	if (fsl_dev->tcon)
>> +		fsl_tcon_bypass_enable(fsl_dev->tcon);
>> +
>>  	ret = drm_encoder_init(fsl_dev->drm, encoder, &encoder_funcs,
>>  			       DRM_MODE_ENCODER_LVDS, NULL);
>>  	if (ret < 0)
>>  		return ret;
>>
>> -	drm_encoder_helper_add(encoder, &encoder_helper_funcs);
>> -
>>  	return 0;
>>  }
>>
>> --
>> 2.10.0
> 
> Tested-By: Meng Yi <meng.yi@nxp.com>
> 
> Tested those 5 patches on LS1021a-twr, and everything is fine.

Thanks.

Applied 1~4.

--
Stefan

  reply	other threads:[~2016-10-20  0:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 21:33 [PATCH v3 0/5] drm/fsl-dcu: initialization fixes Stefan Agner
2016-10-17 21:33 ` [PATCH v3 1/5] drm/fsl-dcu: enable TCON bypass mode by default Stefan Agner
2016-10-19  9:35   ` Meng Yi
2016-10-20  0:01     ` Stefan Agner [this message]
2016-10-17 21:33 ` [PATCH v3 2/5] drm/fsl-dcu: do not transfer registers on plane init Stefan Agner
2016-10-17 21:33 ` [PATCH v3 3/5] drm/fsl-dcu: do not transfer registers in mode_set_nofb Stefan Agner
2016-10-17 21:33 ` [PATCH v3 4/5] drm/fsl-dcu: enable pixel clock when enabling CRTC Stefan Agner
2016-10-17 21:33 ` [PATCH v3 5/5] drm/fsl-dcu: only init fbdev if required Stefan Agner
2016-10-18  7:44   ` Daniel Vetter
2016-10-18 17:42     ` Stefan Agner
2016-10-19  7:42       ` Daniel Vetter

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=a9d2871d25e5b311a83ddd8bd6d34979@agner.ch \
    --to=stefan@agner.ch \
    --cc=alison.wang@freescale.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jianwei.wang.chn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meng.yi@nxp.com \
    /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

Powered by JetHome