[alsa-devel] [PATCH 0/2] HD-audio HDMI regression fixes with VGA-switcheroo

2012-06-09 Thread Takashi Iwai
At Sat, 9 Jun 2012 08:57:20 +0100,
Dave Airlie wrote:
> 
> > Good to hear.
> > Dave, is it OK to apply the patch below through sound tree?
> 
> ack below,
> >
> >
> > thanks,
> >
> > Takashi
> >
> > ---
> > From: Takashi Iwai 
> > Subject: [PATCH] vga_switcheroo: Enable/disable audio clients at the right 
> > time
> >
> > The audio clients have to be disabled before disabling the VGA and
> > switching. ?Similarly, enabling the audio client should be done at
> > last. ?Otherwise the audio-side operation stalls, eventually leading
> > to Oops or lockups.
> >
> > Tested-by: J?rg-Volker Peetz 
> 
> Acked-by: Dave Airlie 

Thanks!


Takashi


[alsa-devel] [PATCH 0/2] HD-audio HDMI regression fixes with VGA-switcheroo

2012-06-09 Thread Dave Airlie
> Good to hear.
> Dave, is it OK to apply the patch below through sound tree?

ack below,
>
>
> thanks,
>
> Takashi
>
> ---
> From: Takashi Iwai 
> Subject: [PATCH] vga_switcheroo: Enable/disable audio clients at the right 
> time
>
> The audio clients have to be disabled before disabling the VGA and
> switching. ?Similarly, enabling the audio client should be done at
> last. ?Otherwise the audio-side operation stalls, eventually leading
> to Oops or lockups.
>
> Tested-by: J?rg-Volker Peetz 

Acked-by: Dave Airlie 

> Signed-off-by: Takashi Iwai 
> ---
> ?drivers/gpu/vga/vga_switcheroo.c | ? 14 --
> ?1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/vga/vga_switcheroo.c 
> b/drivers/gpu/vga/vga_switcheroo.c
> index 38f9534..e24ad99 100644
> --- a/drivers/gpu/vga/vga_switcheroo.c
> +++ b/drivers/gpu/vga/vga_switcheroo.c
> @@ -291,8 +291,6 @@ static int vga_switchto_stage1(struct 
> vga_switcheroo_client *new_client)
> ? ? ? ? ? ? ? ?vga_switchon(new_client);
>
> ? ? ? ?vga_set_default_device(new_client->pdev);
> - ? ? ? set_audio_state(new_client->id, VGA_SWITCHEROO_ON);
> -
> ? ? ? ?return 0;
> ?}
>
> @@ -308,6 +306,8 @@ static int vga_switchto_stage2(struct 
> vga_switcheroo_client *new_client)
>
> ? ? ? ?active->active = false;
>
> + ? ? ? set_audio_state(active->id, VGA_SWITCHEROO_OFF);
> +
> ? ? ? ?if (new_client->fb_info) {
> ? ? ? ? ? ? ? ?struct fb_event event;
> ? ? ? ? ? ? ? ?event.info = new_client->fb_info;
> @@ -321,11 +321,11 @@ static int vga_switchto_stage2(struct 
> vga_switcheroo_client *new_client)
> ? ? ? ?if (new_client->ops->reprobe)
> ? ? ? ? ? ? ? ?new_client->ops->reprobe(new_client->pdev);
>
> - ? ? ? set_audio_state(active->id, VGA_SWITCHEROO_OFF);
> -
> ? ? ? ?if (active->pwr_state == VGA_SWITCHEROO_ON)
> ? ? ? ? ? ? ? ?vga_switchoff(active);
>
> + ? ? ? set_audio_state(new_client->id, VGA_SWITCHEROO_ON);
> +
> ? ? ? ?new_client->active = true;
> ? ? ? ?return 0;
> ?}
> @@ -371,8 +371,9 @@ vga_switcheroo_debugfs_write(struct file *filp, const 
> char __user *ubuf,
> ? ? ? ?/* pwr off the device not in use */
> ? ? ? ?if (strncmp(usercmd, "OFF", 3) == 0) {
> ? ? ? ? ? ? ? ?list_for_each_entry(client, _priv.clients, list) {
> - ? ? ? ? ? ? ? ? ? ? ? if (client->active)
> + ? ? ? ? ? ? ? ? ? ? ? if (client->active || client_is_audio(client))
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?continue;
> + ? ? ? ? ? ? ? ? ? ? ? set_audio_state(client->id, VGA_SWITCHEROO_OFF);
> ? ? ? ? ? ? ? ? ? ? ? ?if (client->pwr_state == VGA_SWITCHEROO_ON)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?vga_switchoff(client);
> ? ? ? ? ? ? ? ?}
> @@ -381,10 +382,11 @@ vga_switcheroo_debugfs_write(struct file *filp, const 
> char __user *ubuf,
> ? ? ? ?/* pwr on the device not in use */
> ? ? ? ?if (strncmp(usercmd, "ON", 2) == 0) {
> ? ? ? ? ? ? ? ?list_for_each_entry(client, _priv.clients, list) {
> - ? ? ? ? ? ? ? ? ? ? ? if (client->active)
> + ? ? ? ? ? ? ? ? ? ? ? if (client->active || client_is_audio(client))
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?continue;
> ? ? ? ? ? ? ? ? ? ? ? ?if (client->pwr_state == VGA_SWITCHEROO_OFF)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?vga_switchon(client);
> + ? ? ? ? ? ? ? ? ? ? ? set_audio_state(client->id, VGA_SWITCHEROO_ON);
> ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ? ?goto out;
> ? ? ? ?}
> --
> 1.7.10.4
>
> ___
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


Re: [alsa-devel] [PATCH 0/2] HD-audio HDMI regression fixes with VGA-switcheroo

2012-06-09 Thread Dave Airlie
 Good to hear.
 Dave, is it OK to apply the patch below through sound tree?

ack below,


 thanks,

 Takashi

 ---
 From: Takashi Iwai ti...@suse.de
 Subject: [PATCH] vga_switcheroo: Enable/disable audio clients at the right 
 time

 The audio clients have to be disabled before disabling the VGA and
 switching.  Similarly, enabling the audio client should be done at
 last.  Otherwise the audio-side operation stalls, eventually leading
 to Oops or lockups.

 Tested-by: Jörg-Volker Peetz jvpe...@web.de

Acked-by: Dave Airlie airl...@redhat.com

 Signed-off-by: Takashi Iwai ti...@suse.de
 ---
  drivers/gpu/vga/vga_switcheroo.c |   14 --
  1 file changed, 8 insertions(+), 6 deletions(-)

 diff --git a/drivers/gpu/vga/vga_switcheroo.c 
 b/drivers/gpu/vga/vga_switcheroo.c
 index 38f9534..e24ad99 100644
 --- a/drivers/gpu/vga/vga_switcheroo.c
 +++ b/drivers/gpu/vga/vga_switcheroo.c
 @@ -291,8 +291,6 @@ static int vga_switchto_stage1(struct 
 vga_switcheroo_client *new_client)
                vga_switchon(new_client);

        vga_set_default_device(new_client-pdev);
 -       set_audio_state(new_client-id, VGA_SWITCHEROO_ON);
 -
        return 0;
  }

 @@ -308,6 +306,8 @@ static int vga_switchto_stage2(struct 
 vga_switcheroo_client *new_client)

        active-active = false;

 +       set_audio_state(active-id, VGA_SWITCHEROO_OFF);
 +
        if (new_client-fb_info) {
                struct fb_event event;
                event.info = new_client-fb_info;
 @@ -321,11 +321,11 @@ static int vga_switchto_stage2(struct 
 vga_switcheroo_client *new_client)
        if (new_client-ops-reprobe)
                new_client-ops-reprobe(new_client-pdev);

 -       set_audio_state(active-id, VGA_SWITCHEROO_OFF);
 -
        if (active-pwr_state == VGA_SWITCHEROO_ON)
                vga_switchoff(active);

 +       set_audio_state(new_client-id, VGA_SWITCHEROO_ON);
 +
        new_client-active = true;
        return 0;
  }
 @@ -371,8 +371,9 @@ vga_switcheroo_debugfs_write(struct file *filp, const 
 char __user *ubuf,
        /* pwr off the device not in use */
        if (strncmp(usercmd, OFF, 3) == 0) {
                list_for_each_entry(client, vgasr_priv.clients, list) {
 -                       if (client-active)
 +                       if (client-active || client_is_audio(client))
                                continue;
 +                       set_audio_state(client-id, VGA_SWITCHEROO_OFF);
                        if (client-pwr_state == VGA_SWITCHEROO_ON)
                                vga_switchoff(client);
                }
 @@ -381,10 +382,11 @@ vga_switcheroo_debugfs_write(struct file *filp, const 
 char __user *ubuf,
        /* pwr on the device not in use */
        if (strncmp(usercmd, ON, 2) == 0) {
                list_for_each_entry(client, vgasr_priv.clients, list) {
 -                       if (client-active)
 +                       if (client-active || client_is_audio(client))
                                continue;
                        if (client-pwr_state == VGA_SWITCHEROO_OFF)
                                vga_switchon(client);
 +                       set_audio_state(client-id, VGA_SWITCHEROO_ON);
                }
                goto out;
        }
 --
 1.7.10.4

 ___
 Alsa-devel mailing list
 alsa-de...@alsa-project.org
 http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [alsa-devel] [PATCH 0/2] HD-audio HDMI regression fixes with VGA-switcheroo

2012-06-09 Thread Takashi Iwai
At Sat, 9 Jun 2012 08:57:20 +0100,
Dave Airlie wrote:
 
  Good to hear.
  Dave, is it OK to apply the patch below through sound tree?
 
 ack below,
 
 
  thanks,
 
  Takashi
 
  ---
  From: Takashi Iwai ti...@suse.de
  Subject: [PATCH] vga_switcheroo: Enable/disable audio clients at the right 
  time
 
  The audio clients have to be disabled before disabling the VGA and
  switching.  Similarly, enabling the audio client should be done at
  last.  Otherwise the audio-side operation stalls, eventually leading
  to Oops or lockups.
 
  Tested-by: Jörg-Volker Peetz jvpe...@web.de
 
 Acked-by: Dave Airlie airl...@redhat.com

Thanks!


Takashi
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel