Open Bug 1761927 Opened 3 years ago Updated 6 months ago

[Wayland] WebRender compositor sends dmabuf with unsupported modifier

Categories

(Core :: Graphics: WebRender, defect)

Firefox 99
Unspecified
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: tobias, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

Attached file about:support

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0

Steps to reproduce:

I force-enabled the WebRender compositor (gfx.webrender.compositor, gfx.webrender.compositor.force-enabled) on sway with the experimental wlroots Vulkan renderer (WLR_RENDERER=vulkan).
Versions:

  • Firefox 99.0b8
  • sway version 1.8-dev-fb3330c1 (Mar 27 2022, branch 'master')
  • wlroots master 0.15.0-135-g4519117a
  • mesa 21.3.7
  • Linux 5.16.8
  • Intel GPU - OpenGL renderer string: Mesa Intel(R) HD Graphics 620 (KBL GT2)

This issue was originally reported as a wlroots bug, but I was told it's most likely a Firefox bug so I'm reporting it here as well.
Link: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3404

Note: I've redacted some unrelated information in the attached about:support output.

Actual results:

At some point during startup, the Firefox quits suddenly and the following error is reported by sway:
[ERROR] [wlr] [render/vulkan/texture.c:403] Format 34325241 (AR24) can't be used with modifier ffffffffffffff
The error might occur only during loading of a specific page (I always have a lot of tabs open so it's not clear if a specific page was the culprit).

Expected results:

Firefox should work with the WebRender compositor enabled on the wlroots Vulkan renderer, same as the normal wlroots renderer.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core
Severity: -- → S4
OS: Unspecified → Linux

Right, the experimental compositor backend atm always uses DRM_FORMAT_MOD_INVALID, i.e. implicit modifiers, even if not advertized by the compositor. And I guess implicit modifiers don't work on Vulkan.

I am experiencing the same problem. Could we please receive an update on the status of this issue? That's hard to fix ?

Unless you use WebGL the dmabuf backed textures are created by MESA library, Firefox doesn't explicitly create any dmabuf textures so better to look there.

You can debug explicit dmabuf allocations in Firefox by running with MOZ_LOG="Dmabuf:5" env variable on terminal:

MOZ_LOG="Dmabuf:5" firefox

Attached file firefox-dma-sway.log

MOZ_LOG="Dmabuf:5" firefox-nightly 125.0a1 (2024-03-04) (64-bit)

Flags: needinfo?(stransky)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #4)

Unless you use WebGL the dmabuf backed textures are created by MESA library, Firefox doesn't explicitly create any dmabuf textures so better to look there.

You can debug explicit dmabuf allocations in Firefox by running with MOZ_LOG="Dmabuf:5" env variable on terminal:

MOZ_LOG="Dmabuf:5" firefox

So you think that it's neither a wlroots/sway nor firefox but mesa ?
I've attached the output of MOZ_LOG="Dmabuf:5" firefox-nightly. https://bugzilla.mozilla.org/attachment.cgi?id=9389344

(In reply to Martin Stránský [:stransky] (ni? me) from comment #4)

Unless you use WebGL the dmabuf backed textures are created by MESA library, Firefox doesn't explicitly create any dmabuf textures so better to look there.

This bug is about the experimental compositor backend where we actually do create dmabufs manually, see comment 2.

What we'd need here is either a proper zwp_linux_dmabuf_v1 v3/v4 implementation for that backend - or, as a simple hack: default to DRM_FORMAT_MOD_LINEAR instead of DRM_FORMAT_MOD_INVALID, given that that's pretty much always supported.

I personally don't have time to look into this though.

I experience the same issue: when utilizing Sway in Vulkan mode and launching Firefox Nightly (version 125.0a1, dated 2024-03-04) with the settings "gfx.webrender.compositor:true" and "gfx.webrender.compositor.force-enabled:true", the Firefox window appears transparent.

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

Attachment

General

Creator:
Created:
Updated:
Size: