Closed Bug 711333 Opened 8 years ago Closed 8 years ago

Race condition when moving and updating textures

Categories

(Firefox for Android :: General, defect, P4)

ARM
Android
defect

Tracking

()

RESOLVED FIXED
Firefox 12
Tracking Status
firefox11 --- fixed
fennec 11+ ---

People

(Reporter: pcwalton, Assigned: pcwalton)

References

Details

Attachments

(1 file)

It's possible for the following chain of events to occur:

(1) GeckoSoftwareLayerClient begins a transaction on the tile layer in beginDrawing().
(2) GSLC acquires the monitor on the layer controller in updateViewport(), which is called by endDrawing().
(3) GSLC moves the tile and the viewport around.
(4) GSLC releases the monitor.
(5) The GL rendering thread acquires the monitor on the layer controller.
(6) In the process of rendering a frame, the rendering thread tries to begin a transaction but fails and continues with the old image in the new position. Now the display is corrupt for one frame.
(7) GSLC ends the transaction.

This usually shows up as one of the flashes when navigating from page to page. It corrects itself after a frame or two but is quite unsightly. The solution should be for GSLC to always hold the monitor around the transaction. Will post a patch to this effect tomorrow.
Attached patch Proposed patch.Splinter Review
Proposed patch attached.
Assignee: nobody → pwalton
Status: NEW → ASSIGNED
Attachment #582497 - Flags: review?(bugmail.mozilla)
Comment on attachment 582497 [details] [diff] [review]
Proposed patch.

>diff --git a/widget/src/android/AndroidGraphicBuffer.cpp b/widget/src/android/AndroidGraphicBuffer.cpp
>   bool EnsureInitialized()
>   {
>     if (mInitialized) {
>       return true;
>     }
> 
>+    return false;
>+
>     void *handle = dlopen(ANDROID_EGL_PATH, RTLD_LAZY);

Testing code? r+ assuming this hunk was included accidentally.
Attachment #582497 - Flags: review?(bugmail.mozilla) → review+
(In reply to Kartikaya Gupta (:kats) from comment #2)
> Testing code? r+ assuming this hunk was included accidentally.

Actually, code needed to make my Droid X not crash (bug 711694), but good catch :)
Priority: -- → P4
https://hg.mozilla.org/mozilla-central/rev/d4c526ba5343
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
tracking-fennec: --- → 11+
Comment on attachment 582497 [details] [diff] [review]
Proposed patch.

[Triage Comment]
just moves synchronization further up the stack. Also this has baked on m-c for 20 days
Attachment #582497 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.