Commit 7513ccb8 authored by Aleksandrs Vinarskis's avatar Aleksandrs Vinarskis Committed by Dmitry Baryshkov
Browse files

drm/msm/dp: Prepare for link training per-segment for LTTPRs



Per-segment link training requires knowing the number of LTTPRs
(if any) present. Store the count during LTTPRs' initialization.

Fixes: 72d0af4a ("drm/msm/dp: Add support for LTTPR handling")
Reviewed-by: default avatarAbel Vesa <abel.vesa@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: default avatarAleksandrs Vinarskis <alex.vinarskis@gmail.com>
Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # SA8775P
Tested-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Tested-by: default avatarRob Clark <robdclark@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/652306/
Link: https://lore.kernel.org/r/20250507230113.14270-4-alex.vinarskis@gmail.com


Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
parent c156fe2d
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -360,16 +360,21 @@ 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, u8 *dpcd)
static int msm_dp_display_lttpr_init(struct msm_dp_display_private *dp, u8 *dpcd)
{
	int rc;
	int rc, lttpr_count;

	if (drm_dp_read_lttpr_common_caps(dp->aux, dpcd, dp->link->lttpr_common_caps))
		return;
		return 0;

	rc = drm_dp_lttpr_init(dp->aux, drm_dp_lttpr_count(dp->link->lttpr_common_caps));
	if (rc)
	lttpr_count = drm_dp_lttpr_count(dp->link->lttpr_common_caps);
	rc = drm_dp_lttpr_init(dp->aux, lttpr_count);
	if (rc) {
		DRM_ERROR("failed to set LTTPRs transparency mode, rc=%d\n", rc);
		return 0;
	}

	return lttpr_count;
}

static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
@@ -383,7 +388,7 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
	if (rc)
		goto end;

	msm_dp_display_lttpr_init(dp, dpcd);
	dp->link->lttpr_count = msm_dp_display_lttpr_init(dp, dpcd);

	rc = msm_dp_panel_read_sink_caps(dp->panel, connector);
	if (rc)
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ struct msm_dp_link_phy_params {

struct msm_dp_link {
	u8 lttpr_common_caps[DP_LTTPR_COMMON_CAP_SIZE];
	int lttpr_count;

	u32 sink_request;
	u32 test_response;