[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinqbLShaVGL6NJCMamHNWzMGT7DLXb7OQ6dxLVX@mail.gmail.com>
Date: Fri, 25 Mar 2011 16:12:01 -0700
From: Jeffrey Brown <jeffbrown@...roid.com>
To: Henrik Rydberg <rydberg@...omail.se>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] input: evdev: Indicate buffer overrun with SYN_DROPPED.
Hi Henrik,
On Fri, Mar 25, 2011 at 2:02 AM, Henrik Rydberg <rydberg@...omail.se> wrote:
> My last comment was not right, the SYN_DROPPED is pushed ahead in the
> buffer, sorry about that. However, this change does not shrink the
> number of buffered elements in case of an overrun, which has been
> discussed before as a possibly important feature of the current
> code. I would be more comfortable prepending the head with a
> SYN_DROPPED, like this:
>
> if (client->head == client->tail) {
> struct input_event drop;
>
> drop.time = event->time;
> drop.type = EV_SYN;
> drop.code = SYN_DROPPED;
> drop.value = 0;
> client->buffer[client->head++] = drop;
> client->head &= client->bufsize - 1;
>
> client->buffer[client->head++] = *event;
> client->head &= client->bufsize - 1;
> }
>
> The main point is that if we end up having to drop an event, it is
> likely we will have to drop the next one, too.
I think that's a good idea. If the client is far behind then we might
as well truncate the buffer as you suggest. I'll do that.
Jeff.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists