drm/amd/display: read PSR-SU cap DPCD for specific panel
authorDavid Zhang <dingchen.zhang@amd.com>
Mon, 11 Apr 2022 20:04:39 +0000 (16:04 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 25 Apr 2022 21:10:43 +0000 (17:10 -0400)
[why & how]
For some specific eDP panel, we'd check the PSR-SU cap during boot
by reading the vendor specific DPCD, otherwise it will cause to
false report the eDP panel which supports PSR-SU as an non-PSR-SU
panel.

- add the vendor specific DPCD address in ddc_service_types header
- if specific eDP panel detected, check vendor specific DPCD for
  PSR-SU cap

Reviewed-by: Aurabindo Jayamohanan Pillai <Aurabindo.Pillai@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: David Zhang <dingchen.zhang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/include/ddc_service_types.h

index c5f5d25..10f990e 100644 (file)
@@ -5822,6 +5822,10 @@ void detect_edp_sink_caps(struct dc_link *link)
                core_link_read_dpcd(link, DP_PSR_SUPPORT,
                        &link->dpcd_caps.psr_info.psr_version,
                        sizeof(link->dpcd_caps.psr_info.psr_version));
+               if (link->dpcd_caps.sink_dev_id == DP_BRANCH_DEVICE_ID_001CF8)
+                       core_link_read_dpcd(link, DP_FORCE_PSRSU_CAPABILITY,
+                                               &link->dpcd_caps.psr_info.force_psrsu_cap,
+                                               sizeof(link->dpcd_caps.psr_info.force_psrsu_cap));
                core_link_read_dpcd(link, DP_PSR_CAPS,
                        &link->dpcd_caps.psr_info.psr_dpcd_caps.raw,
                        sizeof(link->dpcd_caps.psr_info.psr_dpcd_caps.raw));
index f883d87..73b9e0a 100644 (file)
@@ -39,6 +39,8 @@
 #define DP_BRANCH_HW_REV_20 0x20
 
 #define DP_DEVICE_ID_38EC11 0x38EC11
+#define DP_FORCE_PSRSU_CAPABILITY 0x40F
+
 enum ddc_result {
        DDC_RESULT_UNKNOWN = 0,
        DDC_RESULT_SUCESSFULL,