From patchwork Tue Oct 4 16:07:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 117656 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 9E847B6F6F for ; Wed, 5 Oct 2011 03:07:36 +1100 (EST) Received: from localhost ([::1]:45368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB7Wn-0002Fv-HT for incoming@patchwork.ozlabs.org; Tue, 04 Oct 2011 12:07:33 -0400 Received: from eggs.gnu.org ([140.186.70.92]:55222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB7We-00024U-OR for qemu-devel@nongnu.org; Tue, 04 Oct 2011 12:07:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RB7Wd-0000F7-MV for qemu-devel@nongnu.org; Tue, 04 Oct 2011 12:07:24 -0400 Received: from mail-ey0-f173.google.com ([209.85.215.173]:53840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB7Wd-0000F3-Hd for qemu-devel@nongnu.org; Tue, 04 Oct 2011 12:07:23 -0400 Received: by eyg24 with SMTP id 24so704523eyg.4 for ; Tue, 04 Oct 2011 09:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=HlWuw6KeIJhFUKIrYvqA2N+SW0BXZorq7HmuXm4GClY=; b=qgiSUHlVm2DfcdwGNoWbTRSkf5HKKAeR6EA9EZQq7pIHdeDIHBJDT4p/glMIsS4I70 u6wPvAlNVSKo6qhemLTKncDM0muWct4i4jBhSuEpoP6SUtHYpjp4pYL1dC68ATUT+qkf qSjwKGf2qvgIg4NhDnZs23n5w0q2uxnDUBqik= Received: by 10.216.203.79 with SMTP id e57mr5248454weo.12.1317744442399; Tue, 04 Oct 2011 09:07:22 -0700 (PDT) Received: from localhost (154.Red-83-32-170.dynamicIP.rima-tde.net. [83.32.170.154]) by mx.google.com with ESMTPS id ex12sm4742111wbb.23.2011.10.04.09.07.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Oct 2011 09:07:21 -0700 (PDT) From: "=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=" To: qemu-devel@nongnu.org Date: Tue, 4 Oct 2011 18:07:11 +0200 Message-Id: <1317744432-1874-2-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 1.7.6.2 In-Reply-To: <1317744432-1874-1-git-send-email-marcandre.lureau@redhat.com> References: <1317744432-1874-1-git-send-email-marcandre.lureau@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.215.173 Cc: yhalperi@redhat.com, alevy@redhat.com, kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [Qemu-devel] [PATCH 1/2] hda: do not mix output and input streams, RHBZ #740493 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 Windows 7 may use the same stream number for input and output. That will result in lot of garbage on playback. The hardcoded value of 4 needs to be in sync with GCAP streams description and IN/OUT registers. --- hw/intel-hda.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/intel-hda.c b/hw/intel-hda.c index 4272204..c6a3fec 100644 --- a/hw/intel-hda.c +++ b/hw/intel-hda.c @@ -389,14 +389,15 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t stnr, bool output, { HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, dev->qdev.parent_bus); IntelHDAState *d = container_of(bus, IntelHDAState, codecs); - IntelHDAStream *st = NULL; target_phys_addr_t addr; uint32_t s, copy, left; + IntelHDAStream *st; bool irq = false; - for (s = 0; s < ARRAY_SIZE(d->st); s++) { - if (stnr == ((d->st[s].ctl >> 20) & 0x0f)) { - st = d->st + s; + st = output ? d->st + 4 : d->st; + for (s = 0; s < 4; s++) { + if (stnr == ((st[s].ctl >> 20) & 0x0f)) { + st = st + s; break; } }