]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/amd/display: set drr during program timing.
authorYongqiang Sun <yongqiang.sun@amd.com>
Mon, 26 Jun 2017 20:25:10 +0000 (16:25 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:08:32 +0000 (18:08 -0400)
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c
drivers/gpu/drm/amd/display/dc/dce120/dce120_timing_generator.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c

index ec599276ed2e7311c107d29123cc0965ccbdf96d..7f93d6d83cfda278d27b59710bff111a51d5e659 100644 (file)
@@ -629,6 +629,27 @@ void dce110_timing_generator_program_blanking(
                CRTC_V_TOTAL);
        dm_write_reg(ctx, addr, value);
 
+       /* In case of V_TOTAL_CONTROL is on, make sure V_TOTAL_MAX and
+        * V_TOTAL_MIN are equal to V_TOTAL.
+        */
+       addr = CRTC_REG(mmCRTC_V_TOTAL_MAX);
+       value = dm_read_reg(ctx, addr);
+       set_reg_field_value(
+               value,
+               timing->v_total - 1,
+               CRTC_V_TOTAL_MAX,
+               CRTC_V_TOTAL_MAX);
+       dm_write_reg(ctx, addr, value);
+
+       addr = CRTC_REG(mmCRTC_V_TOTAL_MIN);
+       value = dm_read_reg(ctx, addr);
+       set_reg_field_value(
+               value,
+               timing->v_total - 1,
+               CRTC_V_TOTAL_MIN,
+               CRTC_V_TOTAL_MIN);
+       dm_write_reg(ctx, addr, value);
+
        addr = CRTC_REG(mmCRTC_H_BLANK_START_END);
        value = dm_read_reg(ctx, addr);
 
index 03b21e9a115675539d09454568dca48d7eced598..58a070debd5866d1a3799e61f49f0084b7308937 100644 (file)
@@ -441,15 +441,28 @@ void dce120_timing_generator_program_blanking(
        struct dce110_timing_generator *tg110 = DCE110TG_FROM_TG(tg);
 
        CRTC_REG_UPDATE(
-                       CRTC0_CRTC_H_TOTAL,
-                       CRTC_H_TOTAL,
-                       timing->h_total - 1);
+               CRTC0_CRTC_H_TOTAL,
+               CRTC_H_TOTAL,
+               timing->h_total - 1);
 
        CRTC_REG_UPDATE(
                CRTC0_CRTC_V_TOTAL,
                CRTC_V_TOTAL,
                timing->v_total - 1);
 
+       /* In case of V_TOTAL_CONTROL is on, make sure V_TOTAL_MAX and
+        * V_TOTAL_MIN are equal to V_TOTAL.
+        */
+       CRTC_REG_UPDATE(
+               CRTC0_CRTC_V_TOTAL_MAX,
+               CRTC_V_TOTAL_MAX,
+               timing->v_total - 1);
+
+       CRTC_REG_UPDATE(
+               CRTC0_CRTC_V_TOTAL_MIN,
+               CRTC_V_TOTAL_MIN,
+               timing->v_total - 1);
+
        tmp1 = timing->h_total -
                        (h_sync_start + timing->h_border_left);
        tmp2 = tmp1 + timing->h_addressable +
index 5927478b90446ffdd1450e1ca5a3daaf89502e31..e1899f5fb0834d730ef29e1ec5369e7c15325b34 100644 (file)
@@ -177,6 +177,14 @@ static void tgn10_program_timing(
        REG_SET(OTG_V_TOTAL, 0,
                        OTG_V_TOTAL, v_total);
 
+       /* In case of V_TOTAL_CONTROL is on, make sure OTG_V_TOTAL_MAX and
+        * OTG_V_TOTAL_MIN are equal to V_TOTAL.
+        */
+       REG_SET(OTG_V_TOTAL_MAX, 0,
+               OTG_V_TOTAL_MAX, v_total);
+       REG_SET(OTG_V_TOTAL_MIN, 0,
+               OTG_V_TOTAL_MIN, v_total);
+
        /* v_sync_start = 0, v_sync_end = v_sync_width */
        v_sync_end = patched_crtc_timing.v_sync_width * interlace_factor;