9ae3a8
From 91bcfcc9583a61158f7f69f52ff3575eb432067f Mon Sep 17 00:00:00 2001
9ae3a8
From: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
Date: Wed, 11 Dec 2013 09:49:07 -0500
9ae3a8
Subject: [PATCH 01/14] intel-hda: fix position buffer
9ae3a8
9ae3a8
Message-id: <1386755347-9800-2-git-send-email-kraxel@redhat.com>
9ae3a8
Patchwork-id: 56156
9ae3a8
O-Subject: [RHEL-7 qemu-kvm PATCH 1/1] intel-hda: fix position buffer
9ae3a8
Bugzilla: 947785
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
9ae3a8
9ae3a8
Fix position buffer updates to use the correct stream offset.
9ae3a8
9ae3a8
Without this patch both IN (record) and OUT (playback) streams
9ae3a8
will update the IN buffer positions.  The linux kernel notices
9ae3a8
and complains:
9ae3a8
  hda-intel: Invalid position buffer, using LPIB read method instead.
9ae3a8
9ae3a8
The bug may also lead to glitches when recording and playing
9ae3a8
at the same time:
9ae3a8
  https://bugzilla.redhat.com/show_bug.cgi?id=947785
9ae3a8
9ae3a8
Cc: qemu-stable@nongnu.org
9ae3a8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
(cherry picked from commit d58ce68a454e5ae9cbde0308def379e272f13b10)
9ae3a8
---
9ae3a8
 hw/audio/intel-hda.c | 1 +
9ae3a8
 1 file changed, 1 insertion(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/audio/intel-hda.c | 1 +
9ae3a8
 1 file changed, 1 insertion(+)
9ae3a8
9ae3a8
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
9ae3a8
index e747342..cc948de 100644
9ae3a8
--- a/hw/audio/intel-hda.c
9ae3a8
+++ b/hw/audio/intel-hda.c
9ae3a8
@@ -439,6 +439,7 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t stnr, bool output,
9ae3a8
         }
9ae3a8
     }
9ae3a8
     if (d->dp_lbase & 0x01) {
9ae3a8
+        s = st - d->st;
9ae3a8
         addr = intel_hda_addr(d->dp_lbase & ~0x01, d->dp_ubase);
9ae3a8
         stl_le_pci_dma(&d->pci, addr + 8*s, st->lpib);
9ae3a8
     }
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8