Closed Bug 1562812 Opened 5 years ago Closed 5 years ago

For powerPreference:Default, only keep dGPU active for consistently active contexts

Categories

(Core :: Graphics: CanvasWebGL, enhancement, P1)

Unspecified
macOS
enhancement

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
relnote-firefox --- 69+
firefox69 --- fixed

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.

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)

See Also: → 1561073
Pushed by jgilbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6d492faea9ec For powerPreference:Default, only keep dGPU active for consistently active contexts. r=lsalzman
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69

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.

relnote-firefox: --- → ?

Added to the Fx69 Beta release notes.

See Also: → 1339215
Regressions: 1579984
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: