]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Enalbe blank data double buffer after mpc disconnected.
authorYongqiang Sun <yongqiang.sun@amd.com>
Mon, 23 Oct 2017 19:57:52 +0000 (15:57 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2017 17:47:26 +0000 (12:47 -0500)
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/dcn10/dcn10_timing_generator.c
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h

index c178cc0bd4260ba04fc44a71e6352d0ae997f186..5d1edb017b1c7b46a899a71390aa533b271eef9a 100644 (file)
@@ -290,6 +290,16 @@ static void tgn10_program_timing(
 
 }
 
+static void tgn10_set_blank_data_double_buffer(struct timing_generator *tg, bool enable)
+{
+       struct dcn10_timing_generator *tgn10 = DCN10TG_FROM_TG(tg);
+
+       uint32_t blank_data_double_buffer_enable = enable ? 1 : 0;
+
+       REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
+                       OTG_BLANK_DATA_DOUBLE_BUFFER_EN, blank_data_double_buffer_enable);
+}
+
 /**
  * unblank_crtc
  * Call ASIC Control Object to UnBlank CRTC.
@@ -306,8 +316,7 @@ static void tgn10_unblank_crtc(struct timing_generator *tg)
         * this check will be removed.
         */
        if (vertical_interrupt_enable)
-               REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
-                               OTG_BLANK_DATA_DOUBLE_BUFFER_EN, 1);
+               tgn10_set_blank_data_double_buffer(tg, true);
 
        REG_UPDATE_2(OTG_BLANK_CONTROL,
                        OTG_BLANK_DATA_EN, 0,
@@ -334,8 +343,7 @@ static void tgn10_blank_crtc(struct timing_generator *tg)
                        OTG_BLANK_DATA_EN, 1,
                        1, 100000);
 
-       REG_UPDATE(OTG_DOUBLE_BUFFER_CONTROL,
-                       OTG_BLANK_DATA_DOUBLE_BUFFER_EN, 0);
+       tgn10_set_blank_data_double_buffer(tg, false);
 }
 
 static void tgn10_set_blank(struct timing_generator *tg,
@@ -1234,7 +1242,8 @@ static const struct timing_generator_funcs dcn10_tg_funcs = {
                .set_static_screen_control = tgn10_set_static_screen_control,
                .set_test_pattern = tgn10_set_test_pattern,
                .program_stereo = tgn10_program_stereo,
-               .is_stereo_left_eye = tgn10_is_stereo_left_eye
+               .is_stereo_left_eye = tgn10_is_stereo_left_eye,
+               .set_blank_data_double_buffer = tgn10_set_blank_data_double_buffer
 };
 
 void dcn10_timing_generator_init(struct dcn10_timing_generator *tgn10)
index 75f7a01b9175e63fecb2091e9d7cd318cb92e5f3..83f0b1d49e8b5534f242ca4446b44d3f21c7f073 100644 (file)
@@ -182,6 +182,8 @@ struct timing_generator_funcs {
        void (*program_stereo)(struct timing_generator *tg,
                const struct dc_crtc_timing *timing, struct crtc_stereo_flags *flags);
        bool (*is_stereo_left_eye)(struct timing_generator *tg);
+
+       void (*set_blank_data_double_buffer)(struct timing_generator *tg, bool enable);
 };
 
 #endif