[PATCH 6/6] drm/amd/display: Tidy up mem_input_program_surface_flip_and_addr()

Tom St Denis tom.stdenis at amd.com
Tue May 16 14:22:05 UTC 2017


Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
 .../drm/amd/display/dc/dce120/dce120_mem_input.c   | 27 ++++++++--------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_mem_input.c
index c0677211bd93..5a7edfd8fbf7 100644
--- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_mem_input.c
+++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_mem_input.c
@@ -195,20 +195,12 @@ static bool mem_input_program_surface_flip_and_addr(
 	 * non-XDMA Mode: GRPH_SURFACE_UPDATE_IMMEDIATE_EN = 1
 	 * XDMA Mode: GRPH_SURFACE_UPDATE_H_RETRACE_EN = 1
 	 */
-	DCP_REG_UPDATE(DCP0_GRPH_UPDATE,
-			GRPH_UPDATE_LOCK, 1);
-
-	if (flip_immediate) {
-		DCP_REG_UPDATE_2(
-			DCP0_GRPH_FLIP_CONTROL,
-			GRPH_SURFACE_UPDATE_IMMEDIATE_EN, 0,
-			GRPH_SURFACE_UPDATE_H_RETRACE_EN, 1);
-	} else {
-		DCP_REG_UPDATE_2(
-			DCP0_GRPH_FLIP_CONTROL,
-			GRPH_SURFACE_UPDATE_IMMEDIATE_EN, 0,
-			GRPH_SURFACE_UPDATE_H_RETRACE_EN, 0);
-	}
+	DCP_REG_UPDATE(DCP0_GRPH_UPDATE, GRPH_UPDATE_LOCK, 1);
+
+	DCP_REG_UPDATE_2(
+		DCP0_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:
@@ -217,8 +209,8 @@ static bool mem_input_program_surface_flip_and_addr(
 		program_pri_addr(mem_input110, 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(mem_input110, address->grph_stereo.left_addr);
 		program_sec_addr(mem_input110, address->grph_stereo.right_addr);
@@ -234,8 +226,7 @@ static bool mem_input_program_surface_flip_and_addr(
 	if (flip_immediate)
 		mem_input->current_address = *address;
 
-	DCP_REG_UPDATE(DCP0_GRPH_UPDATE,
-			GRPH_UPDATE_LOCK, 0);
+	DCP_REG_UPDATE(DCP0_GRPH_UPDATE, GRPH_UPDATE_LOCK, 0);
 
 	return true;
 }
-- 
2.12.0



More information about the amd-gfx mailing list