drm/amd/display: Add capability check for static ramp calc
authorJaehyun Chung <jaehyun.chung@amd.com>
Mon, 23 Sep 2019 14:00:57 +0000 (10:00 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Oct 2019 00:34:20 +0000 (19:34 -0500)
[Why]
Static ramp to max refresh rate does not have capability check on
calculated v_total. Programming a lower v_total_min and max than the
total causes continuous spurious HPDs.

[How]
Add a capability check after v_total calculation similar to calculate
v_total helper functions.

Signed-off-by: Jaehyun Chung <jaehyun.chung@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/freesync/freesync.c

index ee89bd2f7fe478faf1f0f1beb95c38ca9047b6c7..16e69bbc69aaa7b04a458880199962199abdf824 100644 (file)
@@ -234,6 +234,10 @@ static void update_v_total_for_static_ramp(
                        current_duration_in_us) * (stream->timing.pix_clk_100hz / 10)),
                                stream->timing.h_total), 1000);
 
+       /* v_total cannot be less than nominal */
+       if (v_total < stream->timing.v_total)
+               v_total = stream->timing.v_total;
+
        in_out_vrr->adjust.v_total_min = v_total;
        in_out_vrr->adjust.v_total_max = v_total;
 }