qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ps2: set ps/2 output buffer size as the same as


From: Gonglei (Arei)
Subject: Re: [Qemu-devel] [PATCH] ps2: set ps/2 output buffer size as the same as kernel
Date: Thu, 24 Apr 2014 07:45:57 +0000

Hi, Gerd.

> >      if (!(s->mouse_status & MOUSE_STATUS_REMOTE) &&
> > -        (s->common.queue.count < (PS2_QUEUE_SIZE - 16))) {
> > +        (s->common.queue.count < PS2_QUEUE_SIZE)) {
> 
> To me this looks like an attempt to make sure the queue has enough space
> for the whole mouse message.  Message size is 3 or 4 bytes (depending on
> mode), so I think we should make that "... < (PS2_QUEUE_SIZE-4)".
> 
> >          for(;;) {
> >              /* if not remote, send event. Multiple events are sent if
> >                 too big deltas */
> 
> ... and move the check into the loop.  Or, maybe even better, into the
> ps2_mouse_send_packet() function.
> 
Move the check into ps2_mouse_send_packet() is not a good idea.
In that case, we cannot break the for loop except we change the return value
of ps2_mouse_send_packet(). Maybe keep the original location is better, right?


Best regards,
-Gonglei

reply via email to

[Prev in Thread] Current Thread [Next in Thread]