For powerPreference:Default, only keep dGPU active for consistently active contexts
Categories
(Core :: Graphics: CanvasWebGL, enhancement, P1)
Tracking
()
People
(Reporter: jgilbert, Assigned: jgilbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Also, don't switch to dGPU immediately.
My current thinking:
PowerPreference::LowPower should never request dGPU.
::HighPerformance should always get the dGPU. (You asked for it!!)
::Default is trickier!
We don't want ::Default contexts keeping the dGPU alive when they're not/barely using it.
However, we need old/powerPreference-unaware content to run as fast as it used to. (benchmarks, games, etc)
Additionally, it would be nice to not switch to dGPU immediately for ::Default contexts, since some (many) of them are one-offs. (but we want to activate the dGPU for steady-state content!)
So! On ::Default context creation, we have a grace period where we don't yet active the dGPU. After this grace period, if the context is still active, activate the dGPU. If the context falls dormant, drop our reference to the dGPU to (try to) switch back to iGPU.
Additionally, I was struck by this recently:
- Leaving the dGPU active is likely battery-draining
- The vast majority of current WebGL content, trackers, and ads don't express a powerPreference
- We have reports from a ton of particularly macOS users of high battery drain
Hmm.
This would be a great thing to get Telemetry on, but it's also something we should probably stem the bleeding on ASAP.
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
This patch reverts bug 1561073, since this patch should improve the false-positive rate from heuristic in 1561073. (1561073 might cause not give the dGPU to content which creates a webgl context before attaching the canvas to the DOM)
Comment 4•5 years ago
|
||
bugherder |
Assignee | ||
Comment 5•5 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: macOS users on dual-graphics-card machines (like MacBook Pro) will switch back to the low-power GPU more aggressively, saving battery life.
[Affects Firefox for Android]: no
[Suggested wording]: macOS users with dual-graphics-card machines (like MacBook Pro) will switch WebGL content back to the more power-efficient GPU more aggressively, saving battery life. Firefox will also no longer spin-up the high-power GPU by default for one-off transient uses of WebGL.
[Links (documentation, blog post, etc)]: none
I don't know if we mention preferences in these, but if so:
There's also a new preference (webgl.default-low-power) available for users who want to keep most WebGL content on the more power-efficient GPU.
Description
•