qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] Audio 20170918 patches
@ 2017-09-18 11:17 Gerd Hoffmann
  2017-09-18 11:17 ` [Qemu-devel] [PULL 1/2] wm8750: add record buffer underrun check Gerd Hoffmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2017-09-18 11:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

The following changes since commit f75637badd76ae0f3bd51a128e1a2da0d2bb1d6b:

  qemu.py: Fix syntax error (2017-09-18 11:32:22 +0100)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/audio-20170918-pull-request

for you to fetch changes up to a6b0bdc8fb4ca57a4274205659bbe91d78c23f22:

  audio: intel-hda: do not use old_mmio accesses (2017-09-18 13:13:32 +0200)

----------------------------------------------------------------
audio: bugfixes for wm8750 and intel-hda.

----------------------------------------------------------------

Gerd Hoffmann (1):
  wm8750: add record buffer underrun check

Matt Parker (1):
  audio: intel-hda: do not use old_mmio accesses

 hw/audio/intel-hda.c | 58 ++++++++++------------------------------------------
 hw/audio/wm8750.c    |  6 +++++-
 2 files changed, 16 insertions(+), 48 deletions(-)

-- 
2.9.3

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

* [Qemu-devel] [PULL 1/2] wm8750: add record buffer underrun check
  2017-09-18 11:17 [Qemu-devel] [PULL 0/2] Audio 20170918 patches Gerd Hoffmann
@ 2017-09-18 11:17 ` Gerd Hoffmann
  2017-09-18 11:17 ` [Qemu-devel] [PULL 2/2] audio: intel-hda: do not use old_mmio accesses Gerd Hoffmann
  2017-09-18 12:19 ` [Qemu-devel] [PULL 0/2] Audio 20170918 patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2017-09-18 11:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Reported-by: niuguoxiang@huawei.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20170901131409.6712-1-kraxel@redhat.com
---
 hw/audio/wm8750.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c
index f8b5bebfc2..d2bf2e1da1 100644
--- a/hw/audio/wm8750.c
+++ b/hw/audio/wm8750.c
@@ -680,8 +680,12 @@ uint32_t wm8750_adc_dat(void *opaque)
     WM8750State *s = (WM8750State *) opaque;
     uint32_t *data;
 
-    if (s->idx_in >= sizeof(s->data_in))
+    if (s->idx_in >= sizeof(s->data_in)) {
         wm8750_in_load(s);
+        if (s->idx_in >= sizeof(s->data_in)) {
+            return 0x80008000; /* silence in AUD_FMT_S16 sample format */
+        }
+    }
 
     data = (uint32_t *) &s->data_in[s->idx_in];
     s->req_in -= 4;
-- 
2.9.3

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

* [Qemu-devel] [PULL 2/2] audio: intel-hda: do not use old_mmio accesses
  2017-09-18 11:17 [Qemu-devel] [PULL 0/2] Audio 20170918 patches Gerd Hoffmann
  2017-09-18 11:17 ` [Qemu-devel] [PULL 1/2] wm8750: add record buffer underrun check Gerd Hoffmann
@ 2017-09-18 11:17 ` Gerd Hoffmann
  2017-09-18 12:19 ` [Qemu-devel] [PULL 0/2] Audio 20170918 patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2017-09-18 11:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Matt Parker, Gerd Hoffmann

From: Matt Parker <mtparkr@gmail.com>

intel-hda is currently using the old_mmio accessors for io.
This updates the device to use .read and .write accessors instead.

Signed-off-by: Matt Parker <mtparkr@gmail.com>
Message-id: 20170827192038.28930-1-mtparkr@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/audio/intel-hda.c | 58 ++++++++++------------------------------------------
 1 file changed, 11 insertions(+), 47 deletions(-)

diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index 06acc98f7b..18a50a8f83 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -22,6 +22,7 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
 #include "qemu/timer.h"
+#include "qemu/bitops.h"
 #include "hw/audio/soundhw.h"
 #include "intel-hda.h"
 #include "intel-hda-defs.h"
@@ -1043,66 +1044,29 @@ static void intel_hda_regs_reset(IntelHDAState *d)
 
 /* --------------------------------------------------------------------- */
 
-static void intel_hda_mmio_writeb(void *opaque, hwaddr addr, uint32_t val)
+static void intel_hda_mmio_write(void *opaque, hwaddr addr, uint64_t val,
+                                 unsigned size)
 {
     IntelHDAState *d = opaque;
     const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
 
-    intel_hda_reg_write(d, reg, val, 0xff);
+    intel_hda_reg_write(d, reg, val, MAKE_64BIT_MASK(0, size * 8));
 }
 
-static void intel_hda_mmio_writew(void *opaque, hwaddr addr, uint32_t val)
+static uint64_t intel_hda_mmio_read(void *opaque, hwaddr addr, unsigned size)
 {
     IntelHDAState *d = opaque;
     const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
 
-    intel_hda_reg_write(d, reg, val, 0xffff);
-}
-
-static void intel_hda_mmio_writel(void *opaque, hwaddr addr, uint32_t val)
-{
-    IntelHDAState *d = opaque;
-    const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
-
-    intel_hda_reg_write(d, reg, val, 0xffffffff);
-}
-
-static uint32_t intel_hda_mmio_readb(void *opaque, hwaddr addr)
-{
-    IntelHDAState *d = opaque;
-    const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
-
-    return intel_hda_reg_read(d, reg, 0xff);
-}
-
-static uint32_t intel_hda_mmio_readw(void *opaque, hwaddr addr)
-{
-    IntelHDAState *d = opaque;
-    const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
-
-    return intel_hda_reg_read(d, reg, 0xffff);
-}
-
-static uint32_t intel_hda_mmio_readl(void *opaque, hwaddr addr)
-{
-    IntelHDAState *d = opaque;
-    const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
-
-    return intel_hda_reg_read(d, reg, 0xffffffff);
+    return intel_hda_reg_read(d, reg, MAKE_64BIT_MASK(0, size * 8));
 }
 
 static const MemoryRegionOps intel_hda_mmio_ops = {
-    .old_mmio = {
-        .read = {
-            intel_hda_mmio_readb,
-            intel_hda_mmio_readw,
-            intel_hda_mmio_readl,
-        },
-        .write = {
-            intel_hda_mmio_writeb,
-            intel_hda_mmio_writew,
-            intel_hda_mmio_writel,
-        },
+    .read = intel_hda_mmio_read,
+    .write = intel_hda_mmio_write,
+    .impl = {
+        .min_access_size = 1,
+        .max_access_size = 4,
     },
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
-- 
2.9.3

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

* Re: [Qemu-devel] [PULL 0/2] Audio 20170918 patches
  2017-09-18 11:17 [Qemu-devel] [PULL 0/2] Audio 20170918 patches Gerd Hoffmann
  2017-09-18 11:17 ` [Qemu-devel] [PULL 1/2] wm8750: add record buffer underrun check Gerd Hoffmann
  2017-09-18 11:17 ` [Qemu-devel] [PULL 2/2] audio: intel-hda: do not use old_mmio accesses Gerd Hoffmann
@ 2017-09-18 12:19 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2017-09-18 12:19 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 18 September 2017 at 12:17, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit f75637badd76ae0f3bd51a128e1a2da0d2bb1d6b:
>
>   qemu.py: Fix syntax error (2017-09-18 11:32:22 +0100)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/audio-20170918-pull-request
>
> for you to fetch changes up to a6b0bdc8fb4ca57a4274205659bbe91d78c23f22:
>
>   audio: intel-hda: do not use old_mmio accesses (2017-09-18 13:13:32 +0200)
>
> ----------------------------------------------------------------
> audio: bugfixes for wm8750 and intel-hda.
>
> ----------------------------------------------------------------
>
> Gerd Hoffmann (1):
>   wm8750: add record buffer underrun check
>
> Matt Parker (1):
>   audio: intel-hda: do not use old_mmio accesses
>
>  hw/audio/intel-hda.c | 58 ++++++++++------------------------------------------
>  hw/audio/wm8750.c    |  6 +++++-
>  2 files changed, 16 insertions(+), 48 deletions(-)

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2017-09-18 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-18 11:17 [Qemu-devel] [PULL 0/2] Audio 20170918 patches Gerd Hoffmann
2017-09-18 11:17 ` [Qemu-devel] [PULL 1/2] wm8750: add record buffer underrun check Gerd Hoffmann
2017-09-18 11:17 ` [Qemu-devel] [PULL 2/2] audio: intel-hda: do not use old_mmio accesses Gerd Hoffmann
2017-09-18 12:19 ` [Qemu-devel] [PULL 0/2] Audio 20170918 patches Peter Maydell

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).