From fd35a3149e74ca108ddae0b707c2623d6b473406 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Thu, 1 Feb 2024 14:03:59 +0100 Subject: [PATCH] weston: include NXP patch to enable cursor without having to move the mouse This is an NXP change that reverts a mainline weston commit form v9.0.0, in which the mouse cursor only gets activated when there is mouse movement. This change was only being included in the weston v10.0.X i.MX forks. For platforms that don't use these weston forks (ccimx93 uses the v11.0.X fork and ccmp15 uses mainline weston), the mouse cursor doesn't load right away when booting the system, which causes apps that are automatically launched (such as the LVGL demo) to not register the mouse, rendering said apps unresponsive to it. Port NXP's change to all of the weston versions we currently use to avoid this problem. https://onedigi.atlassian.net/browse/DEL-8865 Signed-off-by: Gabriel Valcazar --- ...-libinput-device-Enable-Set-pointer-.patch | 90 +++++++++++++++++++ .../wayland/weston_10.0.2.bbappend | 1 + ...-libinput-device-Enable-Set-pointer-.patch | 90 +++++++++++++++++++ .../wayland/weston_11.0.3.imx.bbappend | 5 +- 4 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston/0006-Revert-libweston-libinput-device-Enable-Set-pointer-.patch create mode 100644 meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/0002-Revert-libweston-libinput-device-Enable-Set-pointer-.patch diff --git a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston/0006-Revert-libweston-libinput-device-Enable-Set-pointer-.patch b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston/0006-Revert-libweston-libinput-device-Enable-Set-pointer-.patch new file mode 100644 index 000000000..805c8243e --- /dev/null +++ b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston/0006-Revert-libweston-libinput-device-Enable-Set-pointer-.patch @@ -0,0 +1,90 @@ +From: Haihua Hu +Date: Wed, 3 Aug 2022 16:34:47 +0800 +Subject: [PATCH] Revert "libweston/libinput-device: Enable/Set pointer + capabilities only on pointer movement" + +This reverts commit e825fe389ebd63470028abd828019840c1170a03. + +This commit will cause waylandsink cannot register pointer seat. +As a result, mouse cannot move waylandsink window + +(cherry picked from commit 3f8f336b5d2cf7ea7aa4e047d669d093fc46dfe6) +--- + libweston/libinput-device.c | 29 +++++------------------------ + 1 file changed, 5 insertions(+), 24 deletions(-) + +diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c +index 4ea89de0..2d7a7d5f 100644 +--- a/libweston/libinput-device.c ++++ b/libweston/libinput-device.c +@@ -60,21 +60,6 @@ evdev_led_update(struct evdev_device *device, enum weston_led weston_leds) + libinput_device_led_update(device->device, leds); + } + +-static void +-ensure_pointer_capability(struct libinput_device *libinput_device) +-{ +- struct evdev_device *device = libinput_device_get_user_data(libinput_device); +- struct weston_seat *seat = device->seat; +- +- if (!libinput_device_has_capability(libinput_device, LIBINPUT_DEVICE_CAP_POINTER)) +- return; +- +- if (!(device->seat_caps & EVDEV_SEAT_POINTER)) { +- weston_seat_init_pointer(seat); +- device->seat_caps |= EVDEV_SEAT_POINTER; +- } +-} +- + static void + handle_keyboard_key(struct libinput_device *libinput_device, + struct libinput_event_keyboard *keyboard_event) +@@ -112,8 +97,6 @@ handle_pointer_motion(struct libinput_device *libinput_device, + struct timespec time; + double dx_unaccel, dy_unaccel; + +- ensure_pointer_capability(libinput_device); +- + timespec_from_usec(&time, + libinput_event_pointer_get_time_usec(pointer_event)); + dx_unaccel = libinput_event_pointer_get_dx_unaccelerated(pointer_event); +@@ -146,8 +129,6 @@ handle_pointer_motion_absolute( + double x, y; + uint32_t width, height; + +- ensure_pointer_capability(libinput_device); +- + if (!output) + return false; + +@@ -179,8 +160,6 @@ handle_pointer_button(struct libinput_device *libinput_device, + libinput_event_pointer_get_seat_button_count(pointer_event); + struct timespec time; + +- ensure_pointer_capability(libinput_device); +- + /* Ignore button events that are not seat wide state changes. */ + if ((button_state == LIBINPUT_BUTTON_STATE_PRESSED && + seat_button_count != 1) || +@@ -260,8 +239,6 @@ handle_pointer_axis(struct libinput_device *libinput_device, + bool has_vert, has_horiz; + struct timespec time; + +- ensure_pointer_capability(libinput_device); +- + has_vert = libinput_event_pointer_has_axis(pointer_event, + LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); + has_horiz = libinput_event_pointer_has_axis(pointer_event, +@@ -738,7 +715,11 @@ evdev_device_create(struct libinput_device *libinput_device, + + device->seat_caps |= EVDEV_SEAT_KEYBOARD; + } +- ++ if (libinput_device_has_capability(libinput_device, ++ LIBINPUT_DEVICE_CAP_POINTER)) { ++ weston_seat_init_pointer(seat); ++ device->seat_caps |= EVDEV_SEAT_POINTER; ++ } + if (libinput_device_has_capability(libinput_device, + LIBINPUT_DEVICE_CAP_TOUCH)) { + if (weston_seat_init_touch(seat) < 0) { diff --git a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston_10.0.2.bbappend b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston_10.0.2.bbappend index 9de6ca79c..316c894ca 100644 --- a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston_10.0.2.bbappend +++ b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston_10.0.2.bbappend @@ -5,6 +5,7 @@ SRC_URI:append:stm32mpcommon = " \ file://0002-Force-to-close-all-output.patch \ file://0004-Disable-request-to-EGL_DRM_RENDER_NODE_FILE_EXT.patch \ file://0005-clients-simple-egl-call-eglSwapInterval-after-eglMak.patch \ + file://0006-Revert-libweston-libinput-device-Enable-Set-pointer-.patch \ " SIMPLECLIENTS="egl,touch,dmabuf-v4l,dmabuf-egl" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/0002-Revert-libweston-libinput-device-Enable-Set-pointer-.patch b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/0002-Revert-libweston-libinput-device-Enable-Set-pointer-.patch new file mode 100644 index 000000000..805c8243e --- /dev/null +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston-11.0.3.imx/0002-Revert-libweston-libinput-device-Enable-Set-pointer-.patch @@ -0,0 +1,90 @@ +From: Haihua Hu +Date: Wed, 3 Aug 2022 16:34:47 +0800 +Subject: [PATCH] Revert "libweston/libinput-device: Enable/Set pointer + capabilities only on pointer movement" + +This reverts commit e825fe389ebd63470028abd828019840c1170a03. + +This commit will cause waylandsink cannot register pointer seat. +As a result, mouse cannot move waylandsink window + +(cherry picked from commit 3f8f336b5d2cf7ea7aa4e047d669d093fc46dfe6) +--- + libweston/libinput-device.c | 29 +++++------------------------ + 1 file changed, 5 insertions(+), 24 deletions(-) + +diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c +index 4ea89de0..2d7a7d5f 100644 +--- a/libweston/libinput-device.c ++++ b/libweston/libinput-device.c +@@ -60,21 +60,6 @@ evdev_led_update(struct evdev_device *device, enum weston_led weston_leds) + libinput_device_led_update(device->device, leds); + } + +-static void +-ensure_pointer_capability(struct libinput_device *libinput_device) +-{ +- struct evdev_device *device = libinput_device_get_user_data(libinput_device); +- struct weston_seat *seat = device->seat; +- +- if (!libinput_device_has_capability(libinput_device, LIBINPUT_DEVICE_CAP_POINTER)) +- return; +- +- if (!(device->seat_caps & EVDEV_SEAT_POINTER)) { +- weston_seat_init_pointer(seat); +- device->seat_caps |= EVDEV_SEAT_POINTER; +- } +-} +- + static void + handle_keyboard_key(struct libinput_device *libinput_device, + struct libinput_event_keyboard *keyboard_event) +@@ -112,8 +97,6 @@ handle_pointer_motion(struct libinput_device *libinput_device, + struct timespec time; + double dx_unaccel, dy_unaccel; + +- ensure_pointer_capability(libinput_device); +- + timespec_from_usec(&time, + libinput_event_pointer_get_time_usec(pointer_event)); + dx_unaccel = libinput_event_pointer_get_dx_unaccelerated(pointer_event); +@@ -146,8 +129,6 @@ handle_pointer_motion_absolute( + double x, y; + uint32_t width, height; + +- ensure_pointer_capability(libinput_device); +- + if (!output) + return false; + +@@ -179,8 +160,6 @@ handle_pointer_button(struct libinput_device *libinput_device, + libinput_event_pointer_get_seat_button_count(pointer_event); + struct timespec time; + +- ensure_pointer_capability(libinput_device); +- + /* Ignore button events that are not seat wide state changes. */ + if ((button_state == LIBINPUT_BUTTON_STATE_PRESSED && + seat_button_count != 1) || +@@ -260,8 +239,6 @@ handle_pointer_axis(struct libinput_device *libinput_device, + bool has_vert, has_horiz; + struct timespec time; + +- ensure_pointer_capability(libinput_device); +- + has_vert = libinput_event_pointer_has_axis(pointer_event, + LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); + has_horiz = libinput_event_pointer_has_axis(pointer_event, +@@ -738,7 +715,11 @@ evdev_device_create(struct libinput_device *libinput_device, + + device->seat_caps |= EVDEV_SEAT_KEYBOARD; + } +- ++ if (libinput_device_has_capability(libinput_device, ++ LIBINPUT_DEVICE_CAP_POINTER)) { ++ weston_seat_init_pointer(seat); ++ device->seat_caps |= EVDEV_SEAT_POINTER; ++ } + if (libinput_device_has_capability(libinput_device, + LIBINPUT_DEVICE_CAP_TOUCH)) { + if (weston_seat_init_touch(seat) < 0) { diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_11.0.3.imx.bbappend b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_11.0.3.imx.bbappend index 58dbf02b5..15b715f66 100644 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_11.0.3.imx.bbappend +++ b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/wayland/weston_11.0.3.imx.bbappend @@ -1,5 +1,8 @@ # Copyright (C) 2024 Digi International Inc. -SRC_URI += "file://0001-Restore-wl_shell-to-weston-11.patch" +SRC_URI += " \ + file://0001-Restore-wl_shell-to-weston-11.patch \ + file://0002-Revert-libweston-libinput-device-Enable-Set-pointer-.patch \ +" EXTRA_OEMESON += "-Ddeprecated-wl-shell=true"