Closed Bug 1656505 Opened 4 years ago Closed 4 years ago

Glitches on ncase.me/trust with dmabug-webgl enabled

Categories

(Core :: Graphics: Layers, defect, P3)

Unspecified
Linux
defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: rmader, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Crash Data

Attachments

(6 files)

Using Firefox 79 from Fedora 32, a local build from yesterday and todays nightly.

How to reproduce:

  • use the Wayland backend
  • make sure widget.wayland-dmabuf-webgl.enabled or, in 80/81, widget.dmabuf-webgl.enabled is enabled
  • go to https://ncase.me/trust/

Observed result:

  • certain graphics do not show up or are wrong
  • the issue goes away when disabling widget.[wayland-]dmabuf-webgl.enabled
Attached image Without glitches
Attached image glitches on 79

Note: the X11/EGL backend is also affected with bug 1655026 / D84901 applied.

Blocks: 1655026
Summary: Glitches on ncase.me/trust with dmabug-webgl enabled on FF 79 → Glitches on ncase.me/trust with dmabug-webgl enabled
Severity: -- → S3
Priority: -- → P3

Martin, I'm currently trying to debug this but there's one thing I don't understand. Each value of gNewSurfaceUID, even after made atomic, does get used twice - is that expected? Here's a debug print with the values for mUID and this:

DMABufSurface constr 1 0x7fab17aeaec0
DMABufSurface destr 1 0x7fab17aeaec0
DMABufSurface constr 2 0x7fab17aeaec0
DMABufSurface constr 1 0x7fc3b8e097a0
DMABufSurface constr 3 0x7fab184f3d90
DMABufSurface constr 2 0x7fc3b8e0b2f0
DMABufSurface constr 4 0x7fab184f4250
DMABufSurface destr 2 0x7fab17aeaec0
DMABufSurface constr 3 0x7fc3b8e0b550
DMABufSurface constr 5 0x7fab184f4d00
DMABufSurface destr 2 0x7fc3b8e097a0
DMABufSurface destr 3 0x7fab184f3d90
DMABufSurface constr 4 0x7fc3b8e09ec0
DMABufSurface constr 6 0x7fab184f4e30
DMABufSurface destr 4 0x7fab184f4250
DMABufSurface constr 5 0x7fc3b8e0a5e0
DMABufSurface destr 3 0x7fc3b8e0b2f0
DMABufSurface constr 7 0x7fab184f3ff0
DMABufSurface destr 5 0x7fab184f4d00
DMABufSurface constr 6 0x7fc3b8e092e0
DMABufSurface destr 4 0x7fc3b8e0b550
DMABufSurface constr 8 0x7fab2937d7b0
DMABufSurface destr 5 0x7fc3b8e09ec0
DMABufSurface destr 6 0x7fab184f4e30
DMABufSurface constr 7 0x7fc3b8e09ec0
DMABufSurface destr 6 0x7fc3b8e0a5e0
DMABufSurface constr 9 0x7fab2968e1b0
DMABufSurface destr 7 0x7fab184f3ff0
DMABufSurface constr 8 0x7fc3b8e0a5e0
DMABufSurface destr 7 0x7fc3b8e092e0
DMABufSurface constr 10 0x7fab2937dc70
DMABufSurface destr 8 0x7fab2937d7b0
DMABufSurface constr 9 0x7fc3b8e092e0
DMABufSurface constr 11 0x7fab0f6231b0
DMABufSurface destr 9 0x7fab2968e1b0
DMABufSurface constr 10 0x7fc3b8e0bb40
DMABufSurface destr 8 0x7fc3b8e09ec0
DMABufSurface destr 9 0x7fc3b8e0a5e0
...
Flags: needinfo?(stransky)

Actually no reason to block bug 1655026, the EGL backend is still experimental and buggy anyways.

No longer blocks: 1655026

I updated the STR as on the landing page the problem is actually even more visible. Also, the root problem seems to have been there from the very beginning with DMABuf WebGL - I checked with mozregression and the only difference with more recent versions is that areas that previously appeared white are now black.

My current guess is that the site request multiple surfaces/textures but the DMABuf backend only ever provides one - and all the additional ones somehow just reference the "main" surface, creating an odd pattern.

Martin, I think this a central design bug and not just a small issue that I could fix - can you have a look?

Martin, I'm currently trying to debug this but there's one thing I don't understand. Each value of gNewSurfaceUID, even after made atomic, does get used twice - is that expected? Here's a debug print with the values for mUID and this.

Yes, that's expected. the UID is connected to actual piece of GPU memory which can be transferred across the processes and may be attached to more than one dmabuf surface object in different processes. Then you may see more surfaces with the same ID.

btw. I don't see the regression - it's the '3. One tournament' page', right? I'm on Intel GPU, Fedora 32 and latest Fedora build.

Flags: needinfo?(stransky)

Ah great, I see it on latest nightly which is a good news. I'll look at it.

Assignee: nobody → stransky

The game of trust is a great example. I can reproduce it even with Firefox 79. Looks like the frame buffer is used as a texture instead of the actual one.

  • Restore active texture when dmabuf texture is created at DMABufSurfaceRGBA::CreateTexture()/DMABufSurfaceYUV::CreateTexture.
  • Provide more logging for DMABufSurfaceRGBA surfaces.
  • Implement DMABufSurfaceRGBA::DumpToFile() to save dmabuf surface content to png file.

Depends on D88381

Just tested and it appears to fix all the glitches I've encountered so for - great! Hope the patches can be uplifted to beta and maybe even the fedora stable version.

Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c868a37827ec
[Linux] Use correct RGB/RGBA formats with dmabuf, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/659a72c0d0e6
[Linux] Restore active texture when dmabuf texture is created and provide logging to dmabuf surfaces, r=jgilbert
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Crash Signature: [@ bp-43ea8c5d-f9b5-47ec-8d9c-d3f810200811 bp-dae938b3-7b55-444e-a570-a604e0200811]
Crash Signature: [@ bp-43ea8c5d-f9b5-47ec-8d9c-d3f810200811 bp-dae938b3-7b55-444e-a570-a604e0200811] → [@ libxul.so@0x297107b | libxul.so@0x1fcf4be ]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: