0

First of all hi, this is my first question in stackoverflow :)

The hardware setup is 2 x nvidia gtx980 GPUs each connected to 3 monitors. The videowall is arranged as one row of 6 monitors. We are using the propietary nvidia drivers. The xserver version is 1.15.1 (7.7).

We create a uinput multitouch ABS (MT) device attached to a different master than the core pointer. The max and min of ABS_X and ABS_MT_POSITION_X are set according to the size of both xscreens (0, 11520 - 1). This is checked using xinput list [device id].

As we are using two GPUs we are not able to create one large xscreen but we arrange 2 xscreens (one for each GPU) with three monitors aligned on each.

The problems lies on the second xscreen (xscreen1). When we emit touch events with x coordinate higher than 5760 (the size of the first xscreen) the points are reported by the xserver on a distant x coordinate (probably at the end of the second xscreen or farther away). We have checked this starting from xscreen0 and moving to the second. The y coordinate gets reported correctly (as both xscreens are y aligned).

The calibration matrix of the virtual multitouch device is the identity matrix. If the uinput device is created as an ABS single point device (like a wacom tablet i guess) the x coordinate is reported correctly.

I'm thinking the problem might lay in evdev or inside the xserver (as i have read the new versions calibrate inside the server not in evdev). If this is the case any hint as to where this may happen would be great. If this is not the case any help is highly appreciated.

lojkoro
  • 11
  • 2

1 Answers1

1

For anyone who may get this problem in the future, our team came up with a small patch a long time ago, here it goes in case it may be of use ...

---
dix/events.c | 21 +++++++++++++++++++--
mi/mieq.c    | 26 ++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index 8efdf18..5155ef5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2999,8 +2999,25 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev)
             /* Motion events entering DIX get translated to Screen 0
                coordinates.  Replayed events have already been
                translated since they've entered DIX before */
-            ev->root_x += pSprite->screen->x - screenInfo.screens[0]->x;
-            ev->root_y += pSprite->screen->y - screenInfo.screens[0]->y;
+
+                       /*Now we take into account inputs comming from MT device that uses absolutes coordinates.*/
+                       switch (ev->type) {
+                               case ET_Motion:
+                               case ET_KeyPress:
+                               case ET_KeyRelease:
+                               case ET_ButtonPress:
+                               case ET_ButtonRelease:
+                                       ev->root_x += pSprite->screen->x - screenInfo.screens[0]->x;
+                                       ev->root_y += pSprite->screen->y - screenInfo.screens[0]->y;
+                                       break;
+                               case ET_TouchBegin:
+                               case ET_TouchUpdate:
+                               case ET_TouchEnd:
+                                       ev->root_x -= screenInfo.screens[0]->x;
+                                       ev->root_y -= screenInfo.screens[0]->y;
+                                       break;
+
+                       }
         }
         else
 #endif
diff --git a/mi/mieq.c b/mi/mieq.c
index 05447d6..cc151f6 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -447,6 +447,32 @@ mieqMoveToNewScreen(DeviceIntPtr dev, ScreenPtr screen, DeviceEvent *event)
         DequeueScreen(dev) = screen;
         x = event->root_x;
         y = event->root_y;
+
+
+               /*Now we take into account inputs comming from MT device that uses absolutes coordinates.*/
+               switch (event->type) {
+                       case ET_Motion:
+                       case ET_KeyPress:
+                       case ET_KeyRelease:
+                       case ET_ButtonPress:
+                       case ET_ButtonRelease:
+                               // print
+                               break;
+                       case ET_TouchBegin:
+                       case ET_TouchUpdate:
+                       case ET_TouchEnd:
+                               {
+                               ScreenPtr screenPtr = dev->spriteInfo->sprite->pDequeueScreen;
+                               x -= screenPtr->x;
+                               y -= screenPtr->y;
+                               NewCurrentScreen(dev, screenPtr, x, y);
+                               return;
+                               // break;
+                               }
+                       default:
+                               break;
+               }
+
         NewCurrentScreen(dev, DequeueScreen(dev), x, y);
     }
 }
lojkoro
  • 11
  • 2