Kdrive fbdev bug + patch: incorrect touchscreen co-ords on rotation

Roger Quadros roger.quadros at aeoniq.com
Fri Feb 16 04:01:28 PST 2007


hi
    i am using kdrive fbdev server on an ARM based system with a 800x480 LCD
and touchscreen. The native resolution is 800x480 but i use it in portrait
mode (i.e. 480x800). I use tslib for the touchscreen interface.
   The bug surfaces when i run Xfbdev in the rotation mode (i.e. Xfbdev
-screen 800x480 at 90). In this mode the pointer is offset by 120 pixels with
respect to the touch point, along the new X axis.
   I have figured out and fixed the problem. The problem lies in fbdev.c
which passes incorrect parameters to the KdComputeMouseMatrix() routine.
Instead of sending 800x480 it sends 800x600, hence causing an offset of
(600-480) = 120 px.
   The changes i've made is as below. file to be patched is
    ./hw/kdrive/fbdev/fbdev.c

#--------------------patch file------------------------------

--- fbdev.c     2007-02-16 16:11:11.000000000 +0530
+++ fbdev.c     2007-02-16 16:37:26.000000000 +0530
@@ -331,7 +331,7 @@
     else
        scrpriv->shadow = FALSE;

-    KdComputeMouseMatrix (&m, scrpriv->randr, screen->width, screen->height);
+    KdComputeMouseMatrix (&m, scrpriv->randr, priv->var.xres, priv->var.yres);

     KdSetMouseMatrix (&m);

#--------------------------patch file end----------------------------

Kdrive is a great project. Thanks to Keith and his team.

regards,
Roger.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fbdev.c.patch
Type: text/x-patch
Size: 353 bytes
Desc: inline filename="fbdev.c.patch"
URL: <http://lists.x.org/archives/xorg/attachments/20070216/1b04058d/attachment.bin>


More information about the xorg mailing list