new/yocto/meta-rockchip/recipes-graphics/wayland/weston_10.0.2/0047-Support-sw-cursor-config.patch
2025-05-10 21:58:58 +08:00

59 lines
1.8 KiB
Diff

From 77f9ebdfd31791471add2ec7228f4d47558d68cd Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Tue, 13 Jul 2021 10:56:56 +0800
Subject: [PATCH 47/79] Support sw-cursor config
Tested with:
[core]
sw-cursor=true
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
compositor/main.c | 2 ++
include/libweston/backend-drm.h | 2 ++
libweston/backend-drm/drm.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/compositor/main.c b/compositor/main.c
index 2010c02..33dd4e5 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -2685,6 +2685,8 @@ load_drm_backend(struct weston_compositor *c,
&config.pageflip_timeout, 0);
weston_config_section_get_bool(section, "pixman-shadow",
&config.use_pixman_shadow, true);
+ weston_config_section_get_bool(section, "sw-cursor",
+ &config.use_sw_cursor, false);
if (without_input)
c->require_input = !without_input;
diff --git a/include/libweston/backend-drm.h b/include/libweston/backend-drm.h
index af2da4a..cfbf69a 100644
--- a/include/libweston/backend-drm.h
+++ b/include/libweston/backend-drm.h
@@ -223,6 +223,8 @@ struct weston_drm_backend_config {
/** Use shadow buffer if using Pixman-renderer. */
bool use_pixman_shadow;
+
+ bool use_sw_cursor;
};
#ifdef __cplusplus
diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
index 884dcba..4979bf5 100644
--- a/libweston/backend-drm/drm.c
+++ b/libweston/backend-drm/drm.c
@@ -4284,6 +4284,8 @@ drm_backend_create(struct weston_compositor *compositor,
/* 'compute' faked zpos values in case HW doesn't expose any */
drm_backend_create_faked_zpos(b);
+ b->cursors_are_broken |= config->use_sw_cursor;
+
/* A this point we have some idea of whether or not we have a working
* cursor plane. */
if (!b->cursors_are_broken)
--
2.20.1