qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/audio: Fix logic error in hda audio
@ 2023-11-16  7:50 zhouyang23 via
  2023-11-16 13:18 ` Philippe Mathieu-Daudé
  2023-11-20  8:16 ` Marc-André Lureau
  0 siblings, 2 replies; 3+ messages in thread
From: zhouyang23 via @ 2023-11-16  7:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel, zhouyang23

Commit b7639b7dd0 introduced a logic error about mixer and nomixer.
Cause use micro_mixemu when there is no mixer in HDAAudioState, but
use micro_nomixemu wehen there has a mixer in HDAAuditState.

Signed-off-by: zhouyang23 <zhouyang23@xiaomi.com>
---
 hw/audio/hda-codec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index b9ad1f4c39..87bacb3bee 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -857,7 +857,7 @@ static void hda_audio_init_output(HDACodecDevice *hda, Error **errp)
     HDAAudioState *a = HDA_AUDIO(hda);
     const struct desc_codec *desc = &output_nomixemu;
 
-    if (!a->mixer) {
+    if (a->mixer) {
         desc = &output_mixemu;
     }
 
@@ -869,7 +869,7 @@ static void hda_audio_init_duplex(HDACodecDevice *hda, Error **errp)
     HDAAudioState *a = HDA_AUDIO(hda);
     const struct desc_codec *desc = &duplex_nomixemu;
 
-    if (!a->mixer) {
+    if (a->mixer) {
         desc = &duplex_mixemu;
     }
 
@@ -881,7 +881,7 @@ static void hda_audio_init_micro(HDACodecDevice *hda, Error **errp)
     HDAAudioState *a = HDA_AUDIO(hda);
     const struct desc_codec *desc = &micro_nomixemu;
 
-    if (!a->mixer) {
+    if (a->mixer) {
         desc = &micro_mixemu;
     }
 
-- 
2.34.1



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

* Re: [PATCH] hw/audio: Fix logic error in hda audio
  2023-11-16  7:50 [PATCH] hw/audio: Fix logic error in hda audio zhouyang23 via
@ 2023-11-16 13:18 ` Philippe Mathieu-Daudé
  2023-11-20  8:16 ` Marc-André Lureau
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-11-16 13:18 UTC (permalink / raw)
  To: zhouyang23, qemu-devel
  Cc: kraxel, Volker Rümelin, Marc-André Lureau

On 16/11/23 08:50, zhouyang23 via wrote:
> Commit b7639b7dd0 introduced a logic error about mixer and nomixer.
> Cause use micro_mixemu when there is no mixer in HDAAudioState, but
> use micro_nomixemu wehen there has a mixer in HDAAuditState.

Cc'ing Marc-André and Volker for
https://lore.kernel.org/qemu-devel/20231105172552.8405-2-vr_qemu@t-online.de/

> Signed-off-by: zhouyang23 <zhouyang23@xiaomi.com>
> ---
>   hw/audio/hda-codec.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
> index b9ad1f4c39..87bacb3bee 100644
> --- a/hw/audio/hda-codec.c
> +++ b/hw/audio/hda-codec.c
> @@ -857,7 +857,7 @@ static void hda_audio_init_output(HDACodecDevice *hda, Error **errp)
>       HDAAudioState *a = HDA_AUDIO(hda);
>       const struct desc_codec *desc = &output_nomixemu;
>   
> -    if (!a->mixer) {
> +    if (a->mixer) {
>           desc = &output_mixemu;
>       }
>   
> @@ -869,7 +869,7 @@ static void hda_audio_init_duplex(HDACodecDevice *hda, Error **errp)
>       HDAAudioState *a = HDA_AUDIO(hda);
>       const struct desc_codec *desc = &duplex_nomixemu;
>   
> -    if (!a->mixer) {
> +    if (a->mixer) {
>           desc = &duplex_mixemu;
>       }
>   
> @@ -881,7 +881,7 @@ static void hda_audio_init_micro(HDACodecDevice *hda, Error **errp)
>       HDAAudioState *a = HDA_AUDIO(hda);
>       const struct desc_codec *desc = &micro_nomixemu;
>   
> -    if (!a->mixer) {
> +    if (a->mixer) {
>           desc = &micro_mixemu;
>       }
>   



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

* Re: [PATCH] hw/audio: Fix logic error in hda audio
  2023-11-16  7:50 [PATCH] hw/audio: Fix logic error in hda audio zhouyang23 via
  2023-11-16 13:18 ` Philippe Mathieu-Daudé
@ 2023-11-20  8:16 ` Marc-André Lureau
  1 sibling, 0 replies; 3+ messages in thread
From: Marc-André Lureau @ 2023-11-20  8:16 UTC (permalink / raw)
  To: zhouyang23; +Cc: qemu-devel, kraxel

On Thu, Nov 16, 2023 at 1:48 PM zhouyang23 via <qemu-devel@nongnu.org> wrote:
>
> Commit b7639b7dd0 introduced a logic error about mixer and nomixer.
> Cause use micro_mixemu when there is no mixer in HDAAudioState, but
> use micro_nomixemu wehen there has a mixer in HDAAuditState.
>
> Signed-off-by: zhouyang23 <zhouyang23@xiaomi.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  hw/audio/hda-codec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
> index b9ad1f4c39..87bacb3bee 100644
> --- a/hw/audio/hda-codec.c
> +++ b/hw/audio/hda-codec.c
> @@ -857,7 +857,7 @@ static void hda_audio_init_output(HDACodecDevice *hda, Error **errp)
>      HDAAudioState *a = HDA_AUDIO(hda);
>      const struct desc_codec *desc = &output_nomixemu;
>
> -    if (!a->mixer) {
> +    if (a->mixer) {
>          desc = &output_mixemu;
>      }
>
> @@ -869,7 +869,7 @@ static void hda_audio_init_duplex(HDACodecDevice *hda, Error **errp)
>      HDAAudioState *a = HDA_AUDIO(hda);
>      const struct desc_codec *desc = &duplex_nomixemu;
>
> -    if (!a->mixer) {
> +    if (a->mixer) {
>          desc = &duplex_mixemu;
>      }
>
> @@ -881,7 +881,7 @@ static void hda_audio_init_micro(HDACodecDevice *hda, Error **errp)
>      HDAAudioState *a = HDA_AUDIO(hda);
>      const struct desc_codec *desc = &micro_nomixemu;
>
> -    if (!a->mixer) {
> +    if (a->mixer) {
>          desc = &micro_mixemu;
>      }
>
> --
> 2.34.1
>
>


-- 
Marc-André Lureau


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

end of thread, other threads:[~2023-11-20  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-16  7:50 [PATCH] hw/audio: Fix logic error in hda audio zhouyang23 via
2023-11-16 13:18 ` Philippe Mathieu-Daudé
2023-11-20  8:16 ` 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).