summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangyeon Lee <cyeon.lee@samsung.com>2023-10-16 12:39:53 +0900
committerChangyeon Lee <cyeon.lee@samsung.com>2023-10-16 12:41:12 +0900
commit979426e151b8860b0a66b1b54f3d768744c23714 (patch)
tree448bd452663e64ee1183a8ea7262b0eb6418d529
parenta335264a4278c1b9c9ed5e11ac9241674759f60e (diff)
downloadlibtdm-vc4-979426e151b8860b0a66b1b54f3d768744c23714.tar.gz
libtdm-vc4-979426e151b8860b0a66b1b54f3d768744c23714.tar.bz2
libtdm-vc4-979426e151b8860b0a66b1b54f3d768744c23714.zip
hwc: adjust cursor width/height of src/dst pos when x/y of dst pos is negative
this patch supports cursor x/y of dest pos is negative. Change-Id: I1c7987d47e2361ff9f17171d0c4f08d742972289
-rw-r--r--src/tdm_vc4_hwc.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/tdm_vc4_hwc.c b/src/tdm_vc4_hwc.c
index 1e6b6ec..5263121 100644
--- a/src/tdm_vc4_hwc.c
+++ b/src/tdm_vc4_hwc.c
@@ -280,14 +280,20 @@ _vc4_hwc_cursor_adjust_pos(tdm_vc4_hwc *hwc_data, tdm_vc4_hwc_window *hwc_window
hwc_window_data->info.dst_pos.w = width;
hwc_window_data->info.dst_pos.h = height;
- /* dst pos of cursor is possible set by negative value
- * this is temporary code.
- */
x = hwc_window_data->info.dst_pos.x;
y = hwc_window_data->info.dst_pos.y;
- if (x < 0) hwc_window_data->info.dst_pos.x = 0;
- if (y < 0) hwc_window_data->info.dst_pos.y = 0;
+ if (x < 0) {
+ hwc_window_data->info.src_config.pos.w += x;
+ hwc_window_data->info.dst_pos.x = 0;
+ hwc_window_data->info.dst_pos.w += x;
+ }
+
+ if (y < 0) {
+ hwc_window_data->info.src_config.pos.h += y;
+ hwc_window_data->info.dst_pos.y = 0;
+ hwc_window_data->info.dst_pos.h += y;
+ }
}
static int