From patchwork Tue Nov 6 14:08:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 197482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BB6782C00B5 for ; Wed, 7 Nov 2012 01:08:17 +1100 (EST) Received: from localhost ([::1]:54756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVjp9-0005y4-Mz for incoming@patchwork.ozlabs.org; Tue, 06 Nov 2012 09:08:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVjod-0005Nk-NS for qemu-devel@nongnu.org; Tue, 06 Nov 2012 09:07:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVjob-00058z-IT for qemu-devel@nongnu.org; Tue, 06 Nov 2012 09:07:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVjob-00058j-9n for qemu-devel@nongnu.org; Tue, 06 Nov 2012 09:07:41 -0500 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 qA6E7e8Y021271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Nov 2012 09:07:40 -0500 Received: from localhost.localdomain.com (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA6E7MeM012920; Tue, 6 Nov 2012 09:07:38 -0500 From: Hans de Goede To: Gerd Hoffmann Date: Tue, 6 Nov 2012 15:08:21 +0100 Message-Id: <1352210901-1923-9-git-send-email-hdegoede@redhat.com> In-Reply-To: <1352210901-1923-1-git-send-email-hdegoede@redhat.com> References: <1352210901-1923-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 8/8] usb-hid: Allow connecting to a USB-2 device 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 Our ehci code has is capable of significantly lowering the wakeup rate for the hcd emulation while the device is idle. It is possible to add similar code ot the uhci emulation, but that simply is not there atm, and there is no reason why a (virtual) usb device can not be a USB-2 device. Making usb-hid devices connect to the emulated ehci controller instead of the emulated uhci controller on vms which have both lowers the cpuload for a fully idle vm from 20% to 2-3% (on my laptop). Signed-off-by: Hans de Goede --- hw/usb/dev-hid.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index 69f89ff..96ba0c0 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -97,7 +97,7 @@ static const USBDescIface desc_iface_mouse = { .bEndpointAddress = USB_DIR_IN | 0x01, .bmAttributes = USB_ENDPOINT_XFER_INT, .wMaxPacketSize = 4, - .bInterval = 0x0a, + .bInterval = 8, }, }, }; @@ -127,7 +127,7 @@ static const USBDescIface desc_iface_tablet = { .bEndpointAddress = USB_DIR_IN | 0x01, .bmAttributes = USB_ENDPOINT_XFER_INT, .wMaxPacketSize = 8, - .bInterval = 0x0a, + .bInterval = 8, }, }, }; @@ -158,7 +158,7 @@ static const USBDescIface desc_iface_keyboard = { .bEndpointAddress = USB_DIR_IN | 0x01, .bmAttributes = USB_ENDPOINT_XFER_INT, .wMaxPacketSize = 8, - .bInterval = 0x0a, + .bInterval = 8, }, }, }; @@ -224,6 +224,7 @@ static const USBDesc desc_mouse = { .iSerialNumber = STR_SERIALNUMBER, }, .full = &desc_device_mouse, + .high = &desc_device_mouse, .str = desc_strings, }; @@ -237,6 +238,7 @@ static const USBDesc desc_tablet = { .iSerialNumber = STR_SERIALNUMBER, }, .full = &desc_device_tablet, + .high = &desc_device_tablet, .str = desc_strings, }; @@ -250,6 +252,7 @@ static const USBDesc desc_keyboard = { .iSerialNumber = STR_SERIALNUMBER, }, .full = &desc_device_keyboard, + .high = &desc_device_keyboard, .str = desc_strings, };