lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 9 Mar 2016 15:40:47 +0100
From:	Lukas Wunner <lukas@...ner.de>
To:	Dave Airlie <airlied@...il.com>
Cc:	dri-devel@...ts.freedesktop.org, linux-pm@...r.kernel.org,
	linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] nouveau: use new vga_switcheroo power domain.

Hi Dave,

On Wed, Mar 09, 2016 at 04:14:05PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@...hat.com>
> 
> This fixes GPU auto powerdown on the Lenovo W541,
> since we advertise Windows 2013 to the ACPI layer.
> 
> Signed-off-by: Dave Airlie <airlied@...hat.com>
> ---
>  drivers/gpu/drm/nouveau/nouveau_vga.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
> index af89c36..b987427f 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_vga.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
> @@ -101,8 +101,12 @@ nouveau_vga_init(struct nouveau_drm *drm)
>  		runtime = true;
>  	vga_switcheroo_register_client(dev->pdev, &nouveau_switcheroo_ops, runtime);
>  
> -	if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
> -		vga_switcheroo_init_domain_pm_ops(drm->dev->dev, &drm->vga_pm_domain);
> +	if (runtime) {
> +		if (nouveau_is_v1_dsm() && !nouveau_is_optimus())

The " && !nouveau_is_optimus()" can be dropped because a machine cannot
have both. Note the "else" in nouveau_dsm_detect():

        if (has_optimus == 1) { ...
                nouveau_dsm_priv.optimus_detected = true;
        } else if (vga_count == 2 && has_dsm && guid_valid) { ...
                nouveau_dsm_priv.dsm_detected = true;
        }

> +			vga_switcheroo_init_domain_pm_ops(drm->dev->dev, &drm->vga_pm_domain);
> +		else if (nouveau_is_optimus())
> +			vga_switcheroo_init_parent_pr3_ops(drm->dev->dev, &drm->vga_pm_domain);

You're calling this unconditionally for all Optimus machines yet
I assume pre Windows 10 machines lack the PR3 hooks.

Best regards,

Lukas

> +	}
>  }
>  
>  void
> @@ -117,7 +121,7 @@ nouveau_vga_fini(struct nouveau_drm *drm)
>  		runtime = true;
>  
>  	vga_switcheroo_unregister_client(dev->pdev);
> -	if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
> +	if (runtime && (nouveau_is_v1_dsm() || nouveau_is_optimus()))
>  		vga_switcheroo_fini_domain_pm_ops(drm->dev->dev);
>  	vga_client_register(dev->pdev, NULL, NULL, NULL);
>  }
> -- 
> 2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ