Closed Bug 959171 Opened 10 years ago Closed 10 years ago

Fix how to bind EGLImage in GrallocTextureHostOGL

Categories

(Core :: Graphics: Layers, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: sotaro, Assigned: sotaro)

References

Details

Attachments

(1 file, 3 obsolete files)

+++ This bug was initially created as a clone of Bug #946720 +++

It is created from Bug 946720 Comment 24.
Attachment #8359232 - Flags: review?(nical.bugzilla)
Comment on attachment 8359232 [details] [diff] [review]
patch - Fix how to bind EGLImage in GrallocTextureHostOGL

Cancel to request reviewing. There seems still other cause of genlock failure.
Attachment #8359232 - Flags: review?(nical.bugzilla)
Blocks: 957323
Attachment #8359232 - Attachment is obsolete: true
Attachment #8361264 - Flags: review?(nical.bugzilla)
Comment on attachment 8361264 [details] [diff] [review]
patch v2 - Fix how to bind EGLImage in GrallocTextureHostOGL

Review of attachment 8361264 [details] [diff] [review]:
-----------------------------------------------------------------

I am not an EGL expert so if you have doubts you may want to ask for an additional reviewer, otherwise LGTM.

::: gfx/layers/opengl/GrallocTextureHost.cpp
@@ +174,5 @@
>    }
>  
>    if (!mNeedsReset) {
> +    // Update binding to the EGLImage
> +    gl()->MakeCurrent();

nit: I don't know if MakeCurrent can fail on b2g, but I have had to deal with it failing on Linux (mostly during shutdown). If so, you should probably do:

if (gl()->MakeCurrent()) {
  // do stuff
} else {
  // print the most scary warning you can think of
}
Attachment #8361264 - Flags: review?(nical.bugzilla) → review+
Assignee: nobody → sotaro.ikeda.g
Status: NEW → ASSIGNED
(In reply to Nicolas Silva [:nical] from comment #4)
> 
> nit: I don't know if MakeCurrent can fail on b2g, but I have had to deal
> with it failing on Linux (mostly during shutdown). If so, you should
> probably do:
> 
> if (gl()->MakeCurrent()) {
>   // do stuff
> } else {
>   // print the most scary warning you can think of
> }

I never saw gl()->MakeCurrent() failure on gonk. We can put off this until we saw it on gonk.
> 
> I am not an EGL expert so if you have doubts you may want to ask for an
> additional reviewer, otherwise LGTM.

This is an easy fix. Your review seems enough.
Committable patch. Carry 'r=nical'.
Attachment #8361264 - Attachment is obsolete: true
Attachment #8362744 - Flags: review+
Keywords: checkin-needed
Hmm, it's strange the patch hit the crash. The change might hit another bug.
I recognize the cause of the test crash.

During emulator test, there is a cases that compositor is not started yet even after test start.
At some point, Compositor is start to work. After that the compositor is set to TextureHost. In ImageHost::Composite() and then GrallocTextureSourceOGL::BindTexture() is called.

EGL Image is normally created at GrallocTextureSourceOGL::SetCompositableBackendSpecificData(). It is called when Texture swap. But at the time if Compositor is not present, EGLImage is not created. If it happens, GrallocTextureSourceOGL::BindTexture() does not have a EGLImage to bind.
It cause the crash.
Fix mochi test failure.
Attachment #8362744 - Attachment is obsolete: true
Attachment #8364557 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/38bb623379e8
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: