Closed Bug 1684194 Opened 5 years ago Closed 4 years ago

Use RenderCompositorEGL on X11/EGL

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: sotaro, Assigned: stransky)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

With WebRender, video rendering could be disabled simply by removing async image pipeline.

Blocks: 1682206

From Bug 1682206 Comment 10 , it seems better to disable video rendering in graphics area.

Assignee: nobody → sotaro.ikeda.g

Hej Sotaro, any news on this? IIUC this blocks bug 1682471 ?

Flags: needinfo?(sotaro.ikeda.g)

(In reply to Robert Mader [:rmader] from comment #4)

Hej Sotaro, any news on this? IIUC this blocks bug 1682471 ?

Sorry, I am going to work for it next week. It could be one workaround of bug 1682471 . But it does not address root cause of the flickering problem. It is ideal to address the root cause. There could be some ways to address the root cause. Though I am not sure if it is possible.
-[1] Allocate shared GL context of WebRender and uses RenderCompositorEGL instead of RenderCompositorOGL
-[2] Make RenderDMABUFTextureHost robust from multiple GLContexts of WebRender usage

Flags: needinfo?(sotaro.ikeda.g)

(In reply to Sotaro Ikeda [:sotaro] from comment #5)

(In reply to Robert Mader [:rmader] from comment #4)

Hej Sotaro, any news on this? IIUC this blocks bug 1682471 ?

Sorry, I am going to work for it next week.

Thanks! :) Even if that doesn't solve the root cause, it might reduce the chance of running into the issue enough to switch on EGL by default.

It could be one workaround of bug 1682471 . But it does not address root cause of the flickering problem. It is ideal to address the root cause. There could be some ways to address the root cause. Though I am not sure if it is possible.
-[1] Allocate shared GL context of WebRender and uses RenderCompositorEGL instead of RenderCompositorOGL

Yeah, that's what I first tried in bug 1640048 but it turned out to be more complex, so I went for the easy option. I suppose it would be the better solution long term, sharing even more code between X11 and Wayland/Android, and did not yet see a strong reason why it wouldn't work.

-[2] Make RenderDMABUFTextureHost robust from multiple GLContexts of WebRender usage

Martin, do you have a opinion which of the two solutions here is more feasible?

Flags: needinfo?(stransky)

(In reply to Robert Mader [:rmader] from comment #6)

It could be one workaround of bug 1682471 . But it does not address root cause of the flickering problem. It is ideal to address the root cause. There could be some ways to address the root cause. Though I am not sure if it is possible.
-[1] Allocate shared GL context of WebRender and uses RenderCompositorEGL instead of RenderCompositorOGL

Yeah, that's what I first tried in bug 1640048 but it turned out to be more complex, so I went for the easy option. I suppose it would be the better solution long term, sharing even more code between X11 and Wayland/Android, and did not yet see a strong reason why it wouldn't work.

-[2] Make RenderDMABUFTextureHost robust from multiple GLContexts of WebRender usage

Martin, do you have a opinion which of the two solutions here is more feasible?

Wayland/X11 EGL backend can use both RenderDMABUFTextureHost (for vaapi/WebGL) and EGLImageTextureHost (for sw rendering) so fixes at RenderDMABUFTextureHost will affects only vaapi playback so [1] looks more useful to me.

Flags: needinfo?(stransky)

Looking at https://bugzilla.mozilla.org/show_bug.cgi?id=1682471#c1 it seems to affects vaapi playback so RenderDMABUFTextureHost will be sufficient here. DMABuf surfaces may be easily shared across processes/contents without actual memory copy.

I'm working on the shared GL context for EGL/X11, there's no reason to use different paths for Wayland/X11 there. RenderDMABUFTextureHost may not be significant (or it's a different issue) as I see the bug with default non-dmabuf textures too.

With the patch above we use the same rendering path for Wayland/EGL and X11/EGL. One difference here is that we don't pause WebRender then nsWindow becomes hidden but we resume rendering only once when nsWindow is created. We need to do this resume to force create mSurface at RenderCompositorEGL::Resume().

If you think we also should pause WebRender when the window is hidden on X11/EGL I can update the patch.
Thanks.

deleted

Flags: needinfo?(jgilbert)
Flags: needinfo?(jgilbert)

With D108508 applied, when I run Firefox with "MOZ_X11_EGL=1 ./mach run". Rendering was broken. Ubuntu was 18.04 with xwayland(login with ubuntu with wayland). I did not see the problem with x11(login with ubuntu).

:stransky, is comment 13 expected to happen?

Flags: needinfo?(stransky)
Attachment #9209257 - Attachment description: Bug 1684194 [Linux] Use shared GL context and RenderCompositorEGL on X11/EGL, r?sotaro → Bug 1684194 [Linux] Use RenderCompositorEGL on X11/EGL, r?sotaro

:sotaro yes, partially. Looks like transparent / alpha visual is used and alpha is not correctly configured. It may be a variant of Bug 1663003 and we should fix that. It also depends on your gfx card/drivers - which one do you run?
Thanks.

Flags: needinfo?(stransky) → needinfo?(sotaro.ikeda.g)

about:support says the following.

GPU #1
Description NV126
Vendor ID 0x10de
Device ID 0x1401
Driver Vendor mesa/nouveau
Driver Version 19.2.8.0

Flags: needinfo?(sotaro.ikeda.g)

Yes, nvidia is know to be buggy and we don't going to use EGL there. It also does not support dmabuf buffers so there's no reason to use it.

OK, thank you.

Summary: Disable video rendering during cloning video with WebRender → Use RenderCompositorEGL on X11/EGL
Assignee: sotaro.ikeda.g → stransky

(In reply to Martin Stránský [:stransky] from comment #17)

Yes, nvidia is know to be buggy and we don't going to use EGL there. It also does not support dmabuf buffers so there's no reason to use it.

IIUC this is nouveau/mesa, so dmabuf is available and we probably want to use WR+EGL there eventually.

However, nouveau tends to be buggy and the version is not quite the newest - and Xwayland is also in the mix. Sotaro: any chance you can test on something more recent, such as Ubuntu 20.04? It should have a much better Wayland experience.

(In reply to Robert Mader [:rmader] from comment #19)

(In reply to Martin Stránský [:stransky] from comment #17)

Yes, nvidia is know to be buggy and we don't going to use EGL there. It also does not support dmabuf buffers so there's no reason to use it.

IIUC this is nouveau/mesa, so dmabuf is available and we probably want to use WR+EGL there eventually.

However, nouveau tends to be buggy and the version is not quite the newest - and Xwayland is also in the mix. Sotaro: any chance you can test on something more recent, such as Ubuntu 20.04? It should have a much better Wayland experience.

I tried hard to make dmabuf/EGL working on my NV 750Ti/noveau/Fedora 32/33 but I failed. I don't think it's worth the time we may need to invest there.

Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/52299c7cbec4 [Linux] Use RenderCompositorEGL on X11/EGL, r=sotaro
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
Regressions: 1699596
Regressions: 1699864
Regressions: 1700030

Bug #1699961 is probably a regression. (Bug #1700030 is probably a duplicate)

Regressions: 1710729
Regressions: 1712665
Regressions: 1725538
Regressions: 1709585
Regressions: 1709586
Regressions: 1730822
Blocks: linux-egl
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: