[haiku-commits] Re: r41864 - haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid

  • From: "Michael Lotz" <mmlr@xxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 13 Jun 2011 14:29:53 +0200

> On Thu, 02 Jun 2011 11:34:04 +1200, <mmlr@xxxxxxxx> wrote:
> 
> > Author: mmlr
> > Date: 2011-06-02 01:34:03 +0200 (Thu, 02 Jun 2011)
> > New Revision: 41864
> > Changeset: https://dev.haiku-os.org/changeset/41864
> >
> > Modified:
> >    haiku/trunk/src/add-
> > ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.cpp
> >    haiku/trunk/src/add-
> > ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.h
> > Log:
> > Since we never actually read more than one mouse_movement at a time 
> > and  
> > we only
> > ever wait for reports on demand, there's no need for buffering at 
> > all.
> > This removes some unnecessary copying and ring buffer overhead, the 
> > ring  
> > buffer
> > will now in fact not be created at all.
> >
> 
> just updated my system and my usb mouse hangs under heavy load now, 
> i.e.  
> when compiling the haiku source the mouse stagnates. Any relation to 
> this  
> changes?

No. As I already explained in the other thread, the process was already 
fully synchronous before. It would just needlessly put the data into a 
ring buffer and then read it out again making it:

ioctl
        wait for report
                process report
                write processed data into ring buffer
        read processed data from ring buffer
        return that data

The ring buffer write and read have now been replaced by directly 
providing the wait/process method with the ioctl buffer so it can be 
filled directly. It doesn't change anything on the process itself. If 
anything, the latency of the reads would now be smaller and the mouse 
resolution better.

Regards
Michael

Other related posts: