render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame 0218-hda-do-not-mix-output-and-input-streams-RHBZ-740493.patch

cd9d16
From 05a5f7c79ad8dc4887e7cd60c2572121b51adce7 Mon Sep 17 00:00:00 2001
cd9d16
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
cd9d16
Date: Tue, 25 Oct 2011 16:53:00 +0200
cd9d16
Subject: [PATCH] hda: do not mix output and input streams, RHBZ #740493
cd9d16
MIME-Version: 1.0
cd9d16
Content-Type: text/plain; charset=UTF-8
cd9d16
Content-Transfer-Encoding: 8bit
cd9d16
cd9d16
Windows 7 may use the same stream number for input and output.
cd9d16
That will result in lot of garbage on playback.
cd9d16
cd9d16
The hardcoded value of 4 needs to be in sync with GCAP streams
cd9d16
description and IN/OUT registers.
cd9d16
cd9d16
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
cd9d16
Signed-off-by: malc <av1474@comtv.ru>
cd9d16
(cherry picked from commit 36ac4ad3d054a7b4962a6393630a73591cfa9558)
cd9d16
cd9d16
Signed-off-by: Bruce Rogers <brogers@suse.com>
cd9d16
Signed-off-by: Andreas Färber <afaerber@suse.de>
cd9d16
---
cd9d16
 hw/intel-hda.c | 9 +++++----
cd9d16
 1 file changed, 5 insertions(+), 4 deletions(-)
cd9d16
cd9d16
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
cd9d16
index 5a2bc3a..7d02558 100644
cd9d16
--- a/hw/intel-hda.c
cd9d16
+++ b/hw/intel-hda.c
cd9d16
@@ -389,14 +389,15 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t stnr, bool output,
cd9d16
 {
cd9d16
     HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, dev->qdev.parent_bus);
cd9d16
     IntelHDAState *d = container_of(bus, IntelHDAState, codecs);
cd9d16
-    IntelHDAStream *st = NULL;
cd9d16
     target_phys_addr_t addr;
cd9d16
     uint32_t s, copy, left;
cd9d16
+    IntelHDAStream *st;
cd9d16
     bool irq = false;
cd9d16
 
cd9d16
-    for (s = 0; s < ARRAY_SIZE(d->st); s++) {
cd9d16
-        if (stnr == ((d->st[s].ctl >> 20) & 0x0f)) {
cd9d16
-            st = d->st + s;
cd9d16
+    st = output ? d->st + 4 : d->st;
cd9d16
+    for (s = 0; s < 4; s++) {
cd9d16
+        if (stnr == ((st[s].ctl >> 20) & 0x0f)) {
cd9d16
+            st = st + s;
cd9d16
             break;
cd9d16
         }
cd9d16
     }
cd9d16
-- 
cd9d16
1.7.11.2
cd9d16