All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix regression on embedded panels caused by enabling ASSR
@ 2021-07-20  3:33 Stylon Wang
  2021-07-20  3:33 ` [PATCH 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'" Stylon Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Stylon Wang @ 2021-07-20  3:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: Stylon Wang, Eryk.Brol, Sunpeng.Li, Harry.Wentland,
	Qingqing.Zhuo, Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai,
	Bhawanpreet.Lakha, bindu.r

Previous ASSR-enabling patches cause blank screen on some embedded
panels. This patch set minimize the changes made to code logic prior to
the ASSR change and also improve on code readability.

Stylon Wang (2):
  drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display
    flag'"
  drm/amd/display: Fix ASSR regression on embedded panels

 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 58 +++++++------------
 1 file changed, 20 insertions(+), 38 deletions(-)

-- 
2.32.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'"
  2021-07-20  3:33 [PATCH 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
@ 2021-07-20  3:33 ` Stylon Wang
  2021-07-20  3:33 ` [PATCH 2/2] drm/amd/display: Fix ASSR regression on embedded panels Stylon Wang
  2021-07-21  4:25 ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
  2 siblings, 0 replies; 9+ messages in thread
From: Stylon Wang @ 2021-07-20  3:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: Stylon Wang, Eryk.Brol, Sunpeng.Li, Harry.Wentland,
	Qingqing.Zhuo, Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai,
	Bhawanpreet.Lakha, bindu.r

[Why]
A new change that simplifies the ASSR enabling and guarding is found
that also fixes regression on some embedded panels.

[How]
Revert the ASSR changes in preparation for upcoming patch.

Signed-off-by: Stylon Wang <stylon.wang@amd.com>
---
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 54 ++++++-------------
 1 file changed, 17 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 8b35cd9d4c01..cc62124b0b82 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -1752,38 +1752,6 @@ enum link_training_result dc_link_dp_perform_link_training(
 	return status;
 }
 
-static enum dp_panel_mode try_enable_assr(struct dc_stream_state *stream)
-{
-	struct dc_link *link = stream->link;
-	enum dp_panel_mode panel_mode = dp_get_panel_mode(link);
-#ifdef CONFIG_DRM_AMD_DC_HDCP
-	struct cp_psp *cp_psp = &stream->ctx->cp_psp;
-#endif
-
-	/* ASSR must be supported on the panel */
-	if (panel_mode == DP_PANEL_MODE_DEFAULT)
-		return panel_mode;
-
-	/* eDP or internal DP only */
-	if (link->connector_signal != SIGNAL_TYPE_EDP &&
-		!(link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
-		 link->is_internal_display))
-		return DP_PANEL_MODE_DEFAULT;
-
-#ifdef CONFIG_DRM_AMD_DC_HDCP
-	if (cp_psp && cp_psp->funcs.enable_assr) {
-		if (!cp_psp->funcs.enable_assr(cp_psp->handle, link)) {
-			/* since eDP implies ASSR on, change panel
-			 * mode to disable ASSR
-			 */
-			panel_mode = DP_PANEL_MODE_DEFAULT;
-		}
-	} else
-		panel_mode = DP_PANEL_MODE_DEFAULT;
-#endif
-	return panel_mode;
-}
-
 bool perform_link_training_with_retries(
 	const struct dc_link_settings *link_setting,
 	bool skip_video_pattern,
@@ -1796,7 +1764,7 @@ bool perform_link_training_with_retries(
 	uint8_t delay_between_attempts = LINK_TRAINING_RETRY_DELAY;
 	struct dc_stream_state *stream = pipe_ctx->stream;
 	struct dc_link *link = stream->link;
-	enum dp_panel_mode panel_mode;
+	enum dp_panel_mode panel_mode = dp_get_panel_mode(link);
 	struct link_encoder *link_enc;
 	enum link_training_result status = LINK_TRAINING_CR_FAIL_LANE0;
 	struct dc_link_settings current_setting = *link_setting;
@@ -1832,11 +1800,23 @@ bool perform_link_training_with_retries(
 			msleep(delay_dp_power_up_in_ms);
 		}
 
-		panel_mode = try_enable_assr(stream);
+#ifdef CONFIG_DRM_AMD_DC_HDCP
+		if (panel_mode == DP_PANEL_MODE_EDP) {
+			struct cp_psp *cp_psp = &stream->ctx->cp_psp;
+
+			if (cp_psp && cp_psp->funcs.enable_assr) {
+				if (!cp_psp->funcs.enable_assr(cp_psp->handle, link)) {
+					/* since eDP implies ASSR on, change panel
+					 * mode to disable ASSR
+					 */
+					panel_mode = DP_PANEL_MODE_DEFAULT;
+				}
+			} else
+				panel_mode = DP_PANEL_MODE_DEFAULT;
+		}
+#endif
+
 		dp_set_panel_mode(link, panel_mode);
-		DC_LOG_DETECTION_DP_CAPS("Link: %d ASSR enabled: %d\n",
-			 link->link_index,
-			 panel_mode != DP_PANEL_MODE_DEFAULT);
 
 		if (link->aux_access_disabled) {
 			dc_link_dp_perform_link_training_skip_aux(link, &current_setting);
-- 
2.32.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/2] drm/amd/display: Fix ASSR regression on embedded panels
  2021-07-20  3:33 [PATCH 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
  2021-07-20  3:33 ` [PATCH 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'" Stylon Wang
@ 2021-07-20  3:33 ` Stylon Wang
  2021-07-20 13:34   ` Alex Deucher
  2021-07-21  4:25 ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
  2 siblings, 1 reply; 9+ messages in thread
From: Stylon Wang @ 2021-07-20  3:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: Stylon Wang, Eryk.Brol, Sunpeng.Li, Harry.Wentland,
	Qingqing.Zhuo, Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai,
	Bhawanpreet.Lakha, bindu.r

[Why]
Regression found in some embedded panels traces back to the earliest
upstreamed ASSR patch. The changed code flow are causing problems
with some panels.

[How]
- Change ASSR enabling code while preserving original code flow
  as much as possible
- Simplify the code on guarding with internal display flag

Signed-off-by: Stylon Wang <stylon.wang@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index cc62124b0b82..f56e061d35bc 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -1811,8 +1811,7 @@ bool perform_link_training_with_retries(
 					 */
 					panel_mode = DP_PANEL_MODE_DEFAULT;
 				}
-			} else
-				panel_mode = DP_PANEL_MODE_DEFAULT;
+			}
 		}
 #endif
 
@@ -4643,7 +4642,10 @@ enum dp_panel_mode dp_get_panel_mode(struct dc_link *link)
 		}
 	}
 
-	if (link->dpcd_caps.panel_mode_edp) {
+	if (link->dpcd_caps.panel_mode_edp &&
+		(link->connector_signal == SIGNAL_TYPE_EDP ||
+		 (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
+		  link->is_internal_display))) {
 		return DP_PANEL_MODE_EDP;
 	}
 
-- 
2.32.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/amd/display: Fix ASSR regression on embedded panels
  2021-07-20  3:33 ` [PATCH 2/2] drm/amd/display: Fix ASSR regression on embedded panels Stylon Wang
@ 2021-07-20 13:34   ` Alex Deucher
  2021-07-20 14:31     ` Alex Deucher
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Deucher @ 2021-07-20 13:34 UTC (permalink / raw)
  To: Stylon Wang
  Cc: Eryk Brol, Leo (Sunpeng) Li, Bhawanpreet Lakha, Qingqing Zhuo,
	Siqueira, Rodrigo, amd-gfx list, Anson Jacob, Aurabindo Pillai,
	Wentland, Harry, Bindu Ramamurthy

On Mon, Jul 19, 2021 at 11:34 PM Stylon Wang <stylon.wang@amd.com> wrote:
>
> [Why]
> Regression found in some embedded panels traces back to the earliest
> upstreamed ASSR patch. The changed code flow are causing problems
> with some panels.
>
> [How]
> - Change ASSR enabling code while preserving original code flow
>   as much as possible
> - Simplify the code on guarding with internal display flag
>
> Signed-off-by: Stylon Wang <stylon.wang@amd.com>

Series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index cc62124b0b82..f56e061d35bc 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -1811,8 +1811,7 @@ bool perform_link_training_with_retries(
>                                          */
>                                         panel_mode = DP_PANEL_MODE_DEFAULT;
>                                 }
> -                       } else
> -                               panel_mode = DP_PANEL_MODE_DEFAULT;
> +                       }
>                 }
>  #endif
>
> @@ -4643,7 +4642,10 @@ enum dp_panel_mode dp_get_panel_mode(struct dc_link *link)
>                 }
>         }
>
> -       if (link->dpcd_caps.panel_mode_edp) {
> +       if (link->dpcd_caps.panel_mode_edp &&
> +               (link->connector_signal == SIGNAL_TYPE_EDP ||
> +                (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
> +                 link->is_internal_display))) {
>                 return DP_PANEL_MODE_EDP;
>         }
>
> --
> 2.32.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/amd/display: Fix ASSR regression on embedded panels
  2021-07-20 13:34   ` Alex Deucher
@ 2021-07-20 14:31     ` Alex Deucher
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2021-07-20 14:31 UTC (permalink / raw)
  To: Stylon Wang
  Cc: Eryk Brol, Leo (Sunpeng) Li, Bhawanpreet Lakha, Qingqing Zhuo,
	Siqueira, Rodrigo, amd-gfx list, Anson Jacob, Aurabindo Pillai,
	Wentland, Harry, Bindu Ramamurthy

On Tue, Jul 20, 2021 at 9:34 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Mon, Jul 19, 2021 at 11:34 PM Stylon Wang <stylon.wang@amd.com> wrote:
> >
> > [Why]
> > Regression found in some embedded panels traces back to the earliest
> > upstreamed ASSR patch. The changed code flow are causing problems
> > with some panels.
> >
> > [How]
> > - Change ASSR enabling code while preserving original code flow
> >   as much as possible
> > - Simplify the code on guarding with internal display flag
> >
> > Signed-off-by: Stylon Wang <stylon.wang@amd.com>
>
> Series is:
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Please add:
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1620
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=213779

Alex

>
> > ---
> >  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> > index cc62124b0b82..f56e061d35bc 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> > @@ -1811,8 +1811,7 @@ bool perform_link_training_with_retries(
> >                                          */
> >                                         panel_mode = DP_PANEL_MODE_DEFAULT;
> >                                 }
> > -                       } else
> > -                               panel_mode = DP_PANEL_MODE_DEFAULT;
> > +                       }
> >                 }
> >  #endif
> >
> > @@ -4643,7 +4642,10 @@ enum dp_panel_mode dp_get_panel_mode(struct dc_link *link)
> >                 }
> >         }
> >
> > -       if (link->dpcd_caps.panel_mode_edp) {
> > +       if (link->dpcd_caps.panel_mode_edp &&
> > +               (link->connector_signal == SIGNAL_TYPE_EDP ||
> > +                (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
> > +                 link->is_internal_display))) {
> >                 return DP_PANEL_MODE_EDP;
> >         }
> >
> > --
> > 2.32.0
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR
  2021-07-20  3:33 [PATCH 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
  2021-07-20  3:33 ` [PATCH 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'" Stylon Wang
  2021-07-20  3:33 ` [PATCH 2/2] drm/amd/display: Fix ASSR regression on embedded panels Stylon Wang
@ 2021-07-21  4:25 ` Stylon Wang
  2021-07-21  4:25   ` [PATCH v2 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'" Stylon Wang
                     ` (2 more replies)
  2 siblings, 3 replies; 9+ messages in thread
From: Stylon Wang @ 2021-07-21  4:25 UTC (permalink / raw)
  To: amd-gfx
  Cc: Stylon Wang, Sunpeng.Li, Harry.Wentland, Qingqing.Zhuo,
	Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai,
	Bhawanpreet.Lakha, bindu.r

Previous ASSR-enabling patches cause blank screen on some embedded
panels. This patch set minimize the changes made to code logic prior to
the ASSR change and also improve on code readability.

Changes from prior rev1 to now:

v2:
 - Update reviewed-by and bug links 

Stylon Wang (2):
  drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display
    flag'"
  drm/amd/display: Fix ASSR regression on embedded panels

 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 58 +++++++------------
 1 file changed, 20 insertions(+), 38 deletions(-)

-- 
2.32.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'"
  2021-07-21  4:25 ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
@ 2021-07-21  4:25   ` Stylon Wang
  2021-07-21  4:25   ` [PATCH v2 2/2] drm/amd/display: Fix ASSR regression on embedded panels Stylon Wang
  2021-07-21 14:07   ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Deucher, Alexander
  2 siblings, 0 replies; 9+ messages in thread
From: Stylon Wang @ 2021-07-21  4:25 UTC (permalink / raw)
  To: amd-gfx
  Cc: Stylon Wang, Sunpeng.Li, Harry.Wentland, Qingqing.Zhuo,
	Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai, Alex Deucher,
	Bhawanpreet.Lakha, bindu.r

[Why]
A new change that simplifies the ASSR enabling and guarding is found
that also fixes regression on some embedded panels.

[How]
Revert the ASSR changes in preparation for upcoming patch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
---
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 54 ++++++-------------
 1 file changed, 17 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 8b35cd9d4c01..cc62124b0b82 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -1752,38 +1752,6 @@ enum link_training_result dc_link_dp_perform_link_training(
 	return status;
 }
 
-static enum dp_panel_mode try_enable_assr(struct dc_stream_state *stream)
-{
-	struct dc_link *link = stream->link;
-	enum dp_panel_mode panel_mode = dp_get_panel_mode(link);
-#ifdef CONFIG_DRM_AMD_DC_HDCP
-	struct cp_psp *cp_psp = &stream->ctx->cp_psp;
-#endif
-
-	/* ASSR must be supported on the panel */
-	if (panel_mode == DP_PANEL_MODE_DEFAULT)
-		return panel_mode;
-
-	/* eDP or internal DP only */
-	if (link->connector_signal != SIGNAL_TYPE_EDP &&
-		!(link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
-		 link->is_internal_display))
-		return DP_PANEL_MODE_DEFAULT;
-
-#ifdef CONFIG_DRM_AMD_DC_HDCP
-	if (cp_psp && cp_psp->funcs.enable_assr) {
-		if (!cp_psp->funcs.enable_assr(cp_psp->handle, link)) {
-			/* since eDP implies ASSR on, change panel
-			 * mode to disable ASSR
-			 */
-			panel_mode = DP_PANEL_MODE_DEFAULT;
-		}
-	} else
-		panel_mode = DP_PANEL_MODE_DEFAULT;
-#endif
-	return panel_mode;
-}
-
 bool perform_link_training_with_retries(
 	const struct dc_link_settings *link_setting,
 	bool skip_video_pattern,
@@ -1796,7 +1764,7 @@ bool perform_link_training_with_retries(
 	uint8_t delay_between_attempts = LINK_TRAINING_RETRY_DELAY;
 	struct dc_stream_state *stream = pipe_ctx->stream;
 	struct dc_link *link = stream->link;
-	enum dp_panel_mode panel_mode;
+	enum dp_panel_mode panel_mode = dp_get_panel_mode(link);
 	struct link_encoder *link_enc;
 	enum link_training_result status = LINK_TRAINING_CR_FAIL_LANE0;
 	struct dc_link_settings current_setting = *link_setting;
@@ -1832,11 +1800,23 @@ bool perform_link_training_with_retries(
 			msleep(delay_dp_power_up_in_ms);
 		}
 
-		panel_mode = try_enable_assr(stream);
+#ifdef CONFIG_DRM_AMD_DC_HDCP
+		if (panel_mode == DP_PANEL_MODE_EDP) {
+			struct cp_psp *cp_psp = &stream->ctx->cp_psp;
+
+			if (cp_psp && cp_psp->funcs.enable_assr) {
+				if (!cp_psp->funcs.enable_assr(cp_psp->handle, link)) {
+					/* since eDP implies ASSR on, change panel
+					 * mode to disable ASSR
+					 */
+					panel_mode = DP_PANEL_MODE_DEFAULT;
+				}
+			} else
+				panel_mode = DP_PANEL_MODE_DEFAULT;
+		}
+#endif
+
 		dp_set_panel_mode(link, panel_mode);
-		DC_LOG_DETECTION_DP_CAPS("Link: %d ASSR enabled: %d\n",
-			 link->link_index,
-			 panel_mode != DP_PANEL_MODE_DEFAULT);
 
 		if (link->aux_access_disabled) {
 			dc_link_dp_perform_link_training_skip_aux(link, &current_setting);
-- 
2.32.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] drm/amd/display: Fix ASSR regression on embedded panels
  2021-07-21  4:25 ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
  2021-07-21  4:25   ` [PATCH v2 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'" Stylon Wang
@ 2021-07-21  4:25   ` Stylon Wang
  2021-07-21 14:07   ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Deucher, Alexander
  2 siblings, 0 replies; 9+ messages in thread
From: Stylon Wang @ 2021-07-21  4:25 UTC (permalink / raw)
  To: amd-gfx
  Cc: Stylon Wang, Sunpeng.Li, Harry.Wentland, Qingqing.Zhuo,
	Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai, Alex Deucher,
	Bhawanpreet.Lakha, bindu.r

[Why]
Regression found in some embedded panels traces back to the earliest
upstreamed ASSR patch. The changed code flow are causing problems
with some panels.

[How]
- Change ASSR enabling code while preserving original code flow
  as much as possible
- Simplify the code on guarding with internal display flag

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=213779
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1620
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index cc62124b0b82..f56e061d35bc 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -1811,8 +1811,7 @@ bool perform_link_training_with_retries(
 					 */
 					panel_mode = DP_PANEL_MODE_DEFAULT;
 				}
-			} else
-				panel_mode = DP_PANEL_MODE_DEFAULT;
+			}
 		}
 #endif
 
@@ -4643,7 +4642,10 @@ enum dp_panel_mode dp_get_panel_mode(struct dc_link *link)
 		}
 	}
 
-	if (link->dpcd_caps.panel_mode_edp) {
+	if (link->dpcd_caps.panel_mode_edp &&
+		(link->connector_signal == SIGNAL_TYPE_EDP ||
+		 (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
+		  link->is_internal_display))) {
 		return DP_PANEL_MODE_EDP;
 	}
 
-- 
2.32.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR
  2021-07-21  4:25 ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
  2021-07-21  4:25   ` [PATCH v2 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'" Stylon Wang
  2021-07-21  4:25   ` [PATCH v2 2/2] drm/amd/display: Fix ASSR regression on embedded panels Stylon Wang
@ 2021-07-21 14:07   ` Deucher, Alexander
  2 siblings, 0 replies; 9+ messages in thread
From: Deucher, Alexander @ 2021-07-21 14:07 UTC (permalink / raw)
  To: Wang, Chao-kai (Stylon), amd-gfx
  Cc: Li, Sun peng (Leo),
	Lakha, Bhawanpreet, Zhuo, Qingqing, Siqueira, Rodrigo, Jacob,
	Anson, Pillai, Aurabindo, Wentland, Harry, R, Bindu


[-- Attachment #1.1: Type: text/plain, Size: 1884 bytes --]

[Public]

Series looks good to me. Thanks!

Alex

________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Stylon Wang <stylon.wang@amd.com>
Sent: Wednesday, July 21, 2021 12:25 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Zhuo, Qingqing <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Jacob, Anson <Anson.Jacob@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; R, Bindu <Bindu.R@amd.com>
Subject: [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR

Previous ASSR-enabling patches cause blank screen on some embedded
panels. This patch set minimize the changes made to code logic prior to
the ASSR change and also improve on code readability.

Changes from prior rev1 to now:

v2:
 - Update reviewed-by and bug links

Stylon Wang (2):
  drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display
    flag'"
  drm/amd/display: Fix ASSR regression on embedded panels

 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 58 +++++++------------
 1 file changed, 20 insertions(+), 38 deletions(-)

--
2.32.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C448d5309ea364844350d08d94bff9c47%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637624383495009435%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=KuBaIHeinOgubF5Mp%2FnZA45ia6FrxVdrNtTBwf7OqPE%3D&amp;reserved=0

[-- Attachment #1.2: Type: text/html, Size: 3751 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-07-21 14:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20  3:33 [PATCH 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
2021-07-20  3:33 ` [PATCH 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'" Stylon Wang
2021-07-20  3:33 ` [PATCH 2/2] drm/amd/display: Fix ASSR regression on embedded panels Stylon Wang
2021-07-20 13:34   ` Alex Deucher
2021-07-20 14:31     ` Alex Deucher
2021-07-21  4:25 ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Stylon Wang
2021-07-21  4:25   ` [PATCH v2 1/2] drm/amd/display: Revert "Re-enable 'Guard ASSR with internal display flag'" Stylon Wang
2021-07-21  4:25   ` [PATCH v2 2/2] drm/amd/display: Fix ASSR regression on embedded panels Stylon Wang
2021-07-21 14:07   ` [PATCH v2 0/2] Fix regression on embedded panels caused by enabling ASSR Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.