Closed Bug 2089043 Opened 16 days ago Closed 14 days ago

[Linux/Wayland] DMABuf WebGL color corruption still present in Firefox 159.0.1 on Intel UHD 730

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 159
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox160 --- fixed
firefox161 --- fixed
firefox162 --- fixed

People

(Reporter: marc.nuechter, Assigned: lsalzman)

References

(Regression)

Details

(Keywords: regression)

Attachments

(17 files, 3 external files)

9.50 KB, text/html
Details
210.93 KB, image/png
Details
90.05 KB, image/png
Details
159.46 KB, text/plain
Details
1.96 KB, text/plain
Details
1.14 MB, image/png
Details
2.52 MB, image/png
Details
1.20 MB, image/png
Details
2.67 MB, image/png
Details
17.26 KB, text/html
Details
3.53 KB, text/plain
Details
134.51 KB, image/png
Details
134.51 KB, image/png
Details
227.97 KB, image/png
Details
4.88 KB, text/plain
Details
134.74 KB, image/png
Details
156.47 KB, image/png
Details

Additional hardware information:
OS: Kubuntu 26.04
Desktop environment: KDE Plasma
Display server: Wayland
CPU: Intel Core i5-13400
GPU: Intel UHD Graphics 730 (ADL-S GT1)
Graphics driver: Mesa 26.0.8-1ubuntu0.3
OpenGL: 4.6
Firefox: 159.0.1
Application affected: Elvenar browsergame

https://bugzilla.mozilla.org/show_bug.cgi?id=2087301

The issue is still reproducible with Intel integrated graphics.

White and yellow colors are incorrectly rendered as blue.

Workaround: Setting widget.dmabuf-webgl.enabled to false in about:config and completely restarting Firefox fixes the issue.

This suggests that the fix included in Firefox 159.0.1 does not resolve the problem on all Intel graphics configurations.

See Also: → 2087301

Thanks for the report. The symptoms look different from bug 2087301. That bug swapped red and blue, but white can't turn blue from a channel swap, so this may be a separate issue. Could you help us narrow it down?

  1. Open the attached diagnostic page on this bug. When it says "Done", click "Copy results" and paste the text here. Please also attach a screenshot of the whole page, because some problems only show on screen.
  2. Tell us exactly where in Elvenar you see the wrong colours: the URL, which screen or part of the game, and what you do to make it happen. Does it happen immediately or only after a while?
  3. Attach a screenshot, or better a short screen recording, of the wrong colours in Elvenar, with a screenshot of the same view looking correct (for example with widget.dmabuf-webgl.enabled set to false) for comparison.
  4. Attach the full about:support output ("Copy raw data to clipboard").
  5. With widget.dmabuf-webgl.enabled back at its default, set gfx.canvas.accelerated to false, restart Firefox, and say whether Elvenar still shows wrong colours.
  6. Did this happen in Firefox 158 or earlier, or only starting with 159? If you can, a mozregression run (https://mozilla.github.io/mozregression/) would help a lot.
Flags: needinfo?(marc.nuechter)
Attached image bug report screenshot 2 โ€”
Flags: needinfo?(marc.nuechter)
Attached image bug report screenshot 1 โ€”
Attached file about support output โ€”
Attachment #9674691 - Attachment description: Bildschirmfoto_20261105_114128.png → bug report screenshot 2
Attachment #9674692 - Attachment description: Bildschirmfoto_20261105_114102.png → bug report screenshot 1
Attached file WebGL color Diagnotics โ€”

Thanks for running the diagnostic and for the about:support. Everything on the test page passed and the directly displayed WebGL canvases look correct, so basic WebGL rendering is fine on your system. Elvenar must be doing something the test page doesn't cover.

One thing from about:support: the Firefox Snap uses its own bundled Mesa (25.2.8), not your system's Mesa 26.0.8. Could you also try the Firefox tarball from https://www.mozilla.org/firefox/linux/, which uses your system Mesa, and say whether Elvenar still shows wrong colours?

We also still need:

  • Where in Elvenar you see the wrong colours (URL, which screen, what you do), and a screenshot or short screen recording of it, plus one of the same view looking correct with widget.dmabuf-webgl.enabled set to false.
  • Whether Elvenar still shows wrong colours with widget.dmabuf-webgl.enabled back at its default and gfx.canvas.accelerated set to false (restart Firefox after changing it).
  • Whether this happened in Firefox 158 or earlier, or only starting withย 159.

> Tell us exactly where in Elvenar you see the wrong colours: the URL, which screen or part of the game, and what you do to make it happen. Does it happen immediately or only after a while?

https://de7.elvenar.com/game.
The wrong colors starting immediately in the complete Game
It startet the first time direct after the update to 159.0.1 never before

Attached image blue color 1.png โ€”
Attached image blue color 2.png โ€”
Attached image correct collor1.png โ€”
Attached image correct collor 2.png โ€”
Attachment #9674716 - Attachment description: blue 1.png → blue color 1.png
Attachment #9674717 - Attachment description: blue 2.png → blue color 2.png

_With widget.dmabuf-webgl.enabled back at its default, set gfx.canvas.accelerated to false, restart Firefox, and say whether Elvenar still shows wrong colours._

with gfx.canvas.acceleratd the colors are correct.

When I disable hardware acceleration in Firefox's settings, the colors are displayed correctly as well.

For the mozregression run i will need more Time to figure out what exactly I need to do. I hope tomorrow

Thank you again for taking the time to test all of this. It helps us a lot, and we know it takes time.

Did you see the blue colors in Firefox 159.0, or was 159.0.1 the first version where you saw them?

If you have time, please test both versions:

  1. In your current Firefox, open the new attached test page (bug2089043_diagnostic_v3.html ). When it says "Done", click "Copy results" and paste the text here, with a screenshot.
  2. Close Firefox. Open a terminal and run: sudo snap revert firefox
  3. Start Firefox. Open about:support and write down the version number. If it is not 159.0, please tell us which version it is.
  4. Open Elvenar. Are the colors correct or blue? Then open the v3 test page again and paste the results with a screenshot.
  5. To go back to the newest version, close Firefox and run: sudo snap refresh firefox
Attached file bug Diagnostic V3 159.0.1 โ€”
Attached image wrong screen โ€”
Attachment #9674740 - Attachment description: bug Diagnostic V3 159.0.1 screen 2of2 → wrong screen

Did you see the blue colors in Firefox 159.0, or was 159.0.1 the first version where you saw them?

159.0.1 was the first time.

Attached file bug Diagnostic v3 159.0 โ€”

Thank you, Marc, for all your help and for answering so quickly. The v3 result is very useful. Test B1 shows the problem: when a large (accelerated) 2D canvas is uploaded into WebGL with texImage2D, red and blue are swapped. A small 2D canvas (B2) is correct.

When you have time, please run the same test page after sudo snap revert firefox (version 159.0) and paste the results. That will confirm the change between 159.0 and 159.0.1.

Abhinav, Lee: B1 in attachment bug2089043_diagnostic_v3.html reproduces this on the reporter's 159.0.1, and the reporter says 159.0 was fine. The path is TexUnpackSurface::TexOrSubImage with a SurfaceDescriptorCanvasSurface source: the descriptor exported by CanvasManagerParent::GetCanvasSurface goes to BlitSd, then BlitSdToFramebuffer, then GLBlitHelper::Blit(DMABufSurface*), with destFormat left UNKNOWN. Since the bug 2087301 fix, srcIsBGRA is true for a BGRA DMABuf, so an UNKNOWN destination now gets swapped where it didn't before. Abhinav, could you run B1 on your AMD setup with and without D338339 to confirm?

Flags: needinfo?(abhinavsingh717073)
Keywords: regression
Regressed by: 2087301

Thank you very much, Marc. This was exactly the test we needed.

The results from 159.0 and 159.0.1 show the change clearly:

  • 159.0: test A (drawImage of a WebGL canvas into an accelerated 2D canvas) has red/blue swapped. That is bugย 2087301. Test B1 (texImage2D of an accelerated 2D canvas) is correct.
  • 159.0.1: test A is correct, but B1 has red/blue swapped.

So the bug 2087301 fix moved the swap from one path to the other. Elvenar uses the B1 path, which is why it broke in 159.0.1.

Flags: needinfo?(lsalzman)

after sudo snap revert firefox (version 159.0)
the colors in Elvenar are fine

Thanks Marc! I think we have everything we need from you. We need to make a fix for this now.

Thank you.
What does that mean for me?

I'll switch back to 159.0.1, and sooner or later there will be an update that fixes the bug?

There will be an update that fixes the bug sooner rather than later, but I'm not sure exactly which version or when. Less than two weeks most likely.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Since this seems like it makes a site unusable in Firefox I am setting this to S2 in triage.

Severity: -- → S2

The surface format of single-plan DMABuf surfaces is currently an unreliable
way to determine whether to do a BGRA swizzle. For now, avoid doing a swizzle
on such surfaces.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
Flags: needinfo?(lsalzman)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Distorted Canvas2D rendering on Linux
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Avoids doing a swizzle on certain rendering paths that are problematic.
  • String changes made/needed?: None
  • Is Android affected?: no
Attachment #9676357 - Flags: approval-mozilla-beta?

The surface format of single-plane DMABuf surfaces is currently an unreliable
way to determine whether to do a BGRA swizzle. For now, avoid doing a swizzle
on such surfaces.

Original Revision: https://phabricator.services.mozilla.com/D340202

:lsalzman, could you consider a release uplift request? We could take it in the planned Fx160 dot release

Flags: needinfo?(lsalzman)
Flags: needinfo?(abhinavsingh717073)
Attachment #9676357 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
See Also: → 2090953

The surface format of single-plane DMABuf surfaces is currently an unreliable
way to determine whether to do a BGRA swizzle. For now, avoid doing a swizzle
on such surfaces.

Original Revision: https://phabricator.services.mozilla.com/D340202

Attachment #9678470 - Flags: approval-mozilla-release?

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: Distorted Canvas2D rendering on Linux. It will be several weeks before 161 is released, during which Linux users will have broken Canvas2D rendering. It seems safe enough to uplift this fix to release to resolve the issue. This fix and the bug itself do not affect other platforms, regardless, which adds an extra margin of safety to uplifting the fix.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Avoids doing a swizzle on certain rendering paths that are problematic.
  • String changes made/needed?: None
  • Is Android affected?: no
Flags: needinfo?(lsalzman)
Duplicate of this bug: 2090953
Duplicate of this bug: 2091395
Duplicate of this bug: 2091720
Duplicate of this bug: 2092521
Attachment #9678470 - Flags: approval-mozilla-release? → approval-mozilla-release+
See Also: → 2092687
See Also: 2087301, 2090953 →
QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: