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

Roger Quadros rogerquads at yahoo.com
Fri Feb 16 03:45:22 PST 2007

    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

#--------------------------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 @@
        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.

We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20070216/89e065b9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fbdev.c.patch
Type: text/x-patch
Size: 354 bytes
Desc: pat671413331
URL: <http://lists.x.org/archives/xorg/attachments/20070216/89e065b9/attachment.bin>

More information about the xorg mailing list