Linux Input/HID development
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Jonathan Clarke <jonathan.a.clarke@gmail.com>
Cc: linux-input@vger.kernel.org, "Stéphane Chatty" <chatty@enac.fr>,
	"Jiri Kosina" <jkosina@suse.cz>
Subject: Re: hid-multitouch: change for touch height/width
Date: Wed, 25 Jan 2017 11:39:50 +0100	[thread overview]
Message-ID: <20170125103950.GA13244@mail.corp.redhat.com> (raw)
In-Reply-To: <CAFW_ifxfBoN=gVQQiE+9-bLTtDFGjP-HMvWxXTVztOgma+JdqQ@mail.gmail.com>

Hi Jonathan,

On Jan 24 2017 or thereabouts, Jonathan Clarke wrote:
> Hi all,
> 
> I'd like to get your opinion on a proposal for a small change to the
> hid-multitouch driver.  As you probably know this driver supports
> multi touch input for various touchscreen/touchpad devices.
> 
> The change relates to lines 654 & 655 of "hid-multitouch.c" - I would
> like to remove the "division by 2" applied to the "touch width" and
> "touch height" values received from the input device.  These values
> represent the width and height of the area occupied by a finger
> touching the input device.
> 
> https://github.com/torvalds/linux/blame/master/drivers/
> hid/hid-multitouch.c#L654
> 
> This division by 2 was added along with the the touch width/height
> fields 6 years ago so that those fields "match the visual scale of the
> touch" for a specific device (3M PCT) - see comment & associated
> commit log for line 653.
> 
> I don't think that this scaling is appropriate for all the other devices
> that this driver now supports.  On my screen for example (Elan
> multitouch screen), the touch width and height reported bear no
> relation to the "visual scale of the touch" with or without this /2
> scaling applied.  I suspect that the scale of touch width/height
> values reported are different for every device (though I've not
> checked any other device).
> 
> The scaling is also discarding information about touch size (1 bit for
> each of width/height) which is useful for any application that wants
> to know about it.
> 
> So in summary I think the main questions for you are:
> 1. would making this change have a negative effect on any existing
> applications that use this information?

It will have a negative effect on the particular models they were a fix
for. Luckily, the 3M panels already have a specific class for them, so I
wouldn't be against adding a quirk for those.

> 2. does it seem sensible to (continue to) provide touch width/height
> values that bear no relation to screen/pixel dimensions?

Unfortunately, that's what the hardware provides, and we can't do much
about it. IIRC Android has some table to match the incoming data with
proper values, and that's the only current solution. Miscorsoft enforced
a much better multitouch protocol in Windows 8, but failed at enforcing
the width and height of the contacts.

So, after a little bit of re-reading of
Documentation/input/multi-touch-protocol.txt, I also think we should get
rid of the divided by 2 in the generic case. WIDTH and HEIGHT are,
according to this document the diameters of the ellipses, so it makes no
sense to divide them by 2 (except in the 3M case, where the value was
too big).

So please submit a patch for this, and add a specific quirk in the MT_CLS_3M
class to divide by 2 the width and height.

Cheers,
Benjamin

> 
> I delved into this because I wanted to get as much precision on touch
> width/height as possible and was surprised at the low resolution of
> sizes output by my touchscreen.  I got an extra 2 bits of precision
> from my search!
> 
> Cheers & thanks for reading.  Jonathan

  reply	other threads:[~2017-01-25 10:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 21:47 hid-multitouch: change for touch height/width Jonathan Clarke
2017-01-25 10:39 ` Benjamin Tissoires [this message]
2017-01-25 12:17   ` Jonathan Clarke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170125103950.GA13244@mail.corp.redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=chatty@enac.fr \
    --cc=jkosina@suse.cz \
    --cc=jonathan.a.clarke@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox