]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/display: disable SubVP + DRR to prevent underflow
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Wed, 15 Feb 2023 17:51:20 +0000 (12:51 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:47:15 +0000 (16:47 +0100)
BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit 80c6d6804f31451848a3956a70c2bcb1f07cfcb0 ]

[Why&How]
Temporarily disable SubVP+DRR since Xorg has an architectural limitation
where freesync will not work in a multi monitor configuration. SubVP+DRR
requires that freesync be working.

Whether OS has variable refresh setting enabled or not, the state on
the crtc remains same unless an application requests VRR. Due to this,
there is no way to know whether freesync will actually work or not
while we are on the desktop from the kernel's perspective.

If userspace does not have a limitation with multi-display freesync (for
example wayland), then this feature can be enabled by adding a
dcfeaturemask option to amdgpu on the kernel cmdline like:

amdgpu.dcfeaturemask=0x200

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
drivers/gpu/drm/amd/include/amd_shared.h

index 027ffa5ccda46284eb7418b761ee50ef7765d810..1ba8a2905f824e6b706aff4e95da325700a39f2b 100644 (file)
@@ -1551,6 +1551,11 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
        if (amdgpu_dc_feature_mask & DC_DISABLE_LTTPR_DP2_0)
                init_data.flags.allow_lttpr_non_transparent_mode.bits.DP2_0 = true;
 
+       /* Disable SubVP + DRR config by default */
+       init_data.flags.disable_subvp_drr = true;
+       if (amdgpu_dc_feature_mask & DC_ENABLE_SUBVP_DRR)
+               init_data.flags.disable_subvp_drr = false;
+
        init_data.flags.seamless_boot_edp_requested = false;
 
        if (check_seamless_boot_capability(adev)) {
index 85ebeaa2de18611c301561cbead702d9c6471420..37998dc0fc14425d0a35555fb9f1e94d698bb72c 100644 (file)
@@ -410,7 +410,7 @@ struct dc_config {
        bool force_bios_enable_lttpr;
        uint8_t force_bios_fixed_vs;
        int sdpif_request_limit_words_per_umc;
-
+       bool disable_subvp_drr;
 };
 
 enum visual_confirm {
index 8450f59c261862ef154be461d26edce4d2fb08ce..69e205ac58b25d096ea66813934e4452330cd994 100644 (file)
@@ -877,6 +877,10 @@ static bool subvp_drr_schedulable(struct dc *dc, struct dc_state *context, struc
        int16_t stretched_drr_us = 0;
        int16_t drr_stretched_vblank_us = 0;
        int16_t max_vblank_mallregion = 0;
+       const struct dc_config *config = &dc->config;
+
+       if (config->disable_subvp_drr)
+               return false;
 
        // Find SubVP pipe
        for (i = 0; i < dc->res_pool->pipe_count; i++) {
index f175e65b853a001ea1bcc66d8edfd5b726cbc952..e4a22c68517d1dc2be04b452d70ac3b096f5aa86 100644 (file)
@@ -240,6 +240,7 @@ enum DC_FEATURE_MASK {
        DC_DISABLE_LTTPR_DP2_0 = (1 << 6), //0x40, disabled by default
        DC_PSR_ALLOW_SMU_OPT = (1 << 7), //0x80, disabled by default
        DC_PSR_ALLOW_MULTI_DISP_OPT = (1 << 8), //0x100, disabled by default
+       DC_ENABLE_SUBVP_DRR = (1 << 9), // 0x200, disabled by default
 };
 
 enum DC_DEBUG_MASK {