All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Henrik Rydberg" <rydberg@euromail.se>
To: Ping Cheng <pinglinux@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com,
	Ping Cheng <pingc@wacom.com>
Subject: Re: [2/2] input: wacom - Pass touch resolution to clients through input_absinfo
Date: Mon, 24 Jan 2011 15:40:17 +0100	[thread overview]
Message-ID: <20110124144017.GA4367@polaris.bitmath.org> (raw)
In-Reply-To: <1295825201-12567-1-git-send-email-pinglinux@gmail.com>

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. How about instead use "100 * features->x_max /
features->x_phy"? Besides, it is a bit unfortunate that "res" is short
for both result and resolution. Finally, are the physical dimensions
actually presented in 100ths of millimeters?

Thanks,
Henrik

  reply	other threads:[~2011-01-24 14:45 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 ` Henrik Rydberg [this message]
2011-01-24 18:18   ` [2/2] " Ping Cheng
2011-01-24 18:36     ` Dmitry Torokhov
2011-01-24 20:09       ` Ping Cheng

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=20110124144017.GA4367@polaris.bitmath.org \
    --to=rydberg@euromail.se \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=pingc@wacom.com \
    --cc=pinglinux@gmail.com \
    /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.