All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Echtler <floe@butterbrot.org>
To: David Herrmann <dh.herrmann@gmail.com>,
	HID CORE LAYER <linux-input@vger.kernel.org>
Cc: Henrik Rydberg <rydberg@euromail.se>,
	Benjamin Tissoires <benjamin.tissoires@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [PATCH] add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense)
Date: Fri, 11 Oct 2013 11:22:43 +0200	[thread overview]
Message-ID: <5257C363.5020708@butterbrot.org> (raw)
In-Reply-To: <CANq1E4R5-WEx_e1vYOmY-xGL0w669Qj54SGLU_tb8h97=5zH=A@mail.gmail.com>

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

On 02.10.2013 15:59, David Herrmann wrote:
>>> Or maybe even replace it by "u32 angle;". That should always be safe.
>>> Once you make use of this field, you can reconsider whether it's worth
>>> doing FP in the kernel. But as long as it's unused, I'd vote for
>>> avoiding "float" entirely.
>>
>> I was indeed planning to use this for orientation (as intended) in the
>> next iteration, what macros would I have to use for proper float handling?
> 
> Archived from 2003 but afaik his last paragraph still applies today:
>   http://yarchive.net/comp/linux/kernel_fp.html
> 
> So what you should do is forward the raw angle data to user-space and
> let them deal with it. We usually don't apply policy in the kernel but
> instead forward the given data to the user and let them do the
> orientation computations. Any specific reason why you want to do that
> in the kernel?
I think it would be more consistent to have an EV_ABS value for
orientation, ranging e.g. from 0 to 359 (or rather from 0 to e.g. 90, as
described in multi-touch-protocol.txt). For pass-through to work, I
would probably have to set min and max to 0 and __UINT32_MAX__?

Alternatively, I think it should be possible to perform the required
conversion using integer arithmetic and bit operations alone.

However, for the time being, I'd suggest to simply leave the float
alone, use just a 0/1 value for orientation and deal with this in a
later patch, agreed?

One additional question: is there any provision in the multitouch
protocol for differentiation between various types of objects, e.g.
"finger" and "palm"?

BTW, what's the best practice for resubmitting a patch? I've used "git
commit --amend" on my previous commit, and would now just use "git
send-email" again, creating a new thread?

Best regards, Florian
-- 
SENT FROM MY DEC VT50 TERMINAL




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2013-10-11  9:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 21:26 [PATCH] add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense) Florian Echtler
2013-09-18  7:29 ` Florian Echtler
2013-09-18 19:38 ` Henrik Rydberg
2013-10-02  8:01   ` Florian Echtler
2013-10-02  9:02     ` David Herrmann
     [not found]       ` <524C24B8.9090000@butterbrot.org>
     [not found]         ` <CANq1E4R5-WEx_e1vYOmY-xGL0w669Qj54SGLU_tb8h97=5zH=A@mail.gmail.com>
2013-10-11  9:22           ` Florian Echtler [this message]
2013-09-18 19:49 ` Dmitry Torokhov

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=5257C363.5020708@butterbrot.org \
    --to=floe@butterbrot.org \
    --cc=benjamin.tissoires@gmail.com \
    --cc=dh.herrmann@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=rydberg@euromail.se \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.