From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCsN1-0005Y1-FW for qemu-devel@nongnu.org; Wed, 28 Mar 2012 08:53:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCsMr-0007rz-LF for qemu-devel@nongnu.org; Wed, 28 Mar 2012 08:52:59 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 28 Mar 2012 14:52:22 +0200 Message-Id: <1332939159-16434-20-git-send-email-afaerber@suse.de> In-Reply-To: <1332939159-16434-1-git-send-email-afaerber@suse.de> References: <1332939159-16434-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH stable-0.15 19/36] hda: do not mix output and input streams, RHBZ #740493 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@suse.de, qemu-stable@nongnu.org, Bruce Rogers , Marc-Andr? Lureau , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Marc-Andr=C3=A9 Lureau 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. Signed-off-by: Marc-Andr? Lureau Signed-off-by: malc (cherry picked from commit 36ac4ad3d054a7b4962a6393630a73591cfa9558) Signed-off-by: Bruce Rogers Signed-off-by: Andreas F=C3=A4rber --- 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 5a2bc3a..7d02558 100644 --- a/hw/intel-hda.c +++ b/hw/intel-hda.c @@ -389,14 +389,15 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uin= t32_t stnr, bool output, { HDACodecBus *bus =3D DO_UPCAST(HDACodecBus, qbus, dev->qdev.parent_b= us); IntelHDAState *d =3D container_of(bus, IntelHDAState, codecs); - IntelHDAStream *st =3D NULL; target_phys_addr_t addr; uint32_t s, copy, left; + IntelHDAStream *st; bool irq =3D false; =20 - for (s =3D 0; s < ARRAY_SIZE(d->st); s++) { - if (stnr =3D=3D ((d->st[s].ctl >> 20) & 0x0f)) { - st =3D d->st + s; + st =3D output ? d->st + 4 : d->st; + for (s =3D 0; s < 4; s++) { + if (stnr =3D=3D ((st[s].ctl >> 20) & 0x0f)) { + st =3D st + s; break; } } --=20 1.7.7