[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 09/27] virtio-snd: Add code for set config function
From: |
Gerd Hoffmann |
Subject: |
Re: [RFC PATCH 09/27] virtio-snd: Add code for set config function |
Date: |
Fri, 30 Apr 2021 11:55:10 +0200 |
On Thu, Apr 29, 2021 at 05:34:27PM +0530, Shreyansh Chouhan wrote:
> Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
> ---
> hw/audio/virtio-snd.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c
> index afa38adee7..edaeffd6b7 100644
> --- a/hw/audio/virtio-snd.c
> +++ b/hw/audio/virtio-snd.c
> @@ -54,6 +54,14 @@ static void virtio_snd_get_config(VirtIODevice *vdev,
> uint8_t *config)
>
> static void virtio_snd_set_config(VirtIODevice *vdev, const uint8_t *config)
> {
> + VirtIOSound *s = VIRTIO_SOUND(vdev);
> + virtio_snd_config sndcfg;
> +
> + memcpy(&sndcfg, config, sizeof(virtio_snd_config));
> +
> + memcpy(&s->snd_conf.jacks, &sndcfg.jacks, sizeof(uint32_t));
> + memcpy(&s->snd_conf.streams, &sndcfg.streams, sizeof(uint32_t));
> + memcpy(&s->snd_conf.chmaps, &sndcfg.streams, sizeof(uint32_t));
This is static device information for the driver, the driver should not
be able to change those. I think you can simply leave the set_config
empty (i.e. just drop this patch).
take care,
Gerd
- [RFC PATCH 01/27] virtio-snd: Add virtio sound header file, (continued)
- [RFC PATCH 01/27] virtio-snd: Add virtio sound header file, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 02/27] virtio-snd: Add jack control structures, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 04/27] virtio-snd: Add chmap control structures, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 03/27] virtio-snd: Add PCM control structures, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 05/27] virtio-snd: Add device implementation structures, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 06/27] virtio-snd: Add PCI wrapper code for VirtIOSound, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 07/27] virtio-snd: Add properties for class init, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 08/27] virtio-snd: Add code for get config function, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 09/27] virtio-snd: Add code for set config function, Shreyansh Chouhan, 2021/04/29
- Re: [RFC PATCH 09/27] virtio-snd: Add code for set config function,
Gerd Hoffmann <=
- [RFC PATCH 10/27] virtio-snd: Add code for the realize function, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 12/27] virtio-snd: Add control virtqueue handler, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 11/27] virtio-snd: Add macros for logging, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 13/27] virtio-snd: Add VIRTIO_SND_R_JACK_INFO handler, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 15/27] virtio-snd: Add VIRTIO_SND_R_PCM_INFO handler, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 14/27] virtio-snd: Add stub for VIRTIO_SND_R_JACK_REMAP handler, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 18/27] virtio-snd: Add default configs to realize fn, Shreyansh Chouhan, 2021/04/29