diff mbox series

[2/2] drm/bridge: adv7533: Add option to disable lane switching

Message ID 20220309151109.20957-2-biju.das.jz@bp.renesas.com (mailing list archive)
State Not Applicable
Delegated to: Kieran Bingham
Headers show
Series [1/2] dt-bindings: drm: bridge: adi,adv7533: Document adi,disable-lanes-override property | expand

Commit Message

Biju Das March 9, 2022, 3:11 p.m. UTC
On Renesas RZ/{G2L,V2L} platforms changing the lanes from 4 to 3 at
lower frequencies causes display instability. On such platforms, it
is better to avoid switching lanes from 4 to 3 as it needs different
set of PLL parameter constraints to make the display stable with 3
lanes.

This patch adds an option to disable lane switching if
'adi,disable-lanes-override' property is present in DT.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/gpu/drm/bridge/adv7511/adv7511.h | 1 +
 drivers/gpu/drm/bridge/adv7511/adv7533.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Biju Das April 10, 2023, 4:26 p.m. UTC | #1
Hi All,

I would like to drop this patch as [1] and [2] fixes the issue.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/gpu/drm/bridge/adv7511/adv7533.c?h=next-20230406&id=9a0cdcd6649b76f0b7ceec0e55b0a718321e34d3

[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/gpu/drm/bridge/adv7511/adv7533.c?h=next-20230406&id=ee0285e13455fdbce5de315bdbe91b5f198a2a06

Cheers,
Biju

> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: Wednesday, March 9, 2022 3:11 PM
> To: Andrzej Hajda <andrzej.hajda@intel.com>; Neil Armstrong
> <narmstrong@baylibre.com>; Robert Foss <robert.foss@linaro.org>; David
> Airlie <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch>
> Cc: Biju Das <biju.das.jz@bp.renesas.com>; Laurent Pinchart
> <Laurent.pinchart@ideasonboard.com>; Jonas Karlman <jonas@kwiboo.se>; Jernej
> Skrabec <jernej.skrabec@gmail.com>; Maxime Ripard <maxime@cerno.tech>; Sam
> Ravnborg <sam@ravnborg.org>; Sia Jee Heng <jee.heng.sia@intel.com>; Abhinav
> Kumar <quic_abhinavk@quicinc.com>; Nicolas Boichat <drinkcat@chromium.org>;
> dri-devel@lists.freedesktop.org; Geert Uytterhoeven
> <geert+renesas@glider.be>; Chris Paterson <Chris.Paterson2@renesas.com>;
> Biju Das <biju.das@bp.renesas.com>; Prabhakar Mahadev Lad
> <prabhakar.mahadev-lad.rj@bp.renesas.com>; linux-renesas-soc@vger.kernel.org
> Subject: [PATCH 2/2] drm/bridge: adv7533: Add option to disable lane
> switching
> 
> On Renesas RZ/{G2L,V2L} platforms changing the lanes from 4 to 3 at lower
> frequencies causes display instability. On such platforms, it is better to
> avoid switching lanes from 4 to 3 as it needs different set of PLL parameter
> constraints to make the display stable with 3 lanes.
> 
> This patch adds an option to disable lane switching if 'adi,disable-lanes-
> override' property is present in DT.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511.h | 1 +
> drivers/gpu/drm/bridge/adv7511/adv7533.c | 5 ++++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> index 592ecfcf00ca..7505601f10fb 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> @@ -368,6 +368,7 @@ struct adv7511 {
>  	struct mipi_dsi_device *dsi;
>  	u8 num_dsi_lanes;
>  	bool use_timing_gen;
> +	bool override_lanes;
> 
>  	enum adv7511_type type;
>  	struct platform_device *audio_pdev;
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7533.c
> b/drivers/gpu/drm/bridge/adv7511/adv7533.c
> index eb7579dec40a..7f6a8e95d70e 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7533.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7533.c
> @@ -108,7 +108,7 @@ void adv7533_mode_set(struct adv7511 *adv, const struct
> drm_display_mode *mode)
>  	if (adv->num_dsi_lanes != 4)
>  		return;
> 
> -	if (mode->clock > 80000)
> +	if (!adv->override_lanes || mode->clock > 80000)
>  		lanes = 4;
>  	else
>  		lanes = 3;
> @@ -195,6 +195,9 @@ int adv7533_parse_dt(struct device_node *np, struct
> adv7511 *adv)
>  	adv->use_timing_gen = !of_property_read_bool(np,
>  						"adi,disable-timing-generator");
> 
> +	adv->override_lanes = !of_property_read_bool(np,
> +						"adi,disable-lanes-override");
> +
>  	/* TODO: Check if these need to be parsed by DT or not */
>  	adv->rgb = true;
>  	adv->embedded_sync = false;
> --
> 2.17.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h
index 592ecfcf00ca..7505601f10fb 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
@@ -368,6 +368,7 @@  struct adv7511 {
 	struct mipi_dsi_device *dsi;
 	u8 num_dsi_lanes;
 	bool use_timing_gen;
+	bool override_lanes;
 
 	enum adv7511_type type;
 	struct platform_device *audio_pdev;
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7533.c b/drivers/gpu/drm/bridge/adv7511/adv7533.c
index eb7579dec40a..7f6a8e95d70e 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7533.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7533.c
@@ -108,7 +108,7 @@  void adv7533_mode_set(struct adv7511 *adv, const struct drm_display_mode *mode)
 	if (adv->num_dsi_lanes != 4)
 		return;
 
-	if (mode->clock > 80000)
+	if (!adv->override_lanes || mode->clock > 80000)
 		lanes = 4;
 	else
 		lanes = 3;
@@ -195,6 +195,9 @@  int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
 	adv->use_timing_gen = !of_property_read_bool(np,
 						"adi,disable-timing-generator");
 
+	adv->override_lanes = !of_property_read_bool(np,
+						"adi,disable-lanes-override");
+
 	/* TODO: Check if these need to be parsed by DT or not */
 	adv->rgb = true;
 	adv->embedded_sync = false;