linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ping Cheng <pinglinux@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>, linux-input@vger.kernel.org
Subject: Re: [2/2] input: wacom - Pass touch resolution to clients through input_absinfo
Date: Mon, 24 Jan 2011 12:09:24 -0800	[thread overview]
Message-ID: <AANLkTi=8sDff350GAc+tkqYiTz+BQV6d44EgpUC5ToTC@mail.gmail.com> (raw)
In-Reply-To: <20110124183656.GC17855@core.coreip.homeip.net>

On Mon, Jan 24, 2011 at 10:36 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Mon, Jan 24, 2011 at 10:18:54AM -0800, Ping Cheng wrote:
>> On Mon, Jan 24, 2011 at 6:40 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
>> > Hi Ping,
>> >
>> >> @@ -1228,8 +1228,13 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
>> >>       case TABLETPC:
>> >>               if (features->device_type == BTN_TOOL_DOUBLETAP ||
>> >>                   features->device_type == BTN_TOOL_TRIPLETAP) {
>> >> -                     input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0);
>> >> -                     input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0);
>> >> +                     /* set touch resolution in points/mm */
>> >> +                     res = features->x_phy/100;
>> >> +                     input_abs_set_res(input_dev, ABS_X,
>> >> +                                         features->x_max/res);
>> >
>> > It seems to me the construction above looses precision twice for no
>> > apparent reason.
>>
>> Well, there was a reason (logically instead of mathematically though):
>> features->x_phy/100 gives us the physical size of the touch area in
>> mm.
>>
>> > How about instead use "100 * features->x_max /
>> > features->x_phy"?
>>
>> Sure.
>>
>> > Besides, it is a bit unfortunate that "res" is short
>> > for both result and resolution.
>>
>> Resolution is defined as __s32 in input_absinfo. How about we use __s32 then?
>
> input_abs_set_res() takes and int argument so keep it int  (or just
> embed the expression into the call and forgo 'res').

I added 'res' to avoid confusion hence questions about the formula. I
am still questioned ;).

 I'll forgo 'res' in v2. Thank you for the suggestions.

Ping
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2011-01-24 20:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-23 23:26 [PATCH 2/2] input: wacom - Pass touch resolution to clients through input_absinfo Ping Cheng
2011-01-24 14:40 ` [2/2] " Henrik Rydberg
2011-01-24 18:18   ` Ping Cheng
2011-01-24 18:36     ` Dmitry Torokhov
2011-01-24 20:09       ` Ping Cheng [this message]

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='AANLkTi=8sDff350GAc+tkqYiTz+BQV6d44EgpUC5ToTC@mail.gmail.com' \
    --to=pinglinux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).