Skip to content

Commit 5240b5c

Browse files
OldManYellsAtCloudkraj
authored andcommitted
weston: add patch to adapt to 64-bit plane ids
The raspberry pi kernel has changed the plane IDs in their drm driver[1], which causes weston to crash upon mouse movement. This patch adapts the relevant variable sizes from 32-bit to 64-bit. Since the kernel modification hasn't been upstreamed by rpi, this patch is deemed to be inappropriate for upstreaming to weston. Also, clean up this bbappend: the main recipe has switched to meson long time ago, the autotools config options are obsolete, so remove them. Beside that the "fbdev" PACKAGECONFIG doesn't exist anymore, so drop it from the removal list. [1]: raspberrypi/linux@8181e68 Signed-off-by: Gyorgy Sarvari <[email protected]>
1 parent 8767e2f commit 5240b5c

File tree

2 files changed

+79
-9
lines changed

2 files changed

+79
-9
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
From 845682f33511da676bfe9237102b6979efa11f93 Mon Sep 17 00:00:00 2001
2+
From: Gyorgy Sarvari <[email protected]>
3+
Date: Fri, 21 Nov 2025 18:07:00 +0100
4+
Subject: [PATCH] Adapt weston to 64-bit plane IDs
5+
6+
The raspberry pi kernel has changed the plane IDs in their drm
7+
driver[1], which causes weston to crash upon mouse movement.
8+
9+
This patch adapts the relevant variable sizes from 32-bit to
10+
64-bit.
11+
12+
[1]: https://github.com/raspberrypi/linux/commit/8181e682d6f4ef209845ec24f0a1eb37764d6731
13+
14+
Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1902]
15+
---
16+
libweston/backend-drm/drm-internal.h | 4 ++--
17+
libweston/backend-drm/state-propose.c | 10 +++++-----
18+
2 files changed, 7 insertions(+), 7 deletions(-)
19+
20+
diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h
21+
index 48bc2432..c4391b39 100644
22+
--- a/libweston/backend-drm/drm-internal.h
23+
+++ b/libweston/backend-drm/drm-internal.h
24+
@@ -410,7 +410,7 @@ struct drm_fb {
25+
int width, height;
26+
int fd;
27+
28+
- uint32_t plane_mask;
29+
+ uint64_t plane_mask;
30+
31+
/* Used by gbm fbs */
32+
struct gbm_bo *bo;
33+
diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c
34+
index 2b42e3dc..0793b8fe 100644
35+
--- a/libweston/backend-drm/state-propose.c
36+
+++ b/libweston/backend-drm/state-propose.c
37+
@@ -393,7 +393,7 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
38+
struct drm_fb *fb = NULL;
39+
40+
bool view_matches_entire_output, scanout_has_view_assigned;
41+
- uint32_t possible_plane_mask = 0;
42+
+ uint64_t possible_plane_mask = 0;
43+
44+
pnode->try_view_on_plane_failure_reasons = FAILURE_REASONS_NONE;
45+
46+
@@ -437,7 +437,7 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
47+
return NULL;
48+
}
49+
50+
- possible_plane_mask = (1 << output->cursor_plane->plane_idx);
51+
+ possible_plane_mask = (1UL << output->cursor_plane->plane_idx);
52+
} else {
53+
if (mode == DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY) {
54+
drm_debug(b, "\t\t\t\t[view] not assigning view %p "
55+
@@ -450,7 +450,7 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
56+
continue;
57+
58+
if (drm_paint_node_transform_supported(pnode, plane))
59+
- possible_plane_mask |= 1 << plane->plane_idx;
60+
+ possible_plane_mask |= 1UL << plane->plane_idx;
61+
}
62+
63+
if (!possible_plane_mask) {
64+
@@ -483,10 +483,10 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
65+
if (possible_plane_mask == 0)
66+
break;
67+
68+
- if (!(possible_plane_mask & (1 << plane->plane_idx)))
69+
+ if (!(possible_plane_mask & (1UL << plane->plane_idx)))
70+
continue;
71+
72+
- possible_plane_mask &= ~(1 << plane->plane_idx);
73+
+ possible_plane_mask &= ~(1UL << plane->plane_idx);
74+
75+
switch (plane->type) {
76+
case WDRM_PLANE_TYPE_CURSOR:
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
PACKAGECONFIG:remove:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', 'fbdev', 'egl clients', d)}"
1+
PACKAGECONFIG:remove:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'egl clients', d)}"
22

3-
EXTRA_OECONF:append:rpi = " \
4-
--disable-xwayland-test \
5-
--disable-simple-egl-clients \
6-
${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' \
7-
--disable-resize-optimization \
8-
--disable-setuid-install \
9-
', d)} \
10-
"
3+
FILESEXTRAPATHS:prepend := "${THISDIR}/weston:"
4+
SRC_URI:append:rpi = " file://0001-Adapt-weston-to-64-bit-plane-IDs.patch"

0 commit comments

Comments
 (0)