1From 1007d8479e84780e244a5d7ba0e0a0964e2ba900 Mon Sep 17 00:00:00 2001 2From: Jeffy Chen <jeffy.chen@rock-chips.com> 3Date: Tue, 13 Jul 2021 10:56:56 +0800 4Subject: [PATCH 50/95] Support sw-cursor config 5 6Tested with: 7[core] 8sw-cursor=true 9 10Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 11--- 12 compositor/main.c | 2 ++ 13 include/libweston/backend-drm.h | 2 ++ 14 libweston/backend-drm/drm.c | 2 ++ 15 3 files changed, 6 insertions(+) 16 17diff --git a/compositor/main.c b/compositor/main.c 18index 7a1cc20..d376594 100644 19--- a/compositor/main.c 20+++ b/compositor/main.c 21@@ -2955,6 +2955,8 @@ load_drm_backend(struct weston_compositor *c, 22 &config.pageflip_timeout, 0); 23 weston_config_section_get_bool(section, "pixman-shadow", 24 &config.use_pixman_shadow, true); 25+ weston_config_section_get_bool(section, "sw-cursor", 26+ &config.use_sw_cursor, false); 27 if (without_input) 28 c->require_input = !without_input; 29 30diff --git a/include/libweston/backend-drm.h b/include/libweston/backend-drm.h 31index 071125f..a9b6ebd 100644 32--- a/include/libweston/backend-drm.h 33+++ b/include/libweston/backend-drm.h 34@@ -239,6 +239,8 @@ struct weston_drm_backend_config { 35 36 /** Use shadow buffer if using Pixman-renderer. */ 37 bool use_pixman_shadow; 38+ 39+ bool use_sw_cursor; 40 }; 41 42 #ifdef __cplusplus 43diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c 44index 97e3382..805e428 100644 45--- a/libweston/backend-drm/drm.c 46+++ b/libweston/backend-drm/drm.c 47@@ -4426,6 +4426,8 @@ drm_backend_create(struct weston_compositor *compositor, 48 /* 'compute' faked zpos values in case HW doesn't expose any */ 49 drm_backend_create_faked_zpos(b); 50 51+ device->cursors_are_broken |= config->use_sw_cursor; 52+ 53 /* A this point we have some idea of whether or not we have a working 54 * cursor plane. */ 55 if (!device->cursors_are_broken) 56-- 572.20.1 58 59