Bug 24636 - kdrive: touchscreen pointer problem in Xfbdev
Summary: kdrive: touchscreen pointer problem in Xfbdev
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xephyr (show other bugs)
Version: unspecified
Hardware: ARM Linux (All)
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard: 2011BRB_Reviewed
Keywords: patch
Depends on:
Blocks:
 
Reported: 2009-10-20 02:42 UTC by raffaele
Modified: 2011-10-05 09:33 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
patch against kinput.c to workaround the pointer release issue in Xfbdev (237 bytes, text/plain)
2009-10-20 02:42 UTC, raffaele
no flags Details

Description raffaele 2009-10-20 02:42:01 UTC
Created attachment 30583 [details]
patch against kinput.c to workaround the pointer release issue in Xfbdev

Pointer works fine until the pressure is released. At this point the pointer moves to some apparently random location near the bottom left part of the LCD screen.

Using xorg-server-1.5.3 configured with:
--disable-config-hal --disable-xnest --disable-xephyr --disable-xvfb  --disable-xorg --enable-kdrive --enable-xfbdev --disable-glx --disable-dri --disable-null-root-cursor --disable-builtin-fonts --disable-aiglx --enable-tslib

Xserver is started with:
/usr/bin/Xfbdev inet6 -kb -screen 480x272 -mouse tslib,,device=/dev/event1

The touchscreen is supported by in-kernel driver AD7846. ts_test and ts_calibrate utilities work without problem.

According to my analysis, the problem stems from the fact that GetPointerEvents is called with flags=0 instead of flags=POINTER_ABSOLUTE in case of ButtonRelease event, so pointer coordinates are interpreted as relative to last position and effectively doubled. 
flags is initialized inside KdEnqueuePointerEvent in the code that processes the MotionNotify event. The ButtonPress event is always associated with a MotionNotify event and both are processed in the same call to KdEnqueuePointerEvent so flags is set properly. The ButtonRelease instead is processed on its own, the MotionNotify code is not called and the flags is not initialized. At least, this is my observation on my hardware.

I have patched kinput.c to workaround the problem, but I do not understand really the root cause. Patch is attached.

Possibly related issue:
http://lists.freedesktop.org/archives/xorg/2008-September/038873.html
Comment 1 Jeremy Huddleston Sequoia 2011-10-03 19:41:02 UTC
Is this still an issue?  Peter would you mind taking a look?  It looks like 
it's proably an easy fix.
Comment 2 raffaele 2011-10-04 00:32:10 UTC
I don't know, since then we switched to a different solution which uses direct framebuffer access and does not have this problem.
Give me a couple of weeks to see if I can still reproduce using Xfbdev.
Comment 3 raffaele 2011-10-05 05:20:29 UTC
I cannot reproduce the issue with xorg-xserver-1.7.5.
I consider the bug fixed.
Comment 4 Jeremy Huddleston Sequoia 2011-10-05 09:33:36 UTC
Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.