[Intel-gfx] [PATCH] drm/i915: Tell vga_switcheroo whether runtime PM is used
Lukas Wunner
lukas at wunner.de
Sat Feb 24 23:42:30 UTC 2018
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>
---
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