From: Weiguang Li Date: Thu, 27 Nov 2025 09:49:49 +0000 (+0800) Subject: drm/amd/display: Support DRR granularity X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f912935168a3122371f1de85eed8d9cce192d0c;p=thirdparty%2Fkernel%2Flinux.git drm/amd/display: Support DRR granularity [Why&How] Support DRR granularity for coasting Vtotal calculation Reviewed-by: Robin Chen Reviewed-by: Wenjing Liu Signed-off-by: Weiguang Li Signed-off-by: Chenyu Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/dc_dp_types.h b/drivers/gpu/drm/amd/display/dc/dc_dp_types.h index 79e1696def630..273610d85438b 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_dp_types.h +++ b/drivers/gpu/drm/amd/display/dc/dc_dp_types.h @@ -1296,6 +1296,7 @@ struct dpcd_caps { /* Indicates the number of SST links supported by MSO (Multi-Stream Output) */ uint8_t mso_cap_sst_links_supported; uint8_t dp_edp_general_cap_2; + uint16_t drr_granularity; }; union dpcd_sink_ext_caps { diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c index 3884851e2a9e7..54c417928b61a 100644 --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c @@ -2219,6 +2219,13 @@ void detect_edp_sink_caps(struct dc_link *link) (uint8_t *)&link->dpcd_caps.edp_oled_emission_rate, sizeof(link->dpcd_caps.edp_oled_emission_rate)); + /* + * Read DRR granularity + */ + core_link_read_dpcd(link, DP_SINK_DRR_GRANULARITY, + (uint8_t *)&link->dpcd_caps.drr_granularity, + sizeof(link->dpcd_caps.drr_granularity)); + /* * Read Multi-SST (Single Stream Transport) capability * for eDP version 1.4 or higher. diff --git a/drivers/gpu/drm/amd/display/include/dpcd_defs.h b/drivers/gpu/drm/amd/display/include/dpcd_defs.h index 07b937b92efc7..8445c540f042c 100644 --- a/drivers/gpu/drm/amd/display/include/dpcd_defs.h +++ b/drivers/gpu/drm/amd/display/include/dpcd_defs.h @@ -188,6 +188,7 @@ enum dpcd_psr_sink_states { #define DP_SOURCE_BACKLIGHT_CURRENT_PEAK 0x326 #define DP_SOURCE_BACKLIGHT_CONTROL 0x32E #define DP_SOURCE_BACKLIGHT_ENABLE 0x32F +#define DP_SINK_DRR_GRANULARITY 0x33B #define DP_SOURCE_MINIMUM_HBLANK_SUPPORTED 0x340 #define DP_SINK_PR_REPLAY_STATUS 0x378 #define DP_SINK_PR_PIXEL_DEVIATION_PER_LINE 0x379