]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Support DRR granularity
authorWeiguang Li <wei-guang.li@amd.com>
Thu, 27 Nov 2025 09:49:49 +0000 (17:49 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Dec 2025 18:25:41 +0000 (13:25 -0500)
[Why&How]
Support DRR granularity for coasting Vtotal calculation

Reviewed-by: Robin Chen <robin.chen@amd.com>
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Weiguang Li <wei-guang.li@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@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/dc_dp_types.h
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
drivers/gpu/drm/amd/display/include/dpcd_defs.h

index 79e1696def63057ccfeabef28fb54927fa9af3ea..273610d85438b4c0daa41d57f0df9354168c1826 100644 (file)
@@ -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 {
index 3884851e2a9e7f924a94af5900d7698780195045..54c417928b61a303f5e89cdf069b6125b8e5054c 100644 (file)
@@ -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.
index 07b937b92efc7a31d3b0ca20847e615835abfb27..8445c540f042c4a29674a2594a00e79475f4b436 100644 (file)
@@ -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