All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping Cheng <pinglinux@gmail.com>
To: Henrik Rydberg <rydberg@euromail.se>
Cc: Jiri Kosina <jkosina@suse.cz>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephane Chatty <chatty@enac.fr>,
	Rafi Rubin <rafi@seas.upenn.edu>,
	Michael Poole <mdpoole@troilus.org>
Subject: Re: [PATCH] hid-input: Use a larger event buffer for MT devices
Date: Mon, 14 Jun 2010 09:17:49 -0700	[thread overview]
Message-ID: <AANLkTinI8w5vCi-VOf_IybZmOBDe8gjlJymZNSmmpkpk@mail.gmail.com> (raw)
In-Reply-To: <1276516181-4519-1-git-send-email-rydberg@euromail.se>

On Mon, Jun 14, 2010 at 4:49 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
> The MT devices produce a lot of data. Tell the underlying input device
> approximately how many events will be sent per synchronization, to allow
> for better buffering. The number is a template based on continuously
> reporting details for each finger on a single hand.
>
> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
> ---
> Hi Jiri,
>
> This patch goes together with the evdev buffer patchset, which Dmitry
> is going to queue for 2.6.36.
>
> Cheers,
> Henrik
>
>  drivers/hid/hid-input.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 7a0d2e4..69d152e 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -534,6 +534,9 @@ mapped:
>                        input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4);
>                else    input_set_abs_params(input, usage->code, a, b, 0, 0);
>
> +               /* use a larger default input buffer for MT devices */
> +               if (usage->code == ABS_MT_POSITION_X && input->hint_events_per_packet == 0)
> +                       input_set_events_per_packet(input, 60);

Do we really want to use a hardcoded number here? Considering you have
used the same value in your "input: bcm5974" patch, adding it as an
ifdef in linux/input.h should not be an overkill in design and offers
the other drivers a chance to use it.

Ping

>        }
>
>        if (usage->type == EV_ABS &&
> --
> 1.6.3.3
>
> --
> 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
>

WARNING: multiple messages have this Message-ID (diff)
From: Ping Cheng <pinglinux@gmail.com>
To: Henrik Rydberg <rydberg@euromail.se>
Cc: Jiri Kosina <jkosina@suse.cz>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephane Chatty <chatty@enac.fr>,
	Rafi Rubin <rafi@seas.upenn.edu>,
	Michael Poole <mdpoole@troilus.org>
Subject: Re: [PATCH] hid-input: Use a larger event buffer for MT devices
Date: Mon, 14 Jun 2010 09:17:49 -0700	[thread overview]
Message-ID: <AANLkTinI8w5vCi-VOf_IybZmOBDe8gjlJymZNSmmpkpk@mail.gmail.com> (raw)
In-Reply-To: <1276516181-4519-1-git-send-email-rydberg@euromail.se>

On Mon, Jun 14, 2010 at 4:49 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
> The MT devices produce a lot of data. Tell the underlying input device
> approximately how many events will be sent per synchronization, to allow
> for better buffering. The number is a template based on continuously
> reporting details for each finger on a single hand.
>
> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
> ---
> Hi Jiri,
>
> This patch goes together with the evdev buffer patchset, which Dmitry
> is going to queue for 2.6.36.
>
> Cheers,
> Henrik
>
>  drivers/hid/hid-input.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 7a0d2e4..69d152e 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -534,6 +534,9 @@ mapped:
>                        input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4);
>                else    input_set_abs_params(input, usage->code, a, b, 0, 0);
>
> +               /* use a larger default input buffer for MT devices */
> +               if (usage->code == ABS_MT_POSITION_X && input->hint_events_per_packet == 0)
> +                       input_set_events_per_packet(input, 60);

Do we really want to use a hardcoded number here? Considering you have
used the same value in your "input: bcm5974" patch, adding it as an
ifdef in linux/input.h should not be an overkill in design and offers
the other drivers a chance to use it.

Ping

>        }
>
>        if (usage->type == EV_ABS &&
> --
> 1.6.3.3
>
> --
> 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
>
--
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

  parent reply	other threads:[~2010-06-14 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 11:49 [PATCH] hid-input: Use a larger event buffer for MT devices Henrik Rydberg
2010-06-14 11:55 ` Jiri Kosina
2010-06-14 16:17 ` Ping Cheng [this message]
2010-06-14 16:17   ` Ping Cheng
2010-06-14 18:17   ` Henrik Rydberg

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=AANLkTinI8w5vCi-VOf_IybZmOBDe8gjlJymZNSmmpkpk@mail.gmail.com \
    --to=pinglinux@gmail.com \
    --cc=chatty@enac.fr \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdpoole@troilus.org \
    --cc=rafi@seas.upenn.edu \
    --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.