[PATCH synaptics 2/2] The correct maximum values for pressure and finger width

Chris Bagwell chris at cnpbagwell.com
Thu Aug 25 20:12:31 PDT 2011


On Thu, Aug 25, 2011 at 5:22 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> On Thu, Aug 25, 2011 at 09:48:52PM +0600, Alexandr Shadchin wrote:
>> Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
>> ---
>>  src/synaptics.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/synaptics.c b/src/synaptics.c
>> index 3c08b18..6918330 100644
>> --- a/src/synaptics.c
>> +++ b/src/synaptics.c
>> @@ -246,7 +246,7 @@ SanitizeDimensions(InputInfoPtr pInfo)
>>      if (priv->minp >= priv->maxp)
>>      {
>>       priv->minp = 0;
>> -     priv->maxp = 256;
>> +     priv->maxp = 255;
>>
>>       xf86IDrvMsg(pInfo, X_PROBED,
>>                   "invalid pressure range.  defaulting to %d - %d\n",
>> @@ -256,7 +256,7 @@ SanitizeDimensions(InputInfoPtr pInfo)
>>      if (priv->minw >= priv->maxw)
>>      {
>>       priv->minw = 0;
>> -     priv->maxw = 16;
>> +     priv->maxw = 15;
>>
>>       xf86IDrvMsg(pInfo, X_PROBED,
>>                   "invalid finger width range.  defaulting to %d - %d\n",
>> --
>> 1.7.6
>
> refresh my memory: why maxw = 15? maxp I understand but I don't know where
> this limitation to 15/16 comes from.

A real synaptics pad will only return a max W of 15.  16 is total range.

Since last year, kernel is now reporting minw=0 and maxw=15 and minp=0
and maxp=255 and so xf86-input-synaptics is using these values with
new kernels anyways.  Should be pretty safe since I've not heard
negative reports.

I had made a similar patch last year but never submitted it because it
caused new default values for palm and 2FG emulation and I could only
test on 1 laptop.

Also, I think there is a bug in related code because range of W is 16
but the following computes 15.  With above patch, range becomes 14 and
at such small values its very noticeable in default values computed.
But as I mentioned, new kernels + xf86-input-synaptics are using these
values anyways and no complaints.

    range = priv->maxw - priv->minw + 1;

Chris


More information about the xorg-devel mailing list