Last Comment Bug 698212 - Uninitialized video memory with 10.6 Integrated GPU on certain pages
: Uninitialized video memory with 10.6 Integrated GPU on certain pages
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla10
Assigned To: Matt Woodrow (:mattwoodrow)
:
Mentors:
Depends on:
Blocks: 695275
  Show dependency treegraph
 
Reported: 2011-10-29 10:20 PDT by Benoit Girard (:BenWa)
Modified: 2011-11-05 14:21 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
screenshot (915.71 KB, image/png)
2011-10-29 10:20 PDT, Benoit Girard (:BenWa)
no flags Details
Reduce test case (19.50 KB, application/x-tar)
2011-10-31 08:42 PDT, Benoit Girard (:BenWa)
no flags Details
Initialize textures to blue (1.65 KB, patch)
2011-10-31 14:01 PDT, Matt Woodrow (:mattwoodrow)
no flags Details | Diff | Splinter Review
Let UploadSurfaceToTexture create the texture (942 bytes, patch)
2011-10-31 14:03 PDT, Matt Woodrow (:mattwoodrow)
bgirard: review+
Details | Diff | Splinter Review

Description Benoit Girard (:BenWa) 2011-10-29 10:20:15 PDT
Created attachment 570490 [details]
screenshot

STR:
1) Use recent nightly
2) Go to: http://www.dinodday.com/?page_id=6
3) Click on a screenshot

When the screenshot the white area is expending you can see uninitialized video memory before the screenshot loads. It seems like it might be general memory.
Comment 1 Benoit Girard (:BenWa) 2011-10-29 10:30:02 PDT
The bug only happens when I'm on integrated on nightly. It doesn't happen on Aurora/Firefox when I force Integrated. The bug does not happen when forcing Discrete on nightly. Tested on 10.6.8.
Comment 2 Benoit Girard (:BenWa) 2011-10-31 08:42:15 PDT
Created attachment 570722 [details]
Reduce test case

This test case is a bit reduced but it needs to be reduced further. Obfuscated jquery code is making this difficult.
Comment 3 Benoit Girard (:BenWa) 2011-10-31 10:51:20 PDT
Regression started after this push:
https://hg.mozilla.org/integration/mozilla-inbound/log/d7f3bfc7cd46

Matt, with some patches that Jeff and I landed the integrated GPU will be used by default on dual GPU macbook pros (except for WebGL, non flash/quicktime plugins). This bug is worth fixing.
Comment 4 Benoit Girard (:BenWa) 2011-10-31 10:54:02 PDT
I should note that the artifacts are happening when the image is fading in. This points to a problem with alpha channels.
Comment 5 Matt Woodrow (:mattwoodrow) 2011-10-31 14:01:02 PDT
Created attachment 570837 [details] [diff] [review]
Initialize textures to blue

Debugging patch that initializes all ImageLayerOGL textures to solid blue to determine the source of uninitialized memory.

This gives us blue instead of uninitialized memory, so the problem is definitely that we're not uploading to the full area of the texture. I really can't see how this is possible since we pass the same size to InitTexture as we do to UploadSurfaceToTexture.

Interestingly enabling MOZ_GL_DEBUG fixes the problem, which suggests some sort of synchronization issues (since it calls glFinish with every normal GL command), I can't see anything we're doing here (uploading textures) that would be asynchronous though.
Comment 6 Matt Woodrow (:mattwoodrow) 2011-10-31 14:03:51 PDT
Created attachment 570838 [details] [diff] [review]
Let UploadSurfaceToTexture create the texture

Instead of calling InitTexture, we can just let UploadSurfaceToTexture create the texture (and do the upload via glTexImage2D, not glTexSubImage2D).

This fixes the bug, but doesn't get us any closer to figuring out what was actually wrong before.

I'm not particularly happy with wallpapering over this bug, but it might be worth doing this in the meantime.

Suggestions appreciated.
Comment 7 Matt Woodrow (:mattwoodrow) 2011-11-01 18:59:57 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/26d38dea2c7c
Comment 8 Ed Morley [:emorley] 2011-11-02 06:31:37 PDT
https://hg.mozilla.org/mozilla-central/rev/26d38dea2c7c
Comment 9 Benoit Jacob [:bjacob] (mostly away) 2011-11-05 14:21:26 PDT
So was this a Apple OpenGL bug? Or our bug?

Note You need to log in before you can comment on or make changes to this bug.