[Intel-gfx] [PATCH] drm/i915: Tell vga_switcheroo whether runtime PM is used

Imre Deak imre.deak at intel.com
Mon Feb 26 14:41:09 UTC 2018


On Sun, Feb 25, 2018 at 12:42:30AM +0100, Lukas Wunner wrote:
> DRM drivers need to tell vga_switcheroo whether they use runtime PM.
> If they do use it, vga_switcheroo lets them autosuspend at their own
> discretion.  If on the other hand they do not use it, vga_switcheroo
> allows the user to suspend and resume the GPU manually via the
> ->set_gpu_state hook.
> 
> i915 currently tells vga_switcheroo that it never uses runtime PM, even
> though it does use it on HSW and newer.  The result is that users may
> interfere with the driver's runtime PM on those platforms.  Avoid by
> reporting runtime PM support correctly to vga_switcheroo.
> 
> Cc: Imre Deak <imre.deak at intel.com>
> Signed-off-by: Lukas Wunner <lukas at wunner.de>

AFAICS this also needs calling vga_switcheroo_set_dynamic_switch() from
the i915 runtime suspend/resume handlers. Also after this we can remove
i915_switcheroo_set_state() ?

It's probably worth mentioning in the commit message that this changes
the semantics of the switching: while atm you can't open the the DRM
file for an inactive device (switched off from with IGD/DIS/DIGD/DDIS)
after this change you can. I suppose that's not a problem, it just means
display probing will fail on inactive devices (the same way it's with
MIGD/MDIS currently).

--Imre

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index aaa861b51024..519a1b9568df 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -668,7 +668,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
>  
>  	intel_register_dsm_handler();
>  
> -	ret = vga_switcheroo_register_client(pdev, &i915_switcheroo_ops, false);
> +	ret = vga_switcheroo_register_client(pdev, &i915_switcheroo_ops,
> +					     HAS_RUNTIME_PM(dev_priv));
>  	if (ret)
>  		goto cleanup_vga_client;
>  
> -- 
> 2.15.1
> 


More information about the Intel-gfx mailing list