Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Add panel replay enablement option and logic

[Why&How]
1.Add flow to enable and configure panel replay enablement and
configuration
2.Add registry key for enable option
3.Add replay version check to be compatible with freesync replay
4.Add AC/DC switch function to notify ac/dc change.
5.Add flow in set event function to check and decide Replay
enable/disable

Reviewed-by: Robin Chen <robin.chen@amd.com>
Signed-off-by: Jack Chang <jack.chang@amd.com>
Signed-off-by: Leon Huang <Leon.Huang1@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jack Chang and committed by
Alex Deucher
2e6c79e4 ddc6b22d

+168 -2
+25
drivers/gpu/drm/amd/display/dc/dc_dp_types.h
··· 1346 1346 unsigned char raw; 1347 1347 }; 1348 1348 1349 + union panel_replay_enable_and_configuration_1 { 1350 + struct { 1351 + unsigned char PANEL_REPLAY_ENABLE :1; 1352 + unsigned char PANEL_REPLAY_CRC_ENABLE :1; 1353 + unsigned char IRQ_HPD_ASSDP_MISSING :1; 1354 + unsigned char IRQ_HPD_VSCSDP_UNCORRECTABLE_ERROR :1; 1355 + unsigned char IRQ_HPD_RFB_ERROR :1; 1356 + unsigned char IRQ_HPD_ACTIVE_FRAME_CRC_ERROR :1; 1357 + unsigned char PANEL_REPLAY_SELECTIVE_UPDATE_ENABLE :1; 1358 + unsigned char PANEL_REPLAY_EARLY_TRANSPORT_ENABLE :1; 1359 + } bits; 1360 + unsigned char raw; 1361 + }; 1362 + 1363 + union panel_replay_enable_and_configuration_2 { 1364 + struct { 1365 + unsigned char SINK_REFRESH_RATE_UNLOCK_GRANTED :1; 1366 + unsigned char RESERVED :1; 1367 + unsigned char SU_Y_GRANULARITY_EXT_VALUE_ENABLED :1; 1368 + unsigned char SU_Y_GRANULARITY_EXT_VALUE :4; 1369 + unsigned char SU_REGION_SCAN_LINE_CAPTURE_INDICATION :1; 1370 + } bits; 1371 + unsigned char raw; 1372 + }; 1373 + 1349 1374 union dpcd_alpm_configuration { 1350 1375 struct { 1351 1376 unsigned char ENABLE : 1;
+16
drivers/gpu/drm/amd/display/include/dpcd_defs.h
··· 30 30 #ifndef DP_SINK_HW_REVISION_START // can remove this once the define gets into linux drm_dp_helper.h 31 31 #define DP_SINK_HW_REVISION_START 0x409 32 32 #endif 33 + /* Panel Replay*/ 34 + #ifndef DP_PANEL_REPLAY_CAPABILITY_SUPPORT // can remove this once the define gets into linux drm_dp_helper.h 35 + #define DP_PANEL_REPLAY_CAPABILITY_SUPPORT 0x0b0 36 + #endif /* DP_PANEL_REPLAY_CAPABILITY_SUPPORT */ 37 + #ifndef DP_PANEL_REPLAY_CAPABILITY // can remove this once the define gets into linux drm_dp_helper.h 38 + #define DP_PANEL_REPLAY_CAPABILITY 0x0b1 39 + #endif /* DP_PANEL_REPLAY_CAPABILITY */ 40 + #ifndef DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_1 // can remove this once the define gets into linux drm_dp_helper.h 41 + #define DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_1 0x1b0 42 + #endif /* DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_1 */ 43 + #ifndef DP_PANEL_REPLAY_ENABLE // can remove this once the define gets into linux drm_dp_helper.h 44 + #define DP_PANEL_REPLAY_ENABLE (1 << 0) 45 + #endif /* DP_PANEL_REPLAY_ENABLE */ 46 + #ifndef DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_2 // can remove this once the define gets into linux drm_dp_helper.h 47 + #define DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_2 0x1b1 48 + #endif /* DP_PANEL_REPLAY_ENABLE_AND_CONFIGURATION_2 */ 33 49 34 50 enum dpcd_revision { 35 51 DPCD_REV_10 = 0x10,
+3
drivers/gpu/drm/amd/display/modules/power/power_helpers.c
··· 1037 1037 uint8_t max_link_off_frame_count = 0; 1038 1038 uint16_t max_deviation_line = 0, pixel_deviation_per_line = 0; 1039 1039 1040 + if (!link || link->replay_settings.config.replay_version != DC_FREESYNC_REPLAY) 1041 + return; 1042 + 1040 1043 max_deviation_line = link->dpcd_caps.pr_info.max_deviation_line; 1041 1044 pixel_deviation_per_line = link->dpcd_caps.pr_info.pixel_deviation_per_line; 1042 1045