[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-17 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

Peter Hutterer  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #12 from Peter Hutterer  ---
commit 6adb336829951d8d3acd5498d53ef1d505db3373
Author: Peter Hutterer <>
Date:   Wed May 16 09:40:50 2018 +1000

 touchpad: remember the suspend reason


https://wayland.freedesktop.org/libinput/doc/latest/reporting_bugs.html#fixed_bugs

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #11 from Peter Hutterer  ---
ftr, libinput debug-events and all other libinput tools don't modify the
existing context. so their output is the only information, regardless what the
system pointer does. libinput debug-gui would've been better here because it
does show the pointer movement as well (instead of just printing it).

but if the installed version works, that's fine with me ;) thanks for testing!

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #10 from Zachary Smith  ---
After seeing that you had clear instructions for "Reverting to the
system-provided libinput package" here:
https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html,
curiosity got the best of me I just went ahead and installed the build from
your branch. 

After rebooting, it appears that the touchpad is disabled in tablet mode! 

Let me know if there is anything else I can do to help debug or test these
patches for you.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-16 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #9 from Zachary Smith  ---
I cloned your repo, checked out your wip/touchpad-multiple-suspend-handler
branch, and compiled successfully.

Next, I ran builddir/libinput-debug-events, opened the lid to initiate tablet
mode, and moved my finger across the touchpad - unfortunately, the pointer
still moved and clicks were registered. My first question is, do I need to take
some other steps to test the ultimate functionality (install the compiled
binaries, for example)?

Here are a few things I tried next to capture some information for you.

I changed #if 0 to 1 in evdev.c, rebuilt, and ran in gdb with breakpoints in
tp_suspend, tp_resume, tp_tablet_mode_switch_event, and evdev_device_suspend. I
set args to --verbose and stepped through the touchpad suspend and resume flow.
It appears that the device fd is being set to -1 in suspend and back to its
original value (23) in resume. There does not appear to be a resume request
fired (ie, tp_resume is not called via a notify event from the keyboard for
example). This all seems good and as far as I can tell the trigger check
portion of the code you added appears to be working.

However, the touchpad pointer moves and clicks have an effect on the system in
tablet mode. What may be interesting is that there are no messages from
evdev_print_event displayed for the touchpad events until tablet mode is ended
at which point I see them displayed again.

Let me know if I can provide anything else.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #8 from Peter Hutterer  ---
Patches are here:

https://lists.freedesktop.org/archives/wayland-devel/2018-May/038185.html
https://lists.freedesktop.org/archives/wayland-devel/2018-May/038184.html

Git branch for testing:

https://github.com/whot/libinput/tree/wip/touchpad-multiple-suspend-handler

Please let me know if that works, thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

Peter Hutterer  changed:

   What|Removed |Added

 Status|NEEDINFO|ASSIGNED

--- Comment #7 from Peter Hutterer  ---
oh, thanks. that helps and it's a relatively simple problem: we only remember
that we're suspended but not *why*. So at the next opportunity we resume,
regardless of the original reason. This worked when it was only
disable-while-typing (dwt) but now that we have a few different suspend
conditions it breaks. We need some state/bitmask/whatever to remember why we
suspended and then only resume when that reason clears.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #6 from Zachary Smith  ---
Thanks for the helpful comments, Peter.

I added a breakpoint to evdev_notify_suspended_device and stepped through all
of the devices coming through. When the touchpad ("Synaptics TM3293-011") comes
through, I watched it go all the way through and it does successfully hit the
'continue' in the list_for_each block so is not sending a dispatch to itself.
It continues to be suspended and has its fd set to -1. All seems good there.

A little while later, the keyboard ("AT Translated Set 2 keyboard") comes
through evdev_notify_suspend_device and loops over the devices_list. 

When it comes to the touchpad, if (d->dispatch->interface->device_suspended)
evaluates true and d->dispatch->interface->device_suspended(d, device) is
called (with 'd' == touchpad and device = keyboard) triggering
tp_interface_device_removed which ultimately calls tp_resume_conditional which
then re-enables the touchpad that was previously disabled. 

I confirmed that the touchpad fd was -1 when entering tp_resume_conditional and
23 (which was what it was prior to suspending) upon exit.


Here is the stack:
#0  0x77bab526 in tp_resume_conditional (tp=
0x6518f0, device=0x668380, excluded_device=0x65c000)
at ../src/evdev-mt-touchpad.c:1955
#1  0x77bac15f in tp_interface_device_removed (device=0x668380,
removed_device=0x65c000) at ../src/evdev-mt-touchpad.c:2344
#2  0x77b9ffc7 in evdev_notify_suspended_device (device=0x65c000)
at ../src/evdev.c:2506
#3  0x77ba00f9 in evdev_device_suspend (device=0x65c000) at
../src/evdev.c:2537
#4  0x77ba4a8c in fallback_suspend (dispatch=0x66f730, device=0x65c000)
at ../src/evdev-fallback.c:1149
#5  0x77ba4b4b in fallback_tablet_mode_switch_event (time=2988977338,
event=
0x68bda0, data=0x66f730) at ../src/evdev-fallback.c:1175
#6  0x77b96f75 in post_device_event (device=0x65a560, time=2988977338,
type=
LIBINPUT_EVENT_SWITCH_TOGGLE, event=0x68bda0) at ../src/libinput.c:2117
#7  0x77b98349 in switch_notify_toggle (device=0x65a560,
time=2988977338, sw=
LIBINPUT_SWITCH_TABLET_MODE, state=LIBINPUT_SWITCH_STATE_ON) at
../src/libinput.c:2740
#8  0x77ba3d1b in fallback_process_switch (dispatch=
0x667120, device=0x65a560, e=0x7fffe790, time=2988977338)
at ../src/evdev-fallback.c:705
#9  0x77ba437b in fallback_interface_process (evdev_dispatch=
0x667120, device=0x65a560, event=0x7fffe790, time=2988977338)
at ../src/evdev-fallback.c:902
#10 0x77b9c8ae in evdev_process_event (device=0x65a560,
e=0x7fffe790)
at ../src/evdev.c:863
#11 0x77b9c8e4 in evdev_device_dispatch_one (device=0x65a560,
ev=0x7fffe790)
at ../src/evdev.c:871
#12 0x77b9ca83 in evdev_device_dispatch (data=0x65a560) at
../src/evdev.c:930
#13 0x77b96c14 in libinput_dispatch (libinput=0x619760) at
../src/libinput.c:2000
#14 0x00407229 in handle_and_print_events (li=0x619760)
at ../tools/libinput-debug-events.c:773
#15 0x004076a2 in mainloop (li=0x619760) at
../tools/libinput-debug-events.c:899
#16 0x004078aa in main (argc=2, argv=0x7fffeba8)
at ../tools/libinput-debug-events.c:998

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #5 from Peter Hutterer  ---
Strange, and unfortunately the test devices I have here don't seem to reproduce
this issue.

evdev_device_suspend() 
 - we expect that to be called with the device (if in doubt, print
   evdev_device->devname

evdev_notify_suspended_device()
 - this notifies other devices that a device has been suspended so they can 
   update their state (e.g. suspending a touchpad disables the disable-while-
   typing pairing with the keyboard)

tp_interface_device_removed()
 - this should not be called because it would imply that the device tries to 
   notify itself

So the next thing to check here is what the argument is to
evdev_notify_suspended_device() and whether it's the touchpad. If not, then we
probably have some memory corruption somewhere. If it is the touchpad, check
the list_for_each loop and why the 'continue' condition doesn't trigger. That's
likely the explanation.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #4 from Zachary Smith  ---
I haven't been able to chase this all the way down yet but here is my current
thought:

It appears that tp_resume_conditional is being called after
evdev_device_suspend

evdev_device_suspend
evdev_notify_suspended_device 
tp_interface_device_removed
tp_resume_conditional

Inside tp_resume_conditional, both if conditionals fail which results in
tp_resume being called which appears to resume the tp. 

My best guess is that one of those conditionals in tp_resume_conditional should
be true resulting in a return OR a new conditional may be needed?

I can get back to this more tonight (west coast USA time) so feel free to give
me some more breadcrumbs to follow.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #3 from Peter Hutterer  ---
Ah, goood to know, I'll forget about the other bug then :)

I guess the next step would be to search for the if 0 in evdev.c and make it an
if 1, this way you get the evdev events and printed (in --verbose mode). break
on evdev_device_resume() and evdev_device_dispatch() to figure out where the
events are coming from and why they're still coming in when the fd was closed.
Check the fd value on the device too.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

--- Comment #2 from Zachary Smith  ---
I was able to step through to where device->fd is step to -1 and confirmed in
gdb that 'print device->fd' is -1 after being set. 

So it appears that the logic is correct to get through disabling the fd in
evdev_device_suspend which is as expected.

I could use a bit more help on where to look next or what I should be on the
look out for. Any more suggestions?

As for https://bugs.freedesktop.org/show_bug.cgi?id=103749 it does not apply to
the Lenovo X1 Yoga (Gen 3) as there is no capacitive button on the bezel.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-13 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

Peter Hutterer  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO
 CC||peter.hutte...@who-t.net

--- Comment #1 from Peter Hutterer  ---
That is... strange. The code calls evdev_device_suspend() immediately and that
should close the fd on the device. I'll need you to debug this because I can't
see where this is going wrong. Simple enough if you're on the machine. Grep git
master and build it:

https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html
No need to install it, just build it locally, then run:

sudo gdb ./builddir/libinput-debug-events

put a breakpoint at  tp_switch_event() and trigger the tablet mode switch.
Single-step through to figure out where it's going wrong.




Speaking of Yoga, can you check bug 103749 and confirm whether this device
needs the keyboard exception too?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs


[Wayland-bugs] [Bug 106498] Lenovo X1 Yoga (Gen 3) touchpad not suspended in tablet mode

2018-05-12 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106498

Zachary Smith  changed:

   What|Removed |Added

Summary|X1 Yoga (Gen 3) touchpad|Lenovo X1 Yoga (Gen 3)
   |not suspended in tablet |touchpad not suspended in
   |mode|tablet mode

-- 
You are receiving this mail because:
You are the assignee for the bug.___
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs