From afa03c974b95026219aadc8440d44bf05c26757d Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Mon, 16 Jan 2017 13:52:26 -0600 Subject: weston: Touch events cause startup failure Pressing the touch panel continously during boot up caused weston to crash. The weston view was being accessed before it was fully initialized, so now we guard against this. Upstream-Status: Denied [Could not reproduce] Signed-off-by: Tom Hochstein Signed-off-by: Otavio Salvador --- ...68-xwld-System-can-not-boot-up-to-desktop.patch | 44 +++++++++++++++++++++ ...d-Fix-crash-when-run-with-no-input-device.patch | 45 ---------------------- ...d-Fix-crash-when-run-with-no-input-device.patch | 45 ++++++++++++++++++++++ recipes-graphics/wayland/weston_%.bbappend | 3 +- 4 files changed, 91 insertions(+), 46 deletions(-) create mode 100644 recipes-graphics/wayland/weston/0019-MGS-1668-xwld-System-can-not-boot-up-to-desktop.patch delete mode 100644 recipes-graphics/wayland/weston/0019-xwayland-Fix-crash-when-run-with-no-input-device.patch create mode 100644 recipes-graphics/wayland/weston/0020-xwayland-Fix-crash-when-run-with-no-input-device.patch (limited to 'recipes-graphics/wayland') diff --git a/recipes-graphics/wayland/weston/0019-MGS-1668-xwld-System-can-not-boot-up-to-desktop.patch b/recipes-graphics/wayland/weston/0019-MGS-1668-xwld-System-can-not-boot-up-to-desktop.patch new file mode 100644 index 000000000..09404caf8 --- /dev/null +++ b/recipes-graphics/wayland/weston/0019-MGS-1668-xwld-System-can-not-boot-up-to-desktop.patch @@ -0,0 +1,44 @@ +From d3bc23ef2031e2749362bb0b90e5d164ef5d5942 Mon Sep 17 00:00:00 2001 +From: Meng Mingming +Date: Mon, 9 Jan 2017 15:08:51 +0800 +Subject: [PATCH 4/6] MGS-1668: xwld: System can not boot up to desktop + +System can not boot up to desktop if press touch panel continuously during booting up. +The weston view was not initialed completely, so add a protection to the pointer. + +Upstream Status: Inappropriate [i.MX specific] + +Date: MAR 08, 2016 +Signed-off-by: Yong Gan +--- + src/compositor.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/src/compositor.c b/src/compositor.c +index b6ef7f3..9d9805d 100644 +--- a/src/compositor.c ++++ b/src/compositor.c +@@ -1470,12 +1470,14 @@ weston_view_from_global_fixed(struct weston_view *view, + { + float vxf, vyf; + +- weston_view_from_global_float(view, +- wl_fixed_to_double(x), +- wl_fixed_to_double(y), +- &vxf, &vyf); +- *vx = wl_fixed_from_double(vxf); +- *vy = wl_fixed_from_double(vyf); ++ if(view != NULL) { ++ weston_view_from_global_float(view, ++ wl_fixed_to_double(x), ++ wl_fixed_to_double(y), ++ &vxf, &vyf); ++ *vx = wl_fixed_from_double(vxf); ++ *vy = wl_fixed_from_double(vyf); ++ } + } + + WL_EXPORT void +-- +2.7.4 + diff --git a/recipes-graphics/wayland/weston/0019-xwayland-Fix-crash-when-run-with-no-input-device.patch b/recipes-graphics/wayland/weston/0019-xwayland-Fix-crash-when-run-with-no-input-device.patch deleted file mode 100644 index 1304cef22..000000000 --- a/recipes-graphics/wayland/weston/0019-xwayland-Fix-crash-when-run-with-no-input-device.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 60f8817f371123b9c36b3ff1120eec1e8f9e3d10 Mon Sep 17 00:00:00 2001 -From: Tom Hochstein -Date: Mon, 31 Oct 2016 19:21:58 -0500 -Subject: [PATCH weston] xwayland: Fix crash when run with no input device - -Starting an xterm with no input device led to a crash -because weston_wm_pick_seat() was returning garbage and -weston_wm_selection_init() was trying to use the garbage. - -Signed-off-by: Tom Hochstein ---- - xwayland/selection.c | 10 +++++++--- - xwayland/window-manager.c | 6 ++++-- - 2 files changed, 11 insertions(+), 5 deletions(-) - -Index: weston-1.11.0/xwayland/selection.c -=================================================================== ---- weston-1.11.0.orig/xwayland/selection.c 2016-05-19 16:36:04.000000000 -0500 -+++ weston-1.11.0/xwayland/selection.c 2016-11-01 14:32:48.000000000 -0500 -@@ -708,6 +708,8 @@ - wm->atom.clipboard, mask); - - seat = weston_wm_pick_seat(wm); -+ if (seat != NULL) -+ return; - wm->selection_listener.notify = weston_wm_set_selection; - wl_signal_add(&seat->selection_signal, &wm->selection_listener); - -Index: weston-1.11.0/xwayland/window-manager.c -=================================================================== ---- weston-1.11.0.orig/xwayland/window-manager.c 2016-05-19 16:36:04.000000000 -0500 -+++ weston-1.11.0/xwayland/window-manager.c 2016-11-01 11:47:14.549606964 -0500 -@@ -1303,8 +1303,10 @@ - struct weston_seat * - weston_wm_pick_seat(struct weston_wm *wm) - { -- return container_of(wm->server->compositor->seat_list.next, -- struct weston_seat, link); -+ struct wl_list *seats = wm->server->compositor->seat_list.next; -+ if (wl_list_empty(seats)) -+ return NULL; -+ return container_of(seats, struct weston_seat, link); - } - - static struct weston_seat * diff --git a/recipes-graphics/wayland/weston/0020-xwayland-Fix-crash-when-run-with-no-input-device.patch b/recipes-graphics/wayland/weston/0020-xwayland-Fix-crash-when-run-with-no-input-device.patch new file mode 100644 index 000000000..1304cef22 --- /dev/null +++ b/recipes-graphics/wayland/weston/0020-xwayland-Fix-crash-when-run-with-no-input-device.patch @@ -0,0 +1,45 @@ +From 60f8817f371123b9c36b3ff1120eec1e8f9e3d10 Mon Sep 17 00:00:00 2001 +From: Tom Hochstein +Date: Mon, 31 Oct 2016 19:21:58 -0500 +Subject: [PATCH weston] xwayland: Fix crash when run with no input device + +Starting an xterm with no input device led to a crash +because weston_wm_pick_seat() was returning garbage and +weston_wm_selection_init() was trying to use the garbage. + +Signed-off-by: Tom Hochstein +--- + xwayland/selection.c | 10 +++++++--- + xwayland/window-manager.c | 6 ++++-- + 2 files changed, 11 insertions(+), 5 deletions(-) + +Index: weston-1.11.0/xwayland/selection.c +=================================================================== +--- weston-1.11.0.orig/xwayland/selection.c 2016-05-19 16:36:04.000000000 -0500 ++++ weston-1.11.0/xwayland/selection.c 2016-11-01 14:32:48.000000000 -0500 +@@ -708,6 +708,8 @@ + wm->atom.clipboard, mask); + + seat = weston_wm_pick_seat(wm); ++ if (seat != NULL) ++ return; + wm->selection_listener.notify = weston_wm_set_selection; + wl_signal_add(&seat->selection_signal, &wm->selection_listener); + +Index: weston-1.11.0/xwayland/window-manager.c +=================================================================== +--- weston-1.11.0.orig/xwayland/window-manager.c 2016-05-19 16:36:04.000000000 -0500 ++++ weston-1.11.0/xwayland/window-manager.c 2016-11-01 11:47:14.549606964 -0500 +@@ -1303,8 +1303,10 @@ + struct weston_seat * + weston_wm_pick_seat(struct weston_wm *wm) + { +- return container_of(wm->server->compositor->seat_list.next, +- struct weston_seat, link); ++ struct wl_list *seats = wm->server->compositor->seat_list.next; ++ if (wl_list_empty(seats)) ++ return NULL; ++ return container_of(seats, struct weston_seat, link); + } + + static struct weston_seat * diff --git a/recipes-graphics/wayland/weston_%.bbappend b/recipes-graphics/wayland/weston_%.bbappend index dfd7da449..26b12dcdd 100644 --- a/recipes-graphics/wayland/weston_%.bbappend +++ b/recipes-graphics/wayland/weston_%.bbappend @@ -17,10 +17,11 @@ SRC_URI_append_imxgpu3d = " \ file://0016-Link-compositor-to-egl.patch \ file://0017-MGS-2343-ccc-XWLD-T3DStressTest_Wayland-displays-abn.patch \ file://0018-MGS-2397-ccc-Enable-double-buffer-with-fb_pan_displa.patch \ + file://0019-MGS-1668-xwld-System-can-not-boot-up-to-desktop.patch \ " SRC_URI_append = " \ - file://0019-xwayland-Fix-crash-when-run-with-no-input-device.patch \ + file://0020-xwayland-Fix-crash-when-run-with-no-input-device.patch \ " # The 'egl' configuration of weston requires gles support, and consideration -- cgit v1.2.3-54-g00ecf