[PATCH 39/76] drm/amd/dal: Rotation and mirror support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vitaly Prosyak <vitaly.prosyak@xxxxxxx>

Add hardware programming for horizontal mirror.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak at amd.com>
Acked-by: Harry Wentland <harry.wentland at amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc.c                    | 3 +++
 drivers/gpu/drm/amd/dal/dc/dc.h                         | 1 +
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c | 4 +++-
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c    | 3 ++-
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h    | 3 ++-
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input_v.c  | 3 ++-
 drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h           | 3 ++-
 7 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index 766cdb1d4286..3b29ac471056 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -1354,6 +1354,7 @@ bool dc_commit_surfaces_to_target(
 		plane_info[i].format = new_surfaces[i]->format;
 		plane_info[i].plane_size = new_surfaces[i]->plane_size;
 		plane_info[i].rotation = new_surfaces[i]->rotation;
+		plane_info[i].horizontal_mirror = new_surfaces[i]->horizontal_mirror;
 		plane_info[i].stereo_format = new_surfaces[i]->stereo_format;
 		plane_info[i].tiling_info = new_surfaces[i]->tiling_info;
 		plane_info[i].visible = new_surfaces[i]->visible;
@@ -1456,6 +1457,8 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 						updates[i].plane_info->plane_size;
 					surface->public.rotation =
 						updates[i].plane_info->rotation;
+					surface->public.horizontal_mirror =
+						updates[i].plane_info->horizontal_mirror;
 					surface->public.stereo_format =
 						updates[i].plane_info->stereo_format;
 					surface->public.tiling_info =
diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h
index 0451b610b3e2..ba8190f8d168 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc.h
@@ -238,6 +238,7 @@ struct dc_plane_info {
 	union dc_tiling_info tiling_info;
 	enum surface_pixel_format format;
 	enum dc_rotation_angle rotation;
+	bool horizontal_mirror;
 	enum plane_stereo_format stereo_format;
 	enum dc_color_space color_space; /*todo: wrong place, fits in scaling info*/
 	bool visible;
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
index 486fdfa98608..a6679a95694e 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
@@ -1677,7 +1677,8 @@ static void set_plane_config(
 			&surface->public.tiling_info,
 			&surface->public.plane_size,
 			surface->public.rotation,
-			NULL);
+			NULL,
+			false);
 
 	if (dc->public.config.gpu_vm_support)
 		mi->funcs->mem_input_program_pte_vm(
@@ -2019,6 +2020,7 @@ static void dce110_program_front_end_for_pipe(
 			&surface->public.tiling_info,
 			&surface->public.plane_size,
 			surface->public.rotation,
+			false,
 			false);
 
 	if (dc->public.config.gpu_vm_support)
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
index 3183728ed417..3eb0e73d2eb6 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
@@ -525,7 +525,8 @@ bool dce110_mem_input_program_surface_config(
 	union dc_tiling_info *tiling_info,
 	union plane_size *plane_size,
 	enum dc_rotation_angle rotation,
-	struct dc_plane_dcc_param *dcc)
+	struct dc_plane_dcc_param *dcc,
+	bool horizotal_mirror)
 {
 	struct dce110_mem_input *mem_input110 = TO_DCE110_MEM_INPUT(mem_input);
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h
index c9e3f5c1fa22..7a521c56e8d9 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h
@@ -128,7 +128,8 @@ bool  dce110_mem_input_program_surface_config(
 	union dc_tiling_info *tiling_info,
 	union plane_size *plane_size,
 	enum dc_rotation_angle rotation,
-	struct dc_plane_dcc_param *dcc);
+	struct dc_plane_dcc_param *dcc,
+	bool horizontal_mirror);
 
 /*
  * dce110_mem_input_program_pte_vm
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input_v.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input_v.c
index 5376fed66c29..0903d3b4913d 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input_v.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input_v.c
@@ -666,7 +666,8 @@ bool dce110_mem_input_v_program_surface_config(
 	union dc_tiling_info *tiling_info,
 	union plane_size *plane_size,
 	enum dc_rotation_angle rotation,
-	struct dc_plane_dcc_param *dcc)
+	struct dc_plane_dcc_param *dcc,
+	bool horizotal_mirror)
 {
 	struct dce110_mem_input *mem_input110 = TO_DCE110_MEM_INPUT(mem_input);
 
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h b/drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h
index 9ad3b4218cb0..c743ae13cdf5 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/hw/mem_input.h
@@ -80,7 +80,8 @@ struct mem_input_funcs {
 		union dc_tiling_info *tiling_info,
 		union plane_size *plane_size,
 		enum dc_rotation_angle rotation,
-		struct dc_plane_dcc_param *dcc);
+		struct dc_plane_dcc_param *dcc,
+		bool horizontal_mirror);
 
 	bool (*mem_input_is_flip_pending)(struct mem_input *mem_input);
 };
-- 
2.10.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux