Bug 17421

Summary: microtouch driver should have an option to invert y-axis.
Product: xorg Reporter: Robert Buchholz <rbu>
Component: Input/microtouchAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: enhancement    
Priority: medium CC: hacktick, jeremyhu
Version: unspecifiedKeywords: patch
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:
Attachments:
Description Flags
xorg.conf
none
xev.dump
none
Xorg.0.log
none
Nicer patch none

Description Robert Buchholz 2008-09-03 10:26:24 UTC
I have a Microtouch Touchscreen (Microtouch FS1012 Excalibur 19-550 r2.0) connected via Serial (ttyS1). Whenever I start X, the pointer is in the middle of the screen. Then when I press anywhere on the screen, the pointer jumps to the left upper corner (0,0) immediately.

I have calibrated the screen using touchcal, and the debug output of the driver (line 532 in  microtouch.c) prints the (x,y) coordinates to the log correctly.

System details:
i686-pc-linux-gnu gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)
Linux 2.6.24-gentoo-r8
xorg-server 1.4.2
xf86-input-microtouch 1.2.0
Comment 1 Robert Buchholz 2008-09-03 10:27:15 UTC
Created attachment 18655 [details]
xorg.conf
Comment 2 Robert Buchholz 2008-09-03 10:29:08 UTC
Created attachment 18656 [details]
xev.dump

The ouput of xev, when the pointer is dragged all over the screen
(notice the '-2,-2' coordinates)
Comment 3 Robert Buchholz 2008-09-03 10:31:26 UTC
Created attachment 18657 [details]
Xorg.0.log

The xorg.log of the same session as xev, notice the TouchScreen: ouput contains the correct coordinates.
Comment 4 Daniel Stone 2008-09-03 15:59:43 UTC
On Wed, Sep 03, 2008 at 10:26:25AM -0700, bugzilla-daemon@freedesktop.org wrote:
> I have a Microtouch Touchscreen (Microtouch FS1012 Excalibur 19-550 r2.0)
> connected via Serial (ttyS1). Whenever I start X, the pointer is in the middle
> of the screen. Then when I press anywhere on the screen, the pointer jumps to
> the left upper corner (0,0) immediately.
> 
> I have calibrated the screen using touchcal, and the debug output of the driver
> (line 532 in  microtouch.c) prints the (x,y) coordinates to the log correctly.

Does Option "ReportingMode" "raw" help?
Comment 5 Peter Hutterer 2008-10-22 00:01:19 UTC
ping?
Comment 6 Robert Buchholz 2008-10-24 02:58:41 UTC
[ sorry for the my lack of reply ]

Yes, "ReportingMode" "raw" helps, the calibration now leads to a situation where the movement of the pointer correlates to the movement of my finger on the touch screen.
However, the y axis is inverted. That is, if I tip the upper leftmost corner, the pointer jumps to the lower leftmost corner. Editing the sourcecode so it does a hardcoded inverting[*] helps, but having an option to do so would be preferable.

[*] In microtouch.c, add this line 489.

    461 static void
    462 ReadInput (LocalDevicePtr local)
...
    479                 y = WORD_ASSEMBLY (priv->packet[3], priv->packet[4]);
    480
    481                 if (priv->reporting_mode == TS_Scaled)
    482                 {
    483                         x = xf86ScaleAxis (x, 0, priv->screen_width, priv->min_x,
    484                                                            priv->max_x);
    485                         y = xf86ScaleAxis (y, 0, priv->screen_height, priv->min_y,
    486                                                            priv->max_y);
    487                 }
    488
    489                 y = 17000 - y;
    490
    491                 xf86XInputSetScreen (local, priv->screen_num, x, y);
Comment 7 Peter Hutterer 2008-12-18 03:05:42 UTC
Can you please provide a git-formatted patch we can apply to upstream?

Having 17000 hardcoded is a pretty bad way to go about it. Maybe you can
change that to read some MaxY value (or whatever the driver uses).
Comment 8 Peter Hutterer 2009-01-08 20:42:27 UTC
ping?
Comment 9 Robert Buchholz 2009-01-09 03:05:36 UTC
Peter, I can look into reading the value from a file. However, I cannot do this right now as the machine the montitor was on is due for some hardware changes.
Comment 10 Martin Kossick 2009-02-21 07:19:03 UTC
Created attachment 23155 [details] [review]
Nicer patch
Comment 11 Martin Kossick 2009-02-21 07:22:02 UTC
Hi, I can confirm this Bug.
I attached a better patch, which doesn't use the number 1700 :)

I tested it, it works fine with several systems under ubuntu 8.04 and 8.10

greetings

Martin
Comment 12 Jeremy Huddleston Sequoia 2011-10-17 01:02:58 UTC
Can you please send your patch to xorg-devel for review.  Please add your 
signoff (git commit -s) and send a git formatted patch (git format-patch HEAD^)
Comment 13 Adam Jackson 2018-06-12 19:06:54 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.

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.