From patchwork Wed Jul 20 10:23:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 105664 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5C5A0B6F69 for ; Wed, 20 Jul 2011 22:09:25 +1000 (EST) Received: from localhost ([::1]:41415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjVab-0002OE-Az for incoming@patchwork.ozlabs.org; Wed, 20 Jul 2011 08:09:21 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjTwJ-0000kR-Vv for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjTwG-00049J-0V for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjTwF-00048v-Ad for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:35 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6KANYJl026123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jul 2011 06:23:34 -0400 Received: from rincewind.home.kraxel.org (vpn1-5-220.ams2.redhat.com [10.36.5.220]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6KANT1U023655; Wed, 20 Jul 2011 06:23:32 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id AC5C6405B8; Wed, 20 Jul 2011 12:23:24 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 20 Jul 2011 12:23:23 +0200 Message-Id: <1311157404-12362-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1311157404-12362-1-git-send-email-kraxel@redhat.com> References: <1311157404-12362-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 1/2] usb-hid: fixup changed tracking. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Remove leftover calls to usb_hid_changed(). Take care to update the changed flag after delivering a event via GET_REPORT like we do when sending events via interrupt endpoint. Signed-off-by: Gerd Hoffmann --- hw/usb-hid.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/usb-hid.c b/hw/usb-hid.c index d711b5c..b812da2 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -531,18 +531,15 @@ static void usb_keyboard_process_keycode(USBHIDState *hs) case 0xe0: if (s->modifiers & (1 << 9)) { s->modifiers ^= 3 << 8; - usb_hid_changed(hs); return; } case 0xe1 ... 0xe7: if (keycode & (1 << 7)) { s->modifiers &= ~(1 << (hid_code & 0x0f)); - usb_hid_changed(hs); return; } case 0xe8 ... 0xef: s->modifiers |= 1 << (hid_code & 0x0f); - usb_hid_changed(hs); return; } @@ -769,10 +766,12 @@ static int usb_hid_handle_control(USBDevice *dev, USBPacket *p, } break; case GET_REPORT: - if (s->kind == USB_MOUSE || s->kind == USB_TABLET) + if (s->kind == USB_MOUSE || s->kind == USB_TABLET) { ret = usb_pointer_poll(s, data, length); - else if (s->kind == USB_KEYBOARD) + } else if (s->kind == USB_KEYBOARD) { ret = usb_keyboard_poll(s, data, length); + } + s->changed = s->n > 0; break; case SET_REPORT: if (s->kind == USB_KEYBOARD)