[PATCH libinput 1/2] evdev: Safe x and y resolution for later use

Peter Hutterer peter.hutterer at who-t.net
Thu Jun 19 01:39:14 PDT 2014


On Thu, Jun 19, 2014 at 09:32:37AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 06/19/2014 02:17 AM, Peter Hutterer wrote:
> > On Wed, Jun 18, 2014 at 02:22:23PM +0200, Hans de Goede wrote:
> >> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> >> ---
> >>  src/evdev.c | 2 ++
> >>  src/evdev.h | 2 +-
> >>  2 files changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/src/evdev.c b/src/evdev.c
> >> index 51ad5e3..b72e5e1 100644
> >> --- a/src/evdev.c
> >> +++ b/src/evdev.c
> >> @@ -608,11 +608,13 @@ evdev_configure_device(struct evdev_device *device)
> >>  		if ((absinfo = libevdev_get_abs_info(evdev, ABS_X))) {
> >>  			device->abs.min_x = absinfo->minimum;
> >>  			device->abs.max_x = absinfo->maximum;
> >> +			device->abs.res_x = absinfo->resolution;
> >>  			has_abs = 1;
> >>  		}
> >>  		if ((absinfo = libevdev_get_abs_info(evdev, ABS_Y))) {
> >>  			device->abs.min_y = absinfo->minimum;
> >>  			device->abs.max_y = absinfo->maximum;
> >> +			device->abs.res_y = absinfo->resolution;
> > 
> > This came up in the tablet branch when testing: the resolution of a device
> > _may_ be 0. I don't know how many devices with ABS_X/Y still have zero, but
> > especially when testing with uinput devices it always is. uinput currently
> > doesn't let you set the resolution, the kernel patch to fix this stalled a
> > while ago and needs someone motivated to pick it up again :)
> 
> I'm willing to pick that up, do you have a link to the old patch ?

"Input: uinput: add full absinfo support" by David Herrmann, Dec 17 2013.
I've pinged him already, waiting for whether he wants to finish it up. I'll
let you know off-list.

> > so I think it'd be safer to force the resolution to 1, prevents a couple of
> > mathematical surprises lateron.
> 
> Good point, but shouldn't we pick a saner default for these devices then 1 though,
> and if yes what would be a sane default ?

I think our basic problem here is that there is no sane default.  This is
really a kernel bug if it happens on a real device, and for uinput we'll fix
it eventually.

Cheers,
   Peter




More information about the wayland-devel mailing list