Hi,

For easier readability I don't refer to the patch but to the code with
this patch applied:

>       while((ret = ts_read(priv->ts, &samp, 1)) == 1) {

What does ts_read return when there's no more data available at the moment?
>From looking at the tslib source code it is not clear to me whether it is 0
or -1.

>               if(samp.pressure) {
>                       int tmp_x = samp.x;
> 
>                       switch(priv->rotate) {
>                       case TSLIB_ROTATE_CW:   samp.x = samp.y;
>                                               samp.y = priv->width - tmp_x;
>                                               break;
>                       case TSLIB_ROTATE_UD:   samp.x = priv->width - samp.x;
>                                               samp.y = priv->height - samp.y;
>                                               break;
>                       case TSLIB_ROTATE_CCW:  samp.x = priv->height - samp.y;
>                                               samp.y = tmp_x;
>                                               break;
>                       default:                break;
>                       }
> 
>                       priv->lastx = samp.x;
>                       priv->lasty = samp.y;
>                       x = samp.x;
>                       y = samp.y;
> 
>                       xf86XInputSetScreen(local, priv->screen_num,
>                                       samp.x,
>                                       samp.y);
> 
>                       xf86PostMotionEvent (local->dev, TRUE, 0, 2,
>                                       x, y);
> 
>               }
> 
>               if(!!priv->lastp != !!samp.pressure) {
>                       priv->lastp = samp.pressure;
> 
>                       xf86PostButtonEvent(local->dev, TRUE,
>                               1, !!samp.pressure, 0, 2,
>                               priv->lastx,
>                               priv->lasty);
>               }
>       }
> 
>       if (ret < 0) {
>               ErrorF("ts_read failed\n");

If it's -1 then message is issued whenever we leave this function. Test
for errno == -EAGAIN maybe?

Sascha


-- 
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to