Touch some edge points of the touchscreen the weston crash
Ruei, Eric
a0850410 at ti.com
Mon Jun 27 13:27:19 UTC 2016
On 6/23/2016 5:17 AM, zhaojinkun wrote:
> Hi,
>
> After calibrating , I can touch almost points correctly.But when I touch
> some edge points of the touchscreen the weston crash.
> The method of calibration is:
> 1.$libinput-list-devides
> Device: myts-ft5x0x
> Kernel: /dev/input/event0
> Group: 3
> Seat: seat0, default
> Capabilities: touch
> Tap-to-click: n/a
> Tap-and-drag: n/a
> Tap drag lock: n/a
> Left-handed: n/a
> Nat.scrolling: n/a
> Middle emulation: n/a
> Calibration: identity matrix
> Scroll methods: none
> Click methods: none
> Disable-w-typing: n/a
> Accel profiles: n/a
> Rotation: n/a
> 2.$weston-calibrator
> Calibration values: 1.286611 0.085774 -40.799133 -0.015215
> 1.211107 19.864624
> 3.Add the .rules file in /etc/udev/rules.d/
> $cat /etc/udev/rules.d/touch-calibration.rules
> ATTRS{name}=="myts-ft5x0x", ENV{WL_CALIBRATION}="1.286611
> 0.085774 -40.799133 -0.015215 1.211107 19.864624"
> 4.$/etc/init.d/udev restart
>
> Using the gdb to debug,I found that:
> #0 0x76d9e9c4 in __GI_raise (sig=5) at
> ../sysdeps/unix/sysv/linux/raise.c:55
> #1 <signal handler called>
> #2 weston_view_from_global_float (view=0x0, x=-nan(0x7f007c),
> y=9.18354962e-41, vx=0x7efff658, vy=0x7efff65c) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/compositor.c:1350
> #3 0x00012468 in weston_view_from_global_fixed
> (view=<optimized out>, x=<optimized out>, y=y at entry=211820,
> vx=0x7efff690, vx at entry=0x7efff688, vy=0x7efff694, vy at entry=0x7efff68c)
> at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/compositor.c:1379
> #4 0x00016e28 in default_grab_touch_down (grab=<optimized
> out>, time=671019, touch_id=0, x=<optimized out>, y=36292) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/input.c:248
> #5 0x00019988 in notify_touch (seat=<optimized out>,
> time=time at entry=671019, touch_id=touch_id at entry=0, x=-4092, y=36292,
> touch_type=touch_type at entry=0) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/input.c:1582
> #6 0x76c93ef0 in handle_touch_with_coords
> (libinput_device=libinput_device at entry=0x2b7628, touch_event=0x328f90,
> touch_type=touch_type at entry=0) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:250
> #7 0x76c94384 in handle_touch_down (touch_event=<optimized
> out>, device=0x2b7628) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:257
> #8 evdev_device_process_event (event=event at entry=0x328f90) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-device.c:320
> #9 0x76c93a6c in process_event (event=0x328f90) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:161
> #10 process_events (input=<optimized out>) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:171
> #11 0x76c93d14 in udev_input_dispatch (input=0x33b6c) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:182
> #12 libinput_source_dispatch (fd=<optimized out>,
> mask=<optimized out>, data=0x33b6c) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/libinput-seat.c:192
> #13 0x76fca2e8 in wl_event_loop_dispatch (loop=0x304f0,
> timeout=timeout at entry=-1) at
> /usr/src/debug/wayland/1.9.0-r0/wayland-1.9.0/src/event-loop.c:422
> #14 0x76fc8bb4 in wl_display_run
> (display=display at entry=0x30478) at
> /usr/src/debug/wayland/1.9.0-r0/wayland-1.9.0/src/wayland-server.c:1004
> #15 0x0000f9c0 in main (argc=1, argv=0x7efffdb4) at
> /usr/src/debug/weston/1.9.0-r0/weston-1.9.0/src/main.c:818
>
> So when weston_view_from_global_float() access the view which is null,
> the weston crash.
>
jinkun:
We observed the similar issue. Attached please find our local patch to
address this issue. It will be great if an official fix can be provided
in the future release.
Best regards,
Eric Ruei
> At last I found that after calling transform_absolute(device, &x, &y)
> which is in libinput's evdev.c,the variable x will change to
> negative.Then the weston will consider the view is Null.
> Is it the problem of weston-calibrator?
>
> ThankYou
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
-------------- next part --------------
From 9a7c0e7b6ae9700069756b33d2ea726e58b552ed Mon Sep 17 00:00:00 2001
From: Eric Ruei <e-ruei1 at ti.com>
Date: Wed, 16 Mar 2016 16:50:31 -0400
Subject: [PATCH 4/4] Weston1.9.0: Fix touch screen crash issue
Touch screen operation causes the weston to crash with segment fault sometimes.
The crash occurs when the coordinate (x,y) passed to the weston input module
is outside the view window, hence the weston compositor is not able to pick
up a display view and there is no code to detect this condition at function
notify_touch().
Signed-off-by: Eric Ruei <e-ruei1 at ti.com>
---
src/input.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/input.c b/src/input.c
index e230c83..fd8e53f 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1566,6 +1566,12 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
* until all touch points are up again. */
if (touch->num_tp == 1) {
ev = weston_compositor_pick_view(ec, x, y, &sx, &sy);
+ if (!ev)
+ {
+ weston_log("notify_touch: weston_compositor_pick_view(%d, %d) failed to find a view!\n",
+ wl_fixed_to_int(x), wl_fixed_to_int(y));
+ return;
+ }
weston_touch_set_focus(touch, ev);
} else if (!touch->focus) {
/* Unexpected condition: We have non-initial touch but
--
1.9.1
More information about the wayland-devel
mailing list