Closed Bug 1983247 Opened 1 year ago Closed 1 year ago

[Linux/HDR/wlroots] Corrupted empty window contents in nightly build and also stable with gfx.wayland.hdr enabled

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 143
defect

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: kode54, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 external file)

Steps to reproduce:

  1. Install wlroots 0.20 from Git
  2. Install Sway from git (or labwc with my patches)
  3. Enable HDR on a supported display, which requires the Vulkan renderer
  4. Run Firefox Stable or Nightly with gfx.wayland.hdr enabled

Actual results:

Window displays an empty window frame that doesn't paint anything new. The terminal that launched the app (or systemd journal if launched by compositor) is spammed with this message:

Aug 15 05:16:48 copycat uwsm_labwc.desktop[600821]: 06:14:09.918 [ERROR] [render/vulkan/texture.c:529] Format AR24 (0x34325241) can't be used with modifier INVALID (0x00FFFFFFFFFFFFFF)

Expected results:

The browser should be picking a supported explicit modifier for use with DMABUFs and window surfaces. Since I see it is using at least the dmabuf v1 revision 4 interface, it should be waiting for the tranche formats list and only picking a supported modifier from the list.

Affecting:

firefox 141.0.3-1
firefox-nightly 143.0a1+20250815.1+h7de8dcc3a2e1-1

Currently using for report:

chromium 141.0.7354.0-1 (N/A, but this is why I'm not sending my UA)

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

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Could you provide the log with MOZ_LOG="Dmabuf:5"?
AFAIK, Firefox does try to pick a format from the tranche formats list. However, Firefox supports only a few formats.
Your case looks like fallback to the default when no supported format found.

Stransky, do you know why we only try to match scanout formats?

[1] https://searchfox.org/mozilla-central/rev/59cf9b740d7f5db77c595d0c886734780bfb257b/gfx/layers/NativeLayerWayland.cpp#109

Severity: -- → S3
Flags: needinfo?(kode54)
Flags: needinfo?(stransky)
Attached file firefox.dmabuf.log.txt —

Dmabuf:5 log from Firefox Nightly.

Flags: needinfo?(kode54)

Looks like it's picking DRM_FORMAT_MOD_LINEAR formats, which AMDGPU/Mesa allows up to 2560x2560 in size under Vulkan, but is deciding to use them without modifiers. Vulkan requires explicit modifiers, even LINEAR.

Try to flip widget.dmabuf-feedback.enabled at about:config, restart browser and try again.
Thanks.

Flags: needinfo?(stransky) → needinfo?(kode54)
Flags: needinfo?(stransky)

It made it work, but when I navigated to wide-gamut.com to test the HDR video tiles at the bottom of the page, when I scrolled to them, my compositor crashed. I'm reporting it to the developer.

Flags: needinfo?(kode54)

Thought I'd add, I don't know until I look, but the dmabuf interface needs the feedback interface to retrieve the formats and modifiers, unless the client only requests revision 3 or older. It will omit the root interface modifier/format reporting if the client requests version 4.

Okay, let's use global modifiers for the dmabuf frame buffer then. All other issues (crashes etc.) should be reported at sway.

Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(stransky)
Priority: -- → P3
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch

Since it may be useful to someone, the wlroots compositor crash was because radv added multi-descriptor for planar YCbCr formats, using up to 3 descriptors per image, one per plane. wlroots does not handle this and assumes all images will have a single descriptor. This will be fixed.

QA Whiteboard: [qa-triage-done-c145/b144]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: