drm/amd/display: ensure FS is enabled before sending request to DMUB for FS changes
authorSamson Tam <samson.tam@amd.com>
Sat, 12 Aug 2023 00:02:17 +0000 (20:02 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 30 Aug 2023 19:01:33 +0000 (15:01 -0400)
[Why]
ignore_msa_timing_param indicates FS is capable but not necessarily enabled

[How]
add check for either allow_freesync or vrr_active_variable to confirm FS is enabled

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Samson Tam <samson.tam@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_dmub_srv.c

index f32b5c71a66b0a9619e93e03bb7d3a746995b369..b46a26a8ad4c52385224c9a3f8f2150bacf82d52 100644 (file)
@@ -552,7 +552,8 @@ static void populate_subvp_cmd_vblank_pipe_info(struct dc *dc,
        pipe_data->pipe_config.vblank_data.vblank_end =
                        vblank_pipe->stream->timing.v_total - vblank_pipe->stream->timing.v_front_porch - vblank_pipe->stream->timing.v_addressable;
 
-       if (vblank_pipe->stream->ignore_msa_timing_param)
+       if (vblank_pipe->stream->ignore_msa_timing_param &&
+               (vblank_pipe->stream->allow_freesync || vblank_pipe->stream->vrr_active_variable))
                populate_subvp_cmd_drr_info(dc, pipe, vblank_pipe, pipe_data);
 }
 
@@ -645,7 +646,8 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,
                        main_timing->v_total - main_timing->v_front_porch - main_timing->v_addressable;
        pipe_data->pipe_config.subvp_data.mall_region_lines = phantom_timing->v_addressable;
        pipe_data->pipe_config.subvp_data.main_pipe_index = subvp_pipe->stream_res.tg->inst;
-       pipe_data->pipe_config.subvp_data.is_drr = subvp_pipe->stream->ignore_msa_timing_param;
+       pipe_data->pipe_config.subvp_data.is_drr = subvp_pipe->stream->ignore_msa_timing_param &&
+               (subvp_pipe->stream->allow_freesync || subvp_pipe->stream->vrr_active_variable);
 
        /* Calculate the scaling factor from the src and dst height.
         * e.g. If 3840x2160 being downscaled to 1920x1080, the scaling factor is 1/2.