Skip to content

Commit 982bfa0

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 df6164f commit 982bfa0

File tree

2 files changed

+75
-9
lines changed

2 files changed

+75
-9
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
--- a/libweston/backend-drm/drm-internal.h
21+
+++ b/libweston/backend-drm/drm-internal.h
22+
@@ -296,7 +296,7 @@ struct drm_fb {
23+
int width, height;
24+
int fd;
25+
26+
- uint32_t plane_mask;
27+
+ uint64_t plane_mask;
28+
29+
/* Used by gbm fbs */
30+
struct gbm_bo *bo;
31+
--- a/libweston/backend-drm/state-propose.c
32+
+++ b/libweston/backend-drm/state-propose.c
33+
@@ -412,7 +412,7 @@ drm_output_find_plane_for_view(struct dr
34+
current_lowest_zpos_overlay;
35+
36+
bool view_matches_entire_output, scanout_has_view_assigned;
37+
- uint32_t possible_plane_mask = 0;
38+
+ uint64_t possible_plane_mask = 0;
39+
40+
pnode->try_view_on_plane_failure_reasons = FAILURE_REASONS_NONE;
41+
42+
@@ -461,7 +461,7 @@ drm_output_find_plane_for_view(struct dr
43+
return NULL;
44+
}
45+
46+
- possible_plane_mask = (1 << output->cursor_plane->plane_idx);
47+
+ possible_plane_mask = (1UL << output->cursor_plane->plane_idx);
48+
} else {
49+
if (mode == DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY) {
50+
drm_debug(b, "\t\t\t\t[view] not assigning view %p "
51+
@@ -474,7 +474,7 @@ drm_output_find_plane_for_view(struct dr
52+
continue;
53+
54+
if (drm_paint_node_transform_supported(pnode, plane))
55+
- possible_plane_mask |= 1 << plane->plane_idx;
56+
+ possible_plane_mask |= 1UL << plane->plane_idx;
57+
}
58+
59+
if (!possible_plane_mask) {
60+
@@ -508,10 +508,10 @@ drm_output_find_plane_for_view(struct dr
61+
if (possible_plane_mask == 0)
62+
break;
63+
64+
- if (!(possible_plane_mask & (1 << plane->plane_idx)))
65+
+ if (!(possible_plane_mask & (1UL << plane->plane_idx)))
66+
continue;
67+
68+
- possible_plane_mask &= ~(1 << plane->plane_idx);
69+
+ possible_plane_mask &= ~(1UL << plane->plane_idx);
70+
mm_has_underlay =
71+
drm_mixed_mode_check_underlay(mode, scanout_state, plane->zpos_max);
72+
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)