Remove the spin wait in Android gfxVRExternal PullState calls

RESOLVED FIXED in Firefox 63

Status

()

RESOLVED FIXED
6 months ago
6 months ago

People

(Reporter: imanol, Assigned: imanol)

Tracking

unspecified
mozilla63
Unspecified
Android
Points:
---

Firefox Tracking Flags

(firefox63 fixed)

Details

Attachments

(3 attachments)

(Assignee)

Description

6 months ago
gfxVRExternal is using spin wait on Android instead of condition variables to wait for some conditions. This drains the battery on Android, specially when the headset goes to sleep, or Android activity gets paused: WebVR thread is constantly waiting for an update.
(Assignee)

Comment 1

6 months ago
Created attachment 8992735 [details] [diff] [review]
Patch that gets rid of Android spin waits

This patch that gets rid Android spin waits and used condition variables instead. I added a optional lambda function to PullState method which makes the Pullstate method to wait for state changes until the lambda condition is satisfied (== returns true). This way we can reuse the smae wait algorithm from different places (e.g. waiting for enumaration and waiting for a SubmitFrame result)
Attachment #8992735 - Flags: review?(kgilbert)
Attachment #8992735 - Flags: checkin?(kgilbert)
Comment on attachment 8992735 [details] [diff] [review]
Patch that gets rid of Android spin waits

checkin will be requested once the patch has been reviewed. Setting the keyword 'checkin-needed' is preferred.
Attachment #8992735 - Flags: checkin?(kgilbert)
(Assignee)

Updated

6 months ago
Assignee: nobody → imanol
Status: NEW → ASSIGNED
(Assignee)

Comment 3

6 months ago
Created attachment 8992923 [details] [diff] [review]
spin_wait_patch_v2.diff

Implemented the changes that Kip requested
Attachment #8992923 - Flags: review?(kgilbert)
Comment on attachment 8992923 [details] [diff] [review]
spin_wait_patch_v2.diff

This LGTM, Thanks!
Attachment #8992923 - Flags: review?(kgilbert) → review+
Comment hidden (mozreview-request)

Comment 6

6 months ago
mozreview-review
Comment on attachment 8994537 [details]
Bug 1476380 - Remove the spin wait in Android gfxVRExternal PullState calls;

https://reviewboard.mozilla.org/r/259086/#review266148

LGTM, Thanks!
Attachment #8994537 - Flags: review?(kgilbert) → review+
(Assignee)

Updated

6 months ago
Keywords: checkin-needed

Comment 7

6 months ago
Pushed by kgilbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/30b7766e0f82
Remove the spin wait in Android gfxVRExternal PullState calls; r=kip
Keywords: checkin-needed

Comment 8

6 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/30b7766e0f82
Status: ASSIGNED → RESOLVED
Last Resolved: 6 months ago
status-firefox63: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Comment on attachment 8992735 [details] [diff] [review]
Patch that gets rid of Android spin waits

Clearing review request, as other patch was landed.
Attachment #8992735 - Flags: review?(kgilbert)
You need to log in before you can comment on or make changes to this bug.