[ANNOUNCE] xf86-input-evdev 2.0.99.2

Peter Hutterer peter.hutterer at who-t.net
Fri Oct 24 03:02:15 PDT 2008


On Fri, Oct 24, 2008 at 11:43:03AM +0200, Søren Hauberg wrote:
> 
> Yeah, I can understand that. As I think I've made quite clear in
> previous posts: I'm stupid. That is, I don't really know X. So, here's
> a stupid question [1]: the server scales from what ever the driver
> reports to some range. So, how does the server know the range of the
> input, and the range of the output?

xf86InitValuatorAxisStruct() provides the server with the range. If the range
is valid (i.e. min < max), then the server scales absolute coordinates from
the device into the min..max range.

However, you can only supply this range when you initialise the device. The
server does not support a change in range at runtime. To be more precise, the
protocol doesn't provide a method to inform clients about this change, hence
you're not allowed to touch it (the server doesn't care).

> The patch I suggested scaled the raw x-coordinate from the touch
> screen from [a_x, b_x] to [min_x, max_x], where a is the smallest
> value reportable by the touch screen, and b is the largest. min_x and
> max_x are the values available in pEvdev.
> 
> It seems to me that scaling is a linear transformation, so the two
> scalings (in the driver and in the server) should be reducable to one
> scaling, by combining the parameters of the two scalings. I'm not sure
> of this as I don't know which parameters are used in the server.

it can be combined, if you specify the correct min/max range in the config (or
you let it get picked up from the kernel). Then the driver doesn't need
scaling, the server does it.
For calibration, that doesn't work. Or to be more precise, it only works if
you restart the server with the calibrated values. Otherwise, you need a
separate (duplicate) scaling mechanism in the driver.

Cheers,
  Peter



More information about the xorg mailing list