From 0b3454b7c49bfc6aa7a1096d1aa9d059201a73a7 Mon Sep 17 00:00:00 2001 From: Tom St Denis Date: Tue, 16 May 2017 10:22:05 -0400 Subject: [PATCH] drm/amd/display: Tidy up mem_input_program_surface_flip_and_addr() Signed-off-by: Tom St Denis Reviewed-by: Harry Wentland Reviewed-by: Tony Cheng Signed-off-by: Alex Deucher --- .../drm/amd/display/dc/dce/dce_mem_input.c | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c index 718688c41f7b..673371e5f9f0 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c @@ -625,18 +625,12 @@ static bool dce_mi_program_surface_flip_and_addr( * non-XDMA Mode: GRPH_SURFACE_UPDATE_IMMEDIATE_EN = 1 * XDMA Mode: GRPH_SURFACE_UPDATE_H_RETRACE_EN = 1 */ - REG_UPDATE(GRPH_UPDATE, - GRPH_UPDATE_LOCK, 1); - - if (flip_immediate) { - REG_UPDATE_2(GRPH_FLIP_CONTROL, - GRPH_SURFACE_UPDATE_IMMEDIATE_EN, 0, - GRPH_SURFACE_UPDATE_H_RETRACE_EN, 1); - } else { - REG_UPDATE_2(GRPH_FLIP_CONTROL, - GRPH_SURFACE_UPDATE_IMMEDIATE_EN, 0, - GRPH_SURFACE_UPDATE_H_RETRACE_EN, 0); - } + REG_UPDATE(GRPH_UPDATE, GRPH_UPDATE_LOCK, 1); + + REG_UPDATE_2( + GRPH_FLIP_CONTROL, + GRPH_SURFACE_UPDATE_IMMEDIATE_EN, 0, + GRPH_SURFACE_UPDATE_H_RETRACE_EN, flip_immediate ? 1 : 0); switch (address->type) { case PLN_ADDR_TYPE_GRAPHICS: @@ -645,8 +639,8 @@ static bool dce_mi_program_surface_flip_and_addr( program_pri_addr(dce_mi, address->grph.addr); break; case PLN_ADDR_TYPE_GRPH_STEREO: - if (address->grph_stereo.left_addr.quad_part == 0 - || address->grph_stereo.right_addr.quad_part == 0) + if (address->grph_stereo.left_addr.quad_part == 0 || + address->grph_stereo.right_addr.quad_part == 0) break; program_pri_addr(dce_mi, address->grph_stereo.left_addr); program_sec_addr(dce_mi, address->grph_stereo.right_addr); @@ -662,8 +656,7 @@ static bool dce_mi_program_surface_flip_and_addr( if (flip_immediate) mem_input->current_address = *address; - REG_UPDATE(GRPH_UPDATE, - GRPH_UPDATE_LOCK, 0); + REG_UPDATE(GRPH_UPDATE, GRPH_UPDATE_LOCK, 0); return true; } -- 2.30.2