Bug 86655 - Evdev doesn't map touch coordinates properly to secondary X screens
Summary: Evdev doesn't map touch coordinates properly to secondary X screens
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: 7.7 (2012.06)
Hardware: Other Linux (All)
: medium major
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-24 07:36 UTC by Yaroslav
Modified: 2017-02-03 03:54 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
conf file used for reproduction (5.01 KB, text/plain)
2014-11-26 10:10 UTC, Yaroslav
no flags Details

Description Yaroslav 2014-11-24 07:36:58 UTC
On system with several X screens on same server, e.g. several GPU cards that doesn't support functions similar to TwinView or BaseMosaic of NVIDIA, evdev doesn't map coordinates of touch events properly.

Screen 0
 1st monitor 1920x1080 +0+0
 2nd monitor : 1920x1080 +0+1080
Screen 1
 3rd monitor: 1920x1080 +0+2160

All three are touchscreens, mapped with coordinate transformation matrices, like this:

Section "InputClass"
  Identifier "Touch1"
  MatchIsTouchscreen "on"
  MatchTag "ctouch-1"
  Option "TransformationMatrix" "1 0 0 0 0.3333 0 0 0 1"
  Driver "evdev"
 EndSection

Section "InputClass"
  Identifier "Touch2"
  MatchIsTouchscreen "on"
  MatchTag "ctouch-2"
  Option "TransformationMatrix" "1 0 0 0 0.3334 0.3333 0 0 1"
  Driver "evdev"
 EndSection

Section "InputClass"
  Identifier "Touch3"
  MatchIsTouchscreen "on"
  MatchTag "ctouch-3"
  Option "TransformationMatrix" "1 0 0 0 0.3333 0.6667 0 0 1"
  Driver "evdev"
 EndSection

Two upper touchscreen work as intended, if I touch third, cursor got placed on bottom edge of display. Same hardware, displays arranged in horizontal pattern from left to right, result in cursor clinging on rightmost edge. Relative coordinates pointer device (mouse) work with no err.
Comment 1 Yaroslav 2014-11-24 08:11:25 UTC
Not sure if that is essential or not, this is tested with multi-touch capable touchscreens handled by hid driver, proprietary video driver "nvidia" (but no SLI support from hardware). With SLI or BaseMoosaic available it works (if configured as one X screen). It doesn't work also with ATI - fglrx driver (also two Xscreens)
I'm  absolutely sure that it worked before properly on kernel 3.0 with non-multitouch, because I had same setup before and third touchscreen worked. Switching to 3.17 with xorg 7.7 was essential because of multitouch functionality requirement.
Comment 2 Peter Hutterer 2014-11-24 08:23:35 UTC
do you see the same effect when it's a 2-screen across two different cards? that's the most likely source of problems here.
Comment 3 Yaroslav 2014-11-24 17:10:53 UTC
Sorry, had power outage , so didn't saw answer until now.
May be I didn't understood question or wasn't clear enough. That's across two different cards, yes - there is no marketed NVIDIA cards that can support three screens.

If you mean to try with only two monitors, one of each attached to separate card, I'll check that - part of workstations I didn't touched yet have that setup, I'll check that tomorrow.  I was unable to create single X screen across map, as xinerama looks like not being supported  supported properly -  think, it's driver problem - cards stay as separate screens, but in other setup, with Quadra 2000D cards  and BaseMosaic enabled, there is only one X screen, hence both dual display and triple display setups work.
Comment 4 Peter Hutterer 2014-11-25 06:38:13 UTC
(In reply to Yaroslav from comment #3)
> If you mean to try with only two monitors, one of each attached to separate
> card, I'll check that

yep, that's what I meant.
Comment 5 Yaroslav 2014-11-26 10:10:40 UTC
Created attachment 110050 [details]
conf file used for reproduction

Tested with three and two separate screens. Attached config is one i used for tests with three, and modified it for two. For two display configuration, I had to comment out Device1 and ScreenWork1, and changed ScreenWork2's coords from {0, 2160} to {0, 1080} in Layout section. I used slightly different config for three displays before this, which allowed me to have only two X screen, by composing two displays into one in way similar to how nvidia-setting write that into file - via metamodes.

Aforementioned DeviceClass sections are in /usr/share/X11/xorg.conf.d section, tags used there are set by udev rule, for mapping permanent connection between usb slot  and device node. I can attach that rule's file if required
Comment 6 Peter Hutterer 2014-12-11 00:37:35 UTC
http://patchwork.freedesktop.org/patch/38724/
Comment 7 Yaroslav 2014-12-22 01:45:57 UTC
I'll try to test it as soon as I'll get build environment to build , had other project hanging on my tail. 
What package I should patch\recompile, xserver-xorg-core, right?
Comment 8 Peter Hutterer 2014-12-22 02:59:51 UTC
yeah, that sounds about alright
Comment 9 Peter Hutterer 2017-02-03 03:54:27 UTC
this was pushed 2 years ago, no complaints since, so closing

commit ee21be1324de1d6ef14e529fed7b75992e971beb
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Dec 11 10:32:45 2014 +1000

    dix: offset touch root coordinates by ScreenRec origins (#86655)


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.