aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4705-drm-amd-display-fix-cursor-positioning-for-multiplan.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4705-drm-amd-display-fix-cursor-positioning-for-multiplan.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4705-drm-amd-display-fix-cursor-positioning-for-multiplan.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4705-drm-amd-display-fix-cursor-positioning-for-multiplan.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4705-drm-amd-display-fix-cursor-positioning-for-multiplan.patch
new file mode 100644
index 00000000..bc9d5d05
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4705-drm-amd-display-fix-cursor-positioning-for-multiplan.patch
@@ -0,0 +1,67 @@
+From 460d5ac8ad145c412be735e1593b57eaa4098b19 Mon Sep 17 00:00:00 2001
+From: Aric Cyr <aric.cyr@amd.com>
+Date: Sat, 9 Nov 2019 18:30:40 -0500
+Subject: [PATCH 4705/4736] drm/amd/display: fix cursor positioning for
+ multiplane cases
+
+[Why]
+Cursor position needs to take into account plane scaling as well.
+
+[How]
+Translate cursor coords from stream space to plane space.
+
+Signed-off-by: Aric Cyr <aric.cyr@amd.com>
+Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
+Acked-by: Leo Li <sunpeng.li@amd.com>
+Acked-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
+---
+ .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 33 ++++++++++++++-----
+ 1 file changed, 24 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+index 0e1e3dcf4112..c085a561b24c 100644
+--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
++++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+@@ -2917,15 +2917,30 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
+ .rotation = pipe_ctx->plane_state->rotation,
+ .mirror = pipe_ctx->plane_state->horizontal_mirror
+ };
+- uint32_t x_plane = pipe_ctx->plane_state->dst_rect.x;
+- uint32_t y_plane = pipe_ctx->plane_state->dst_rect.y;
+- uint32_t x_offset = min(x_plane, pos_cpy.x);
+- uint32_t y_offset = min(y_plane, pos_cpy.y);
+-
+- pos_cpy.x -= x_offset;
+- pos_cpy.y -= y_offset;
+- pos_cpy.x_hotspot += (x_plane - x_offset);
+- pos_cpy.y_hotspot += (y_plane - y_offset);
++
++ int x_plane = pipe_ctx->plane_state->dst_rect.x;
++ int y_plane = pipe_ctx->plane_state->dst_rect.y;
++ int x_pos = pos_cpy.x;
++ int y_pos = pos_cpy.y;
++
++ // translate cursor from stream space to plane space
++ x_pos = (x_pos - x_plane) * pipe_ctx->plane_state->src_rect.width /
++ pipe_ctx->plane_state->dst_rect.width;
++ y_pos = (y_pos - y_plane) * pipe_ctx->plane_state->src_rect.height /
++ pipe_ctx->plane_state->dst_rect.height;
++
++ if (x_pos < 0) {
++ pos_cpy.x_hotspot -= x_pos;
++ x_pos = 0;
++ }
++
++ if (y_pos < 0) {
++ pos_cpy.y_hotspot -= y_pos;
++ y_pos = 0;
++ }
++
++ pos_cpy.x = (uint32_t)x_pos;
++ pos_cpy.y = (uint32_t)y_pos;
+
+ if (pipe_ctx->plane_state->address.type
+ == PLN_ADDR_TYPE_VIDEO_PROGRESSIVE)
+--
+2.17.1
+