diff mbox series

[v4,1/4] drm/msm/dp: Fix support of LTTPR initialization

Message ID 20250430001330.265970-2-alex.vinarskis@gmail.com
State Superseded
Headers show
Series drm/msm/dp: Introduce link training per-segment for LTTPRs | expand

Commit Message

Aleksandrs Vinarskis April 30, 2025, 12:09 a.m. UTC
Initialize LTTPR before msm_dp_panel_read_sink_caps, as DPTX shall
(re)read DPRX caps after LTTPR detection, as required by DP 2.1,
Section 3.6.7.6.1.

Fixes: 72d0af4accd9 ("drm/msm/dp: Add support for LTTPR handling")

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Rob Clark <robdclark@gmail.com>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Jessica Zhang May 2, 2025, 5:41 p.m. UTC | #1
On 4/29/2025 5:09 PM, Aleksandrs Vinarskis wrote:
> Initialize LTTPR before msm_dp_panel_read_sink_caps, as DPTX shall
> (re)read DPRX caps after LTTPR detection, as required by DP 2.1,
> Section 3.6.7.6.1.
> 
> Fixes: 72d0af4accd9 ("drm/msm/dp: Add support for LTTPR handling")
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
> Tested-by: Johan Hovold <johan+linaro@kernel.org>
> Tested-by: Rob Clark <robdclark@gmail.com>

Hi Aleksandrs,

For this patch and the rest of the series:

Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # SA8775P

Thanks,

Jessica Zhang

> ---
>   drivers/gpu/drm/msm/dp/dp_display.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index bbc47d86ae9e..fc07cce68382 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -367,12 +367,12 @@ static int msm_dp_display_send_hpd_notification(struct msm_dp_display_private *d
>   	return 0;
>   }
>   
> -static void msm_dp_display_lttpr_init(struct msm_dp_display_private *dp)
> +static void msm_dp_display_lttpr_init(struct msm_dp_display_private *dp, u8 *dpcd)
>   {
>   	u8 lttpr_caps[DP_LTTPR_COMMON_CAP_SIZE];
>   	int rc;
>   
> -	if (drm_dp_read_lttpr_common_caps(dp->aux, dp->panel->dpcd, lttpr_caps))
> +	if (drm_dp_read_lttpr_common_caps(dp->aux, dpcd, lttpr_caps))
>   		return;
>   
>   	rc = drm_dp_lttpr_init(dp->aux, drm_dp_lttpr_count(lttpr_caps));
> @@ -385,12 +385,17 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
>   	struct drm_connector *connector = dp->msm_dp_display.connector;
>   	const struct drm_display_info *info = &connector->display_info;
>   	int rc = 0;
> +	u8 dpcd[DP_RECEIVER_CAP_SIZE];
>   
> -	rc = msm_dp_panel_read_sink_caps(dp->panel, connector);
> +	rc = drm_dp_read_dpcd_caps(dp->aux, dpcd);
>   	if (rc)
>   		goto end;
>   
> -	msm_dp_display_lttpr_init(dp);
> +	msm_dp_display_lttpr_init(dp, dpcd);
> +
> +	rc = msm_dp_panel_read_sink_caps(dp->panel, connector);
> +	if (rc)
> +		goto end;
>   
>   	msm_dp_link_process_request(dp->link);
>
Dmitry Baryshkov May 2, 2025, 9:54 p.m. UTC | #2
On Fri, May 02, 2025 at 10:41:41AM -0700, Jessica Zhang wrote:
> 
> 
> On 4/29/2025 5:09 PM, Aleksandrs Vinarskis wrote:
> > Initialize LTTPR before msm_dp_panel_read_sink_caps, as DPTX shall
> > (re)read DPRX caps after LTTPR detection, as required by DP 2.1,
> > Section 3.6.7.6.1.
> > 
> > Fixes: 72d0af4accd9 ("drm/msm/dp: Add support for LTTPR handling")
> > 
> > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
> > Tested-by: Johan Hovold <johan+linaro@kernel.org>
> > Tested-by: Rob Clark <robdclark@gmail.com>
> 
> Hi Aleksandrs,
> 
> For this patch and the rest of the series:
> 
> Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # SA8775P

Were you testing in a setup with LTTPRs?
Jessica Zhang May 2, 2025, 11:01 p.m. UTC | #3
On 5/2/2025 2:54 PM, Dmitry Baryshkov wrote:
> On Fri, May 02, 2025 at 10:41:41AM -0700, Jessica Zhang wrote:
>>
>>
>> On 4/29/2025 5:09 PM, Aleksandrs Vinarskis wrote:
>>> Initialize LTTPR before msm_dp_panel_read_sink_caps, as DPTX shall
>>> (re)read DPRX caps after LTTPR detection, as required by DP 2.1,
>>> Section 3.6.7.6.1.
>>>
>>> Fixes: 72d0af4accd9 ("drm/msm/dp: Add support for LTTPR handling")
>>>
>>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>> Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
>>> Tested-by: Johan Hovold <johan+linaro@kernel.org>
>>> Tested-by: Rob Clark <robdclark@gmail.com>
>>
>> Hi Aleksandrs,
>>
>> For this patch and the rest of the series:
>>
>> Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # SA8775P
> 
> Were you testing in a setup with LTTPRs?

Hi Dmitry,

No, I have a setup with MST so I re-verified SST and MST with these changes.

Thanks,

Jessica Zhang

>
Dmitry Baryshkov May 3, 2025, 3:24 a.m. UTC | #4
On Fri, May 02, 2025 at 04:01:35PM -0700, Jessica Zhang wrote:
> 
> 
> On 5/2/2025 2:54 PM, Dmitry Baryshkov wrote:
> > On Fri, May 02, 2025 at 10:41:41AM -0700, Jessica Zhang wrote:
> > > 
> > > 
> > > On 4/29/2025 5:09 PM, Aleksandrs Vinarskis wrote:
> > > > Initialize LTTPR before msm_dp_panel_read_sink_caps, as DPTX shall
> > > > (re)read DPRX caps after LTTPR detection, as required by DP 2.1,
> > > > Section 3.6.7.6.1.
> > > > 
> > > > Fixes: 72d0af4accd9 ("drm/msm/dp: Add support for LTTPR handling")
> > > > 
> > > > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > > > Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
> > > > Tested-by: Johan Hovold <johan+linaro@kernel.org>
> > > > Tested-by: Rob Clark <robdclark@gmail.com>
> > > 
> > > Hi Aleksandrs,
> > > 
> > > For this patch and the rest of the series:
> > > 
> > > Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # SA8775P
> > 
> > Were you testing in a setup with LTTPRs?
> 
> Hi Dmitry,
> 
> No, I have a setup with MST so I re-verified SST and MST with these changes.

Ack, thank you. I was hoping that you have some interesting dock setup.

> 
> Thanks,
> 
> Jessica Zhang
> 
> > 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index bbc47d86ae9e..fc07cce68382 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -367,12 +367,12 @@  static int msm_dp_display_send_hpd_notification(struct msm_dp_display_private *d
 	return 0;
 }
 
-static void msm_dp_display_lttpr_init(struct msm_dp_display_private *dp)
+static void msm_dp_display_lttpr_init(struct msm_dp_display_private *dp, u8 *dpcd)
 {
 	u8 lttpr_caps[DP_LTTPR_COMMON_CAP_SIZE];
 	int rc;
 
-	if (drm_dp_read_lttpr_common_caps(dp->aux, dp->panel->dpcd, lttpr_caps))
+	if (drm_dp_read_lttpr_common_caps(dp->aux, dpcd, lttpr_caps))
 		return;
 
 	rc = drm_dp_lttpr_init(dp->aux, drm_dp_lttpr_count(lttpr_caps));
@@ -385,12 +385,17 @@  static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
 	struct drm_connector *connector = dp->msm_dp_display.connector;
 	const struct drm_display_info *info = &connector->display_info;
 	int rc = 0;
+	u8 dpcd[DP_RECEIVER_CAP_SIZE];
 
-	rc = msm_dp_panel_read_sink_caps(dp->panel, connector);
+	rc = drm_dp_read_dpcd_caps(dp->aux, dpcd);
 	if (rc)
 		goto end;
 
-	msm_dp_display_lttpr_init(dp);
+	msm_dp_display_lttpr_init(dp, dpcd);
+
+	rc = msm_dp_panel_read_sink_caps(dp->panel, connector);
+	if (rc)
+		goto end;
 
 	msm_dp_link_process_request(dp->link);