[PATCH v2] evdev: use mtdev for multitouch devices

Tiago Vignatti tiago.vignatti at linux.intel.com
Mon Mar 19 14:04:30 PDT 2012


On 03/17/2012 09:30 AM, Daniel Stone wrote:
> Hi,
>
> On 16 March 2012 20:33, Tiago Vignatti<tiago.vignatti at intel.com>  wrote:
>> @@ -334,7 +337,11 @@ evdev_input_device_data(int fd, uint32_t mask, void *data)
>>         if (!ec->focus)
>>                 return 1;
>>
>> -       len = read(fd,&ev, sizeof ev);
>> +       if (device->mtdev)
>> +               len = mtdev_get(device->mtdev, fd, ev, NUM_EVENTS) *
>> +                     sizeof (struct input_event);
>> +       else
>> +               len = read(fd,&ev, sizeof ev);
>>         if (len<  0 || len % sizeof e[0] != 0) {
>>                 /* FIXME: call device_removed when errno is ENODEV. */;
>>                 return 1;
>
> Since you're using O_NONBLOCK, you'll now need to handle -EAGAIN and
> -EWOULDBLOCK from read().  The rest looks good to me though.

do you think we need some special treatment for EAGAIN? We're already 
returning the function for this case, which seems enough on the 
practical side.

    Tiago


More information about the wayland-devel mailing list