Re: [PATCH v9 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

H. Nikolaus Schaller
2017-02-20T16:50:01Z

[-- Attachment #1: Type: text/plain, Size: 4239 bytes --]

Hi Pavel,

> Am 19.02.2017 um 23:19 schrieb Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>:
>
> hi!
>
>>>> But as said I don't think we need float or fixed point for practical systems
>>>> at all.
>>>
>>> So you are going to loose precision. And if userspace decides to
>>> calibrate it slightly differently from kernel, lost precision will
>>> matter.
>>
>> Really?
>
> Really.
>
>> Example:
>>
>> ADC values go 100 .. 3995 (i.e. touch margin is 100 steps in pre-calibration)
>>
>> This is scaled to let's say 0..640.
>
> Ok. Now userspace realizes that kernel alignemnt is off, and it would
> want to scale it to 1..642.

Screen coordinates are still 0..639.

> That will mean that single pixel will be
> inaccessible, right?

Yes, that can happen if the additional user-space scale is > 1.0.

As long as it is small (I expect <1.01 = 1% error in scale) it is
barely noticeable.

Therefore, I asked before: how big in pixels is your finger or stylus?
Does this effect matter?

A resistive touch is a man-machine-interface where people press buttons of at
least 12x12 pixels size (or they are no longer visually recognizable).

A resistive touch is not intended to be a high-precision measurement instrument.

So the discussion boils down to "what gives the better usability?":
a) getting rid of the nasty user-space calibration step (and plethora of different tools)
b) getting highest theoretical precision which has a low practical relevance

I am in favor of a). Like most users we ask. A minority is in favor of b).
Since we don't exclude b) users from reconfiguring their system to get it done
as they like. I think this is the best we can achieve.

>
>>> No. You have to design interface such that they _can_ be improved, and
>>> what you propose does not work that way.
>>
>> It works. Please do real world tests...
>
> You do a real world test on N900, and propose upgrade path.

I have no N900 running. But since it uses a tsc2004/5 controller which seems
to be quite similar, you can likely copy&paste some code or add the algorithm:

ABS_X = (touchscreen-size-x * (adc_x - adc_min_x)) / (adc_max_x - adc_min_x)

Thats it.

If you set touchscreen-size-x = (adc_max_x - adc_min_x) you get maximum precision
you can achieve with integer arithmetic. And if you set adc_min_x = 0 your
user-space gets what it would have got before adding such a formula and then you
can and must do calibration there.

Taking this as the defaults if none of the new properties is specified, makes
the scaling feature completely disappear. And I don't care about 2 additional
subtractions, one multiplication and one division per axis.

So the upgrade path is:
1. introduce new optional properties, parse and store them in the struct
2. set defaults for the optional properties as described above
3. add the formula to the code (1 line for each axis)
4. deploy - nobody will notice
5. update the DT and remove user-space calibration - people will be happy
that they do not have to calibrate first any more

>
>>> Yes. I want to prevent you from pushing crap into the kernel.
>>
>> Crap? Well, we have discussed this driver for months here on the list and
>> after a lot of improvements we came up to v9.
>>
>> And you still think it is crap and none of the other reviewers has noticed?
>
> I'm pretty sure you will not be able to push calibration into kernel.

>
>>> Userspace has to know how to do the calibration _anyway_ (for
>>> other hardware),
>>
>> What for? I do not understand which other hardware you are talking about.
>>
>> On our devices there is only one touch glued to the panel and that one
>> has to be calibrated. Ideally before the user gets the device into his
>> hands => precalibration...
>>
>> If you connect a digitizer, then that one has to be calibrated of course,
>> but it is not glued onto the display panel. Hence it is a different
>> issue.
>
> It is actually same issue. One kernel interface should work for all
> the touchscreens.

Do we propose a different kernel interface? We propose to still use input events.
There is no change at all here.

BR and thanks,
Nikolaus

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 801 bytes --]