hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From d1f18faf5fbe1de6bd468a1c8bbdc69573effbc3 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/74] 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 3824404..c89598b 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