From 07e6c96c211c117927af2599c44c9a13f6975383 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 8 Jul 2024 02:18:34 +0000 Subject: [PATCH] drm/amd/display: Send DP_TOTAL_LTTPR_CNT during detection if LTTPR is present From Michael Strauss 89d8a851543e1aab6ea5c8a06d02dbe982948508 in linux-6.6.y/6.6.37 2ec6c7f802332d1eff16f03e7c757f1543ee1183 in mainline linux --- .../amd/display/dc/link/protocols/link_dp_capability.c | 10 +++++++++- sys/dev/pci/drm/amd/display/include/dpcd_defs.h | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/display/dc/link/protocols/link_dp_capability.c b/sys/dev/pci/drm/amd/display/dc/link/protocols/link_dp_capability.c index 0d2d269e8c9..5101c905423 100644 --- a/sys/dev/pci/drm/amd/display/dc/link/protocols/link_dp_capability.c +++ b/sys/dev/pci/drm/amd/display/dc/link/protocols/link_dp_capability.c @@ -1584,9 +1584,17 @@ static bool retrieve_link_cap(struct dc_link *link) return false; } - if (dp_is_lttpr_present(link)) + if (dp_is_lttpr_present(link)) { configure_lttpr_mode_transparent(link); + // Echo TOTAL_LTTPR_CNT back downstream + core_link_write_dpcd( + link, + DP_TOTAL_LTTPR_CNT, + &link->dpcd_caps.lttpr_caps.phy_repeater_cnt, + sizeof(link->dpcd_caps.lttpr_caps.phy_repeater_cnt)); + } + /* Read DP tunneling information. */ status = dpcd_get_tunneling_device_data(link); diff --git a/sys/dev/pci/drm/amd/display/include/dpcd_defs.h b/sys/dev/pci/drm/amd/display/include/dpcd_defs.h index 914f28e9f22..aee5170f5fb 100644 --- a/sys/dev/pci/drm/amd/display/include/dpcd_defs.h +++ b/sys/dev/pci/drm/amd/display/include/dpcd_defs.h @@ -177,4 +177,9 @@ enum dpcd_psr_sink_states { #define DP_SINK_PR_PIXEL_DEVIATION_PER_LINE 0x379 #define DP_SINK_PR_MAX_NUMBER_OF_DEVIATION_LINE 0x37A +/* Remove once drm_dp_helper.h is updated upstream */ +#ifndef DP_TOTAL_LTTPR_CNT +#define DP_TOTAL_LTTPR_CNT 0xF000A /* 2.1 */ +#endif + #endif /* __DAL_DPCD_DEFS_H__ */ -- 2.20.1