Open Bug 2073803 Opened 2 months ago Updated 1 day ago

Video overlay uses stale display color space after window is moved from SDR to HDR monitor, breaking SDR video brightness on fullscreen

Categories

(Core :: Graphics: WebRender, defect)

Firefox 156
defect

Tracking

()

UNCONFIRMED

People

(Reporter: byrdsaron, Unassigned, NeedInfo)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:156.0) Gecko/20100101 Firefox/156.0

Steps to reproduce:

  1. Fully quit Firefox
  2. Launch Firefox on display A (non-HDR)
  3. Play the SDR video in a window, video element fully visible and unobstructed
  4. Drag the Firefox window to display B (HDR)
  5. Enter fullscreen
  6. Exit fullscreen, keeping the video fully visible
  7. Scroll so the video element is only partially visible

Controls

  • Launch directly on display B, then fullscreen: no repro. Fullscreen on an HDR display is not sufficient; the cross-display migration is required
  • Reverse direction (launch on B with SDR video, move to A, fullscreen): no repro
  • Reverse direction with an HDR video: overexposed, blown highlights, oversaturated. Likely confounded by the known incomplete HDR-on-SDR tone mapping, and no clean control was possible — bilibili only serves the HDR stream if the page was loaded while on an HDR display. Recording as a separate, unconfirmed observation

Actual results:

  • Step 4: renders correctly
  • Step 5: brightness drops noticeably. The Windows "SDR content brightness" slider no longer affects the video, while it still affects the surrounding page
  • Step 6: the broken state persists after leaving fullscreen; the video now looks washed out with raised blacks relative to the page
  • Step 7: correct appearance returns, and the slider affects the video again

The broken state survives page reloads. It is only cleared by restarting the Firefox.

Analysis

Step 7 places the fault in the DirectComposition overlay path: when the video element is partially clipped, WebRender falls back to its ordinary rendering path and the problem disappears. The window carries the color space state established on display A; entering fullscreen forces the overlay to be rebuilt, and the display capability information used at that point appears to be stale.

The HDR-on-Windows blog post notes that toggling a display's HDR mode or moving a window to a display with different capabilities requires a page reload to refresh that state. Window migration may not be wired to the same notification path, and a reload is not sufficient here.

Workarounds tested

gfx.webrender.dcomp-video-hw-overlay-win=false prevents the repro, but breaks HDR video playback entirely — expected, since HDR video requires the compositor overlay path. Not usable day to day, but it confirms the fault is inside the overlay path rather than in decoding or in WebRender's ordinary rendering path.

Note: the older pref gfx.webrender.dcomp-video-overlay-win no longer exists in 156; it appears to have been split into hw/sw variants.

Expected results:

SDR video should be composited as SDR content and stay under the SDR content brightness slider regardless of which display the window was launched on.

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: -- → S3
Flags: needinfo?(ahale)
See Also: → 2091358

Thanks for the detailed report. One thing that matches what you describe is RTX Video HDR. When the window is on an HDR monitor, Firefox can ask the NVIDIA driver to convert SDR video to HDR in the video overlay, and the Windows SDR brightness slider doesn't apply to that output. Clipping the video takes it off the overlay path, which would explain why that fixes it.

Could you check a few things?

  1. What GPU do you have? Pasting the Graphics section of about:support, copied while the video is in the broken state, would be ideal.
  2. Is RTX Video HDR turned on in the NVIDIA app or NVIDIA Control Panel (if you have an NVIDIA GPU)?
  3. In about:config, set gfx.webrender.overlay-vp-auto-hdr to false, restart Firefox, and repeat your steps. Does the problem still happen?
Flags: needinfo?(byrdsaron)
See Also: → 2094472
You need to log in before you can comment on or make changes to this bug.