[Intel-gfx] [PATCH] drm/i915: Tell vga_switcheroo whether runtime PM is used
Lukas Wunner
lukas at wunner.de
Mon Feb 26 15:57:11 UTC 2018
On Mon, Feb 26, 2018 at 04:41:09PM +0200, Imre Deak wrote:
> 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.
I've posted a series a week ago which removes that call and haven't seen
any major objections. Assuming that series goes into 4.17, there's no
point in adding calls to vga_switcheroo_set_dynamic_switch() now:
https://lists.freedesktop.org/archives/nouveau/2018-February/029851.html
If you have an Optimus/ATPX machine handy, please consider testing the
series.
> Also after this we can remove i915_switcheroo_set_state() ?
Not yet. That's still needed for manual power control on chips
where you're not supporting runtime PM yet and which are known to
be built into hybrid graphics laptops. (On the MacBook Pro, that's
ILK, SNB, IVB, can't speak for non-Macs.)
Manual power control was a stopgap according to Dave Airlie that
he implemented before he got runtime PM up and running:
http://lkml.iu.edu/hypermail/linux/kernel/1603.1/01935.html
It will be removed eventually, but right now it can't because runtime PM
on i915 doesn't yet cover all platforms and isn't yet working on muxed
laptops such as the MacBook Pro. (I'm working on fixing the latter,
the series I've linked above gets us one step closer.)
> 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).
Sorry, I don't understand the last sentence in that paragraph at all.
Thanks,
Lukas
More information about the Intel-gfx
mailing list