[PATCH 6/7] drm/amd/display: Moved swizzle parameter translation to dc.

Harry Wentland harry.wentland at amd.com
Wed Dec 14 22:35:47 UTC 2016


From: Yongqiang Sun <yongqiang.sun at amd.com>

Change-Id: I20ff413ea632082c302f531be0adba75a249ceaf
Signed-off-by: Yongqiang Sun <yongqiang.sun at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/dc/basics/conversion.c |  9 +++++++++
 drivers/gpu/drm/amd/display/dc/basics/conversion.h |  2 ++
 drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 11 +----------
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/basics/conversion.c b/drivers/gpu/drm/amd/display/dc/basics/conversion.c
index ebe14e17cc2e..5682fea2080d 100644
--- a/drivers/gpu/drm/amd/display/dc/basics/conversion.c
+++ b/drivers/gpu/drm/amd/display/dc/basics/conversion.c
@@ -221,3 +221,12 @@ void calculate_adjustments_y_only(
 		adjustments->brightness);
 }
 
+unsigned int log_2(unsigned int num)
+{
+	unsigned int result = 0;
+
+	while ((num >>= 1) != 0)
+		result++;
+
+	return result;
+}
diff --git a/drivers/gpu/drm/amd/display/dc/basics/conversion.h b/drivers/gpu/drm/amd/display/dc/basics/conversion.h
index 18cbe41e80ff..b7fe431a7952 100644
--- a/drivers/gpu/drm/amd/display/dc/basics/conversion.h
+++ b/drivers/gpu/drm/amd/display/dc/basics/conversion.h
@@ -48,4 +48,6 @@ void calculate_adjustments_y_only(
 	const struct dc_csc_adjustments *adjustments,
 	struct fixed31_32 *matrix);
 
+unsigned int log_2(unsigned int num);
+
 #endif
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 fd8a49afbec6..e9005e0048e6 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
@@ -25,6 +25,7 @@
 
 #include "mem_input.h"
 #include "reg_helper.h"
+#include "basics/conversion.h"
 
 #define CTX \
 	mi->ctx
@@ -129,16 +130,6 @@ static bool is_vert_scan(enum dc_rotation_angle rotation)
 	}
 }
 
-static unsigned int log_2(unsigned int num)
-{
-	unsigned int result = 0;
-
-	while ((num >>= 1) != 0)
-		result++;
-
-	return result;
-}
-
 void dce_mem_input_program_pte_vm(struct mem_input *mi,
 		enum surface_pixel_format format,
 		union dc_tiling_info *tiling_info,
-- 
2.9.3



More information about the amd-gfx mailing list