lkml.org 
[lkml]   [2010]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] input: Use driver hint to compute the evdev buffer size (rev3)
On Wed, Jun 23, 2010 at 07:07:44PM +0200, Henrik Rydberg wrote:
> Hi Ping,
> [...]
> >> @@ -51,7 +52,9 @@ static DEFINE_MUTEX(evdev_table_mutex);
> >>
> >> static int evdev_compute_buffer_size(struct input_dev *dev)
> >> {
> >> - return EVDEV_MIN_BUFFER_SIZE;
> >> + int nev = dev->hint_events_per_packet * EVDEV_BUF_PACKETS;
> >> + nev = max(nev, EVDEV_MIN_BUFFER_SIZE);
> >> + return roundup_pow_of_two(nev);
> >
> > I think we have a backward compatibility issue here. This routine will
> > return 7 when nev falls to the default value
> > (EVDEV_MIN_BUFFER_SIZE/64). This could happen to those drivers that
> > don't report MT events or forget/don't feel the need to set
> > hint_events_per_packet since the old BUFFER_SIZE worked perfectly for
> > them. We need to keep the return value for those drivers as 64 so we
> > could allocate the same space as it was in [PATCH 1/5].
>
> Are you perhaps confusing EVDEV_BUF_PACKETS and EVDEV_MIN_BUFFER_SIZE? The last
> line ensures that the value returned is a power of two (hence not 7). The
> second-to-last line ensures the value is at least equal to 64 (hence not 7). The
> default hint value for a driver that does not do anything is zero, which leads
> to a return value of 64, just as it is today.
>

I think Ping might have confused roundup_pow_of_two() with
get_order()-type function...

Anyways, applied all 5, thanks Henrik.

--
Dmitry


\
 
 \ /
  Last update: 2010-06-23 19:15    [W:0.663 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site