linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2]  fix DP phy compliance test
@ 2022-04-26  0:16 Kuogee Hsieh
  2022-04-26  0:16 ` [PATCH v2 1/2] drm/msm/dp: reset DP controller before transmit phy test pattern Kuogee Hsieh
  2022-04-26  0:16 ` [PATCH v2 2/2] drm/msm/dp: do not stop transmitting phy test pattern during DP phy compliance test Kuogee Hsieh
  0 siblings, 2 replies; 4+ messages in thread
From: Kuogee Hsieh @ 2022-04-26  0:16 UTC (permalink / raw)
  To: dri-devel, robdclark, sean, swboyd, vkoul, daniel, airlied,
	agross, dmitry.baryshkov, bjorn.andersson
  Cc: Kuogee Hsieh, quic_abhinavk, quic_aravindh, quic_sbillaka,
	freedreno, linux-arm-msm, linux-kernel

Current DP phy compliance test failed due to test pattern generation was
terminated premature.

Kuogee Hsieh (2):
  drm/msm/dp: reset DP controller before transmit phy test pattern
  drm/msm/dp: do not stop transmitting phy test pattern during DP phy
    compliance test

 drivers/gpu/drm/msm/dp/dp_ctrl.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* [PATCH v2 1/2] drm/msm/dp: reset DP controller before transmit phy test pattern
  2022-04-26  0:16 [PATCH v2 0/2] fix DP phy compliance test Kuogee Hsieh
@ 2022-04-26  0:16 ` Kuogee Hsieh
  2022-04-26  0:16 ` [PATCH v2 2/2] drm/msm/dp: do not stop transmitting phy test pattern during DP phy compliance test Kuogee Hsieh
  1 sibling, 0 replies; 4+ messages in thread
From: Kuogee Hsieh @ 2022-04-26  0:16 UTC (permalink / raw)
  To: dri-devel, robdclark, sean, swboyd, vkoul, daniel, airlied,
	agross, dmitry.baryshkov, bjorn.andersson
  Cc: Kuogee Hsieh, quic_abhinavk, quic_aravindh, quic_sbillaka,
	freedreno, linux-arm-msm, linux-kernel

DP controller state can not switch from video ready state to
transmit phy pattern state at run time. DP mainlink has to be
teared down followed by reset controller to default state to have
DP controller switch to transmit phy test pattern state and start
generate specified phy test pattern to sinker once main link setup
again.

Changes in v2:
-- correct Fixes's commit id

Fixes: 52352fe2f866 ("drm/msm/dp: use dp_ctrl_off_link_stream during PHY compliance test run")
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
index 5356856..193cc1a 100644
--- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
+++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
@@ -1532,7 +1532,7 @@ static int dp_ctrl_process_phy_test_request(struct dp_ctrl_private *ctrl)
 	 * running. Add the global reset just before disabling the
 	 * link clocks and core clocks.
 	 */
-	ret = dp_ctrl_off_link_stream(&ctrl->dp_ctrl);
+	ret = dp_ctrl_off(&ctrl->dp_ctrl);
 	if (ret) {
 		DRM_ERROR("failed to disable DP controller\n");
 		return ret;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* [PATCH v2 2/2] drm/msm/dp: do not stop transmitting phy test pattern during DP phy compliance test
  2022-04-26  0:16 [PATCH v2 0/2] fix DP phy compliance test Kuogee Hsieh
  2022-04-26  0:16 ` [PATCH v2 1/2] drm/msm/dp: reset DP controller before transmit phy test pattern Kuogee Hsieh
@ 2022-04-26  0:16 ` Kuogee Hsieh
  2022-04-26 16:48   ` Stephen Boyd
  1 sibling, 1 reply; 4+ messages in thread
From: Kuogee Hsieh @ 2022-04-26  0:16 UTC (permalink / raw)
  To: dri-devel, robdclark, sean, swboyd, vkoul, daniel, airlied,
	agross, dmitry.baryshkov, bjorn.andersson
  Cc: Kuogee Hsieh, quic_abhinavk, quic_aravindh, quic_sbillaka,
	freedreno, linux-arm-msm, linux-kernel

At normal operation, transmit phy test pattern has to be terminated before
DP controller switch to video ready state. However during phy compliance
testing, transmit phy test pattern should not be terminated until end of
compliance test which usually indicated by unplugged interrupt.

Only stop sending the train pattern in dp_ctrl_on_stream() if we're not
doing compliance testing. We also no longer reset 'p_level' and
'v_level' within dp_ctrl_on_link() due to both 'p_level' and 'v_level'
are acquired from link status at previous dpcd read and we like to use
those level to start link training.

Changes in v2:
-- add more details commit text
-- correct Fixes

Fixes: 2e0adc765d88 ("drm/msm/dp: do not end dp link training until video is ready")
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
index 193cc1a..f99e173 100644
--- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
+++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
@@ -1699,8 +1699,6 @@ int dp_ctrl_on_link(struct dp_ctrl *dp_ctrl)
 		ctrl->link->link_params.rate,
 		ctrl->link->link_params.num_lanes, ctrl->dp_ctrl.pixel_rate);
 
-	ctrl->link->phy_params.p_level = 0;
-	ctrl->link->phy_params.v_level = 0;
 
 	rc = dp_ctrl_enable_mainlink_clocks(ctrl);
 	if (rc)
@@ -1822,12 +1820,6 @@ int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl)
 		}
 	}
 
-	if (!dp_ctrl_channel_eq_ok(ctrl))
-		dp_ctrl_link_retrain(ctrl);
-
-	/* stop txing train pattern to end link training */
-	dp_ctrl_clear_training_pattern(ctrl);
-
 	ret = dp_ctrl_enable_stream_clocks(ctrl);
 	if (ret) {
 		DRM_ERROR("Failed to start pixel clocks. ret=%d\n", ret);
@@ -1839,6 +1831,13 @@ int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl)
 		return 0;
 	}
 
+	if (!dp_ctrl_channel_eq_ok(ctrl)) {
+		dp_ctrl_link_retrain(ctrl);
+	}
+
+	/* stop txing train pattern to end link training */
+	dp_ctrl_clear_training_pattern(ctrl);
+
 	/*
 	 * Set up transfer unit values and set controller state to send
 	 * video.
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* Re: [PATCH v2 2/2] drm/msm/dp: do not stop transmitting phy test pattern during DP phy compliance test
  2022-04-26  0:16 ` [PATCH v2 2/2] drm/msm/dp: do not stop transmitting phy test pattern during DP phy compliance test Kuogee Hsieh
@ 2022-04-26 16:48   ` Stephen Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2022-04-26 16:48 UTC (permalink / raw)
  To: Kuogee Hsieh, agross, airlied, bjorn.andersson, daniel,
	dmitry.baryshkov, dri-devel, robdclark, sean, vkoul
  Cc: quic_abhinavk, quic_aravindh, quic_sbillaka, freedreno,
	linux-arm-msm, linux-kernel

Quoting Kuogee Hsieh (2022-04-25 17:16:53)
> At normal operation, transmit phy test pattern has to be terminated before
> DP controller switch to video ready state. However during phy compliance
> testing, transmit phy test pattern should not be terminated until end of
> compliance test which usually indicated by unplugged interrupt.
>
> Only stop sending the train pattern in dp_ctrl_on_stream() if we're not
> doing compliance testing. We also no longer reset 'p_level' and
> 'v_level' within dp_ctrl_on_link() due to both 'p_level' and 'v_level'
> are acquired from link status at previous dpcd read and we like to use
> those level to start link training.
>
> Changes in v2:
> -- add more details commit text
> -- correct Fixes
>
> Fixes: 2e0adc765d88 ("drm/msm/dp: do not end dp link training until video is ready")
> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

One comment.

> diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
> index 193cc1a..f99e173 100644
> --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
> +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
> @@ -1839,6 +1831,13 @@ int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl)
>                 return 0;
>         }
>
> +       if (!dp_ctrl_channel_eq_ok(ctrl)) {
> +               dp_ctrl_link_retrain(ctrl);
> +       }

Drop unnecessary braces.

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

end of thread, other threads:[~2022-04-26 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26  0:16 [PATCH v2 0/2] fix DP phy compliance test Kuogee Hsieh
2022-04-26  0:16 ` [PATCH v2 1/2] drm/msm/dp: reset DP controller before transmit phy test pattern Kuogee Hsieh
2022-04-26  0:16 ` [PATCH v2 2/2] drm/msm/dp: do not stop transmitting phy test pattern during DP phy compliance test Kuogee Hsieh
2022-04-26 16:48   ` Stephen Boyd

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).