qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] HDA fixes for Windows 7
@ 2011-10-04 16:07 Marc-André Lureau
  2011-10-04 16:07 ` [Qemu-devel] [PATCH 1/2] hda: do not mix output and input streams, RHBZ #740493 Marc-André Lureau
  2011-10-04 16:07 ` [Qemu-devel] [PATCH 2/2] hda: do not mix output and input stream states, " Marc-André Lureau
  0 siblings, 2 replies; 8+ messages in thread
From: Marc-André Lureau @ 2011-10-04 16:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: yhalperi, alevy, kraxel, Marc-André Lureau

Hi,

There are two related bugs in stream state and xfer handling due to the
conflict of stream number (on Windows 7, input stream and output stream
both use the full range of 1..15 values. on Linux, the handling is
different and it works fine because there is no clash)

The patches handle stream number for input and output stream
distinctively to avoid conflict, and it seems to be in accordance
to the spec.

Marc-André Lureau (2):
  hda: do not mix output and input streams, RHBZ #740493
  hda: do not mix output and input stream states, RHBZ #740493

 hw/hda-audio.c |   15 +++++++++------
 hw/intel-hda.c |   18 ++++++++++--------
 hw/intel-hda.h |    2 +-
 3 files changed, 20 insertions(+), 15 deletions(-)

-- 
1.7.6.2

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 1/2] hda: do not mix output and input streams, RHBZ #740493
@ 2011-10-17 10:58 Marc-André Lureau
  2011-10-17 10:58 ` [Qemu-devel] [PATCH 2/2] hda: do not mix output and input stream states, " Marc-André Lureau
  0 siblings, 1 reply; 8+ messages in thread
From: Marc-André Lureau @ 2011-10-17 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, kraxel

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 <marcandre.lureau@redhat.com>
---
 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;
         }
     }
-- 
1.7.6.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 1/2] hda: do not mix output and input streams, RHBZ #740493
@ 2011-10-25 14:53 Marc-André Lureau
  2011-10-25 14:53 ` [Qemu-devel] [PATCH 2/2] hda: do not mix output and input stream states, " Marc-André Lureau
  0 siblings, 1 reply; 8+ messages in thread
From: Marc-André Lureau @ 2011-10-25 14:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, kraxel

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 <marcandre.lureau@redhat.com>
---
 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;
         }
     }
-- 
1.7.6.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-25 14:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-04 16:07 [Qemu-devel] [PATCH 0/2] HDA fixes for Windows 7 Marc-André Lureau
2011-10-04 16:07 ` [Qemu-devel] [PATCH 1/2] hda: do not mix output and input streams, RHBZ #740493 Marc-André Lureau
2011-10-04 16:07 ` [Qemu-devel] [PATCH 2/2] hda: do not mix output and input stream states, " Marc-André Lureau
2011-10-04 17:21   ` Juan Quintela
2011-10-05  1:43     ` Marc-André Lureau
2011-10-14 11:38       ` Gerd Hoffmann
  -- strict thread matches above, loose matches on Subject: below --
2011-10-17 10:58 [Qemu-devel] [PATCH 1/2] hda: do not mix output and input streams, " Marc-André Lureau
2011-10-17 10:58 ` [Qemu-devel] [PATCH 2/2] hda: do not mix output and input stream states, " Marc-André Lureau
2011-10-25 14:53 [Qemu-devel] [PATCH 1/2] hda: do not mix output and input streams, " Marc-André Lureau
2011-10-25 14:53 ` [Qemu-devel] [PATCH 2/2] hda: do not mix output and input stream states, " Marc-André Lureau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).