qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/5] audio patch queue
@ 2016-06-06  7:02 Gerd Hoffmann
  2016-06-06 12:21 ` Peter Maydell
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Hoffmann @ 2016-06-06  7:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

Here comes the audio patch queue with a fix for the pulseaudio volume
handling (adjust our stream not master) and some qomify and cleanup
work.

please pull,
  Gerd

The following changes since commit 2c107d7684f9e3c4db4780d0756bbf35b06aec07:

  Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2016-06-02 14:26:57 +0100)

are available in the git repository at:


  git://git.kraxel.org/qemu tags/pull-audio-20160606-1

for you to fetch changes up to 07b9098dfca4209ea1fca3cb26297164fcb4ae3c:

  hw/audio: QOM'ify milkymist-ac97.c (2016-06-03 11:13:38 +0200)

----------------------------------------------------------------
audio: pa volume fix, some qomifying.

----------------------------------------------------------------
Peter Krempa (1):
      audio: pa: Set volume of recording stream instead of recording device

xiaoqiang zhao (4):
      hw/audio: QOM'ify cs4231.c
      hw/audio: QOM cleanup for intel-hda
      hw/audio: QOM'ify intel-hda
      hw/audio: QOM'ify milkymist-ac97.c

 audio/paaudio.c           | 11 +++++------
 configure                 |  4 ++--
 hw/audio/cs4231.c         | 12 +++++-------
 hw/audio/intel-hda.c      | 32 ++++++++++++++++++--------------
 hw/audio/milkymist-ac97.c | 26 +++++++++++++++-----------
 5 files changed, 45 insertions(+), 40 deletions(-)

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

* Re: [Qemu-devel] [PULL 0/5] audio patch queue
  2016-06-06  7:02 Gerd Hoffmann
@ 2016-06-06 12:21 ` Peter Maydell
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2016-06-06 12:21 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 6 June 2016 at 08:02, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
> Here comes the audio patch queue with a fix for the pulseaudio volume
> handling (adjust our stream not master) and some qomify and cleanup
> work.
>
> please pull,
>   Gerd
>
> The following changes since commit 2c107d7684f9e3c4db4780d0756bbf35b06aec07:
>
>   Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2016-06-02 14:26:57 +0100)
>
> are available in the git repository at:
>
>
>   git://git.kraxel.org/qemu tags/pull-audio-20160606-1
>
> for you to fetch changes up to 07b9098dfca4209ea1fca3cb26297164fcb4ae3c:
>
>   hw/audio: QOM'ify milkymist-ac97.c (2016-06-03 11:13:38 +0200)
>
> ----------------------------------------------------------------
> audio: pa volume fix, some qomifying.
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 0/5] audio patch queue
@ 2017-01-11  9:33 Gerd Hoffmann
  2017-01-11  9:33 ` [Qemu-devel] [PULL 1/5] hw/audio: QOM'ify marvell_88w8618.c Gerd Hoffmann
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2017-01-11  9:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

Here comes the audio patch queue, with some fixes and cleanups.

please pull,
  Gerd

The following changes since commit b44486dfb9447c88e4b216e730adcc780190852c:

  Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20170110-1' into staging (2017-01-10 14:52:34 +0000)

are available in the git repository at:


  git://git.kraxel.org/qemu tags/pull-audio-20170111-1

for you to fetch changes up to 11f547e58a08ea71a8a92d3ffe1e210b4b0b709c:

  es1370: wire up reset via DeviceClass (2017-01-11 09:19:03 +0100)

----------------------------------------------------------------
audio: qomify drivers, hotplug fixes.

----------------------------------------------------------------
Gerd Hoffmann (1):
      es1370: wire up reset via DeviceClass

Li Qiang (2):
      audio: es1370: add exit function
      audio: ac97: add exit function

xiaoqiang zhao (2):
      hw/audio: QOM'ify marvell_88w8618.c
      hw/audio: QOM'ify pl041.c

 hw/audio/ac97.c            | 11 +++++++++++
 hw/audio/es1370.c          | 20 +++++++++++++++++---
 hw/audio/marvell_88w8618.c | 18 +++++++++++-------
 hw/audio/pl041.c           | 25 ++++++++++++++-----------
 4 files changed, 53 insertions(+), 21 deletions(-)

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

* [Qemu-devel] [PULL 1/5] hw/audio: QOM'ify marvell_88w8618.c
  2017-01-11  9:33 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
@ 2017-01-11  9:33 ` Gerd Hoffmann
  2017-01-11  9:33 ` [Qemu-devel] [PULL 2/5] hw/audio: QOM'ify pl041.c Gerd Hoffmann
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2017-01-11  9:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: xiaoqiang zhao, Gerd Hoffmann

From: xiaoqiang zhao <zxq_yx_007@163.com>

split the old SysBus init function into an instance_init
and Device realize function

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
Message-id: 20161231011720.3965-2-zxq_yx_007@163.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/audio/marvell_88w8618.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c
index a6ca180..511b004 100644
--- a/hw/audio/marvell_88w8618.c
+++ b/hw/audio/marvell_88w8618.c
@@ -241,19 +241,23 @@ static const MemoryRegionOps mv88w8618_audio_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
-static int mv88w8618_audio_init(SysBusDevice *dev)
+static void mv88w8618_audio_init(Object *obj)
 {
+    SysBusDevice *dev = SYS_BUS_DEVICE(obj);
     mv88w8618_audio_state *s = MV88W8618_AUDIO(dev);
 
     sysbus_init_irq(dev, &s->irq);
 
-    wm8750_data_req_set(s->wm, mv88w8618_audio_callback, s);
-
-    memory_region_init_io(&s->iomem, OBJECT(s), &mv88w8618_audio_ops, s,
+    memory_region_init_io(&s->iomem, obj, &mv88w8618_audio_ops, s,
                           "audio", MP_AUDIO_SIZE);
     sysbus_init_mmio(dev, &s->iomem);
+}
 
-    return 0;
+static void mv88w8618_audio_realize(DeviceState *dev, Error **errp)
+{
+    mv88w8618_audio_state *s = MV88W8618_AUDIO(dev);
+
+    wm8750_data_req_set(s->wm, mv88w8618_audio_callback, s);
 }
 
 static const VMStateDescription mv88w8618_audio_vmsd = {
@@ -282,9 +286,8 @@ static Property mv88w8618_audio_properties[] = {
 static void mv88w8618_audio_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = mv88w8618_audio_init;
+    dc->realize = mv88w8618_audio_realize;
     dc->reset = mv88w8618_audio_reset;
     dc->vmsd = &mv88w8618_audio_vmsd;
     dc->props = mv88w8618_audio_properties;
@@ -296,6 +299,7 @@ static const TypeInfo mv88w8618_audio_info = {
     .name          = TYPE_MV88W8618_AUDIO,
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(mv88w8618_audio_state),
+    .instance_init = mv88w8618_audio_init,
     .class_init    = mv88w8618_audio_class_init,
 };
 
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 2/5] hw/audio: QOM'ify pl041.c
  2017-01-11  9:33 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
  2017-01-11  9:33 ` [Qemu-devel] [PULL 1/5] hw/audio: QOM'ify marvell_88w8618.c Gerd Hoffmann
@ 2017-01-11  9:33 ` Gerd Hoffmann
  2017-01-11  9:33 ` [Qemu-devel] [PULL 3/5] audio: es1370: add exit function Gerd Hoffmann
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2017-01-11  9:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: xiaoqiang zhao, Gerd Hoffmann

From: xiaoqiang zhao <zxq_yx_007@163.com>

split the old SysBus init function into an instance_init
and Device realize function

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
Message-id: 20161231011720.3965-3-zxq_yx_007@163.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/audio/pl041.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c
index 6e9c104..c8cc503 100644
--- a/hw/audio/pl041.c
+++ b/hw/audio/pl041.c
@@ -521,12 +521,23 @@ static const MemoryRegionOps pl041_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
-static int pl041_init(SysBusDevice *dev)
+static void pl041_init(Object *obj)
 {
+    SysBusDevice *dev = SYS_BUS_DEVICE(obj);
     PL041State *s = PL041(dev);
 
     DBG_L1("pl041_init 0x%08x\n", (uint32_t)s);
 
+    /* Connect the device to the sysbus */
+    memory_region_init_io(&s->iomem, obj, &pl041_ops, s, "pl041", 0x1000);
+    sysbus_init_mmio(dev, &s->iomem);
+    sysbus_init_irq(dev, &s->irq);
+}
+
+static void pl041_realize(DeviceState *dev, Error **errp)
+{
+    PL041State *s = PL041(dev);
+
     /* Check the device properties */
     switch (s->fifo_depth) {
     case 8:
@@ -545,18 +556,10 @@ static int pl041_init(SysBusDevice *dev)
         qemu_log_mask(LOG_UNIMP,
                       "pl041: unsupported non-compact fifo depth [%i]\n",
                       s->fifo_depth);
-        return -1;
     }
 
-    /* Connect the device to the sysbus */
-    memory_region_init_io(&s->iomem, OBJECT(s), &pl041_ops, s, "pl041", 0x1000);
-    sysbus_init_mmio(dev, &s->iomem);
-    sysbus_init_irq(dev, &s->irq);
-
     /* Init the codec */
     lm4549_init(&s->codec, &pl041_request_data, (void *)s);
-
-    return 0;
 }
 
 static const VMStateDescription vmstate_pl041_regfile = {
@@ -627,9 +630,8 @@ static Property pl041_device_properties[] = {
 static void pl041_device_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = pl041_init;
+    dc->realize = pl041_realize;
     set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
     dc->reset = pl041_device_reset;
     dc->vmsd = &vmstate_pl041;
@@ -640,6 +642,7 @@ static const TypeInfo pl041_device_info = {
     .name          = TYPE_PL041,
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(PL041State),
+    .instance_init = pl041_init,
     .class_init    = pl041_device_class_init,
 };
 
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 3/5] audio: es1370: add exit function
  2017-01-11  9:33 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
  2017-01-11  9:33 ` [Qemu-devel] [PULL 1/5] hw/audio: QOM'ify marvell_88w8618.c Gerd Hoffmann
  2017-01-11  9:33 ` [Qemu-devel] [PULL 2/5] hw/audio: QOM'ify pl041.c Gerd Hoffmann
@ 2017-01-11  9:33 ` Gerd Hoffmann
  2017-01-11  9:33 ` [Qemu-devel] [PULL 4/5] audio: ac97: " Gerd Hoffmann
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2017-01-11  9:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: Li Qiang, Gerd Hoffmann

From: Li Qiang <liqiang6-s@360.cn>

Currently the es1370 device emulation doesn't have a exit function,
hot unplug this device will leak some memory. Add a exit function to
avoid this.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 585200c9.a968ca0a.1ab80.4c98@mx.google.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/audio/es1370.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 8449b5f..883ec69 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -1041,6 +1041,19 @@ static void es1370_realize(PCIDevice *dev, Error **errp)
     es1370_reset (s);
 }
 
+static void es1370_exit(PCIDevice *dev)
+{
+    ES1370State *s = ES1370(dev);
+    int i;
+
+    for (i = 0; i < 2; ++i) {
+        AUD_close_out(&s->card, s->dac_voice[i]);
+    }
+
+    AUD_close_in(&s->card, s->adc_voice);
+    AUD_remove_card(&s->card);
+}
+
 static int es1370_init (PCIBus *bus)
 {
     pci_create_simple (bus, -1, TYPE_ES1370);
@@ -1053,6 +1066,7 @@ static void es1370_class_init (ObjectClass *klass, void *data)
     PCIDeviceClass *k = PCI_DEVICE_CLASS (klass);
 
     k->realize = es1370_realize;
+    k->exit = es1370_exit;
     k->vendor_id = PCI_VENDOR_ID_ENSONIQ;
     k->device_id = PCI_DEVICE_ID_ENSONIQ_ES1370;
     k->class_id = PCI_CLASS_MULTIMEDIA_AUDIO;
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 4/5] audio: ac97: add exit function
  2017-01-11  9:33 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2017-01-11  9:33 ` [Qemu-devel] [PULL 3/5] audio: es1370: add exit function Gerd Hoffmann
@ 2017-01-11  9:33 ` Gerd Hoffmann
  2017-01-11  9:33 ` [Qemu-devel] [PULL 5/5] es1370: wire up reset via DeviceClass Gerd Hoffmann
  2017-01-12 17:51 ` [Qemu-devel] [PULL 0/5] audio patch queue Peter Maydell
  5 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2017-01-11  9:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: Li Qiang, Gerd Hoffmann

From: Li Qiang <liqiang6-s@360.cn>

Currently the ac97 device emulation doesn't have a exit function,
hot unplug this device will leak some memory. Add a exit function to
avoid this.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 58520052.4825ed0a.27a71.6cae@mx.google.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/audio/ac97.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index cbd959e..c306575 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -1387,6 +1387,16 @@ static void ac97_realize(PCIDevice *dev, Error **errp)
     ac97_on_reset (&s->dev.qdev);
 }
 
+static void ac97_exit(PCIDevice *dev)
+{
+    AC97LinkState *s = DO_UPCAST(AC97LinkState, dev, dev);
+
+    AUD_close_in(&s->card, s->voice_pi);
+    AUD_close_out(&s->card, s->voice_po);
+    AUD_close_in(&s->card, s->voice_mc);
+    AUD_remove_card(&s->card);
+}
+
 static int ac97_init (PCIBus *bus)
 {
     pci_create_simple (bus, -1, "AC97");
@@ -1404,6 +1414,7 @@ static void ac97_class_init (ObjectClass *klass, void *data)
     PCIDeviceClass *k = PCI_DEVICE_CLASS (klass);
 
     k->realize = ac97_realize;
+    k->exit = ac97_exit;
     k->vendor_id = PCI_VENDOR_ID_INTEL;
     k->device_id = PCI_DEVICE_ID_INTEL_82801AA_5;
     k->revision = 0x01;
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 5/5] es1370: wire up reset via DeviceClass
  2017-01-11  9:33 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2017-01-11  9:33 ` [Qemu-devel] [PULL 4/5] audio: ac97: " Gerd Hoffmann
@ 2017-01-11  9:33 ` Gerd Hoffmann
  2017-01-12 17:51 ` [Qemu-devel] [PULL 0/5] audio patch queue Peter Maydell
  5 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2017-01-11  9:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Instead of using qemu_register_reset().
That way we get proper cleanup for free.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1484054281-26139-1-git-send-email-kraxel@redhat.com
---
 hw/audio/es1370.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 883ec69..fe64c1a 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -1010,9 +1010,9 @@ static const VMStateDescription vmstate_es1370 = {
     }
 };
 
-static void es1370_on_reset (void *opaque)
+static void es1370_on_reset(DeviceState *dev)
 {
-    ES1370State *s = opaque;
+    ES1370State *s = container_of(dev, ES1370State, dev.qdev);
     es1370_reset (s);
 }
 
@@ -1035,7 +1035,6 @@ static void es1370_realize(PCIDevice *dev, Error **errp)
 
     memory_region_init_io (&s->io, OBJECT(s), &es1370_io_ops, s, "es1370", 256);
     pci_register_bar (&s->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io);
-    qemu_register_reset (es1370_on_reset, s);
 
     AUD_register_card ("es1370", &s->card);
     es1370_reset (s);
@@ -1075,6 +1074,7 @@ static void es1370_class_init (ObjectClass *klass, void *data)
     set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
     dc->desc = "ENSONIQ AudioPCI ES1370";
     dc->vmsd = &vmstate_es1370;
+    dc->reset = es1370_on_reset;
 }
 
 static const TypeInfo es1370_info = {
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL 0/5] audio patch queue
  2017-01-11  9:33 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2017-01-11  9:33 ` [Qemu-devel] [PULL 5/5] es1370: wire up reset via DeviceClass Gerd Hoffmann
@ 2017-01-12 17:51 ` Peter Maydell
  5 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2017-01-12 17:51 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 11 January 2017 at 09:33, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
> Here comes the audio patch queue, with some fixes and cleanups.
>
> please pull,
>   Gerd
>
> The following changes since commit b44486dfb9447c88e4b216e730adcc780190852c:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20170110-1' into staging (2017-01-10 14:52:34 +0000)
>
> are available in the git repository at:
>
>
>   git://git.kraxel.org/qemu tags/pull-audio-20170111-1
>
> for you to fetch changes up to 11f547e58a08ea71a8a92d3ffe1e210b4b0b709c:
>
>   es1370: wire up reset via DeviceClass (2017-01-11 09:19:03 +0100)
>
> ----------------------------------------------------------------
> audio: qomify drivers, hotplug fixes.

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2017-01-12 17:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-11  9:33 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
2017-01-11  9:33 ` [Qemu-devel] [PULL 1/5] hw/audio: QOM'ify marvell_88w8618.c Gerd Hoffmann
2017-01-11  9:33 ` [Qemu-devel] [PULL 2/5] hw/audio: QOM'ify pl041.c Gerd Hoffmann
2017-01-11  9:33 ` [Qemu-devel] [PULL 3/5] audio: es1370: add exit function Gerd Hoffmann
2017-01-11  9:33 ` [Qemu-devel] [PULL 4/5] audio: ac97: " Gerd Hoffmann
2017-01-11  9:33 ` [Qemu-devel] [PULL 5/5] es1370: wire up reset via DeviceClass Gerd Hoffmann
2017-01-12 17:51 ` [Qemu-devel] [PULL 0/5] audio patch queue Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2016-06-06  7:02 Gerd Hoffmann
2016-06-06 12:21 ` 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).