From 38614212522d07835050c15eb877b6bd68bcebca Mon Sep 17 00:00:00 2001 From: Yongqiang Sun Date: Mon, 23 Oct 2017 15:57:52 -0400 Subject: [PATCH] drm/amd/display: Enalbe blank data double buffer after mpc disconnected. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- .../display/dc/dcn10/dcn10_timing_generator.c | 19 ++++++++++++++----- .../amd/display/dc/inc/hw/timing_generator.h | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c index c178cc0bd426..5d1edb017b1c 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c @@ -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) diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h b/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h index 75f7a01b9175..83f0b1d49e8b 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h @@ -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 -- 2.30.2