Closed Bug 1764201 Opened 4 years ago Closed 2 years ago

video-dynamic-range should match against capabilities of the window's display, not the main display

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

(Blocks 2 open bugs)

Details

Attachments

(3 external files, 4 obsolete files)

Our matching logic for video-dynamic-range is keying off the main display when it should instead use the display that is actually hosting the window. This will better support multi-monitor setups.

Blocks: hdr-youtube

In the case of mirroring, I assume the primary monitor will be used to determine the results (ie, such as the "optimize for" monitor in MacOS).

This bug sounds likely the cause of https://bugzilla.mozilla.org/show_bug.cgi?id=1812647, which results in YouTube showing inferior video in FireFox (ie streaming HDR content to an SDR monitor instead of showing SDR-optimized content on an SDR monitor).

Blocks: 1812647

Some dependencies are S2 Bugs, so this should be S2 also.

Severity: S3 → S2
Priority: P3 → P2

I see that the fix for this bug has finally gotten off the ground. When can we expect this bug to be fixed? Thank you!

Attachment #9375554 - Attachment description: WIP: Bug 1764201 Part 1: Give gfxPlatform knowledge of all the screens' metrics, not just primary screen. → Bug 1764201 Part 1: Give gfxPlatform knowledge of all the screens' metrics, not just primary screen.

This makes both macOS and Windows report video-dynamic-range:high if the
platform itself can support it (any screen is HDR), and then makes the
media query additionally check that the actual screens are HDR capable.

Attachment #9375554 - Attachment is obsolete: true
Attachment #9388803 - Attachment is obsolete: true
Attachment #9388804 - Attachment is obsolete: true

This duplicates existing HDR checks in gfxPlatformMac and
gfxWindowsPlatform. A later part of this patch series will remove that
redundant code, as it replaces calls to gfxPlatform functions with calls
to ScreenManager functions.

Attachment #9388805 - Attachment description: Bug 1764201 Part 4: Make Gecko_MediaFeatures_VideoDynamicRange check per-screen HDR. → Bug 1764201 Part 2: Make Gecko_MediaFeatures_VideoDynamicRange check per-screen HDR.

The gfxPlatform::GetScreen* methods have always been redundant. Removing
them in favor of ScreenManager or nsDeviceContext methods will
discourage future code authors from adding more redundancy in
gfxPlatform.

Attachment #9389505 - Attachment description: Bug 1764201 Part 1: Make widget::Screen track if the screen is HDR capable. → WIP: Bug 1764201 Part 1: Make widget::Screen track if the screen is HDR capable.

This removes a timing dependency that otherwise requires gfxPlatform to
be initialized before this singleton can be accessed.

Attachment #9389505 - Attachment description: WIP: Bug 1764201 Part 1: Make widget::Screen track if the screen is HDR capable. → WIP: Bug 1764201 Part 2: Make widget::Screen track if the screen is HDR capable.
Attachment #9388805 - Attachment description: Bug 1764201 Part 2: Make Gecko_MediaFeatures_VideoDynamicRange check per-screen HDR. → Bug 1764201 Part 3: Make Gecko_MediaFeatures_VideoDynamicRange check per-screen HDR.
Attachment #9390654 - Attachment description: WIP: Bug 1764201 Part 1: Make DeviceManagerDx::Get initialize the singleton, if necessary. → Bug 1764201 Part 1: Make DeviceManagerDx::Get initialize the singleton, if necessary.
Attachment #9389505 - Attachment description: WIP: Bug 1764201 Part 2: Make widget::Screen track if the screen is HDR capable. → Bug 1764201 Part 2: Make widget::Screen track if the screen is HDR capable.
Attachment #9389507 - Attachment description: Bug 1764201 Part 3: Remove screen info stuff from gfxPlatform. → Bug 1764201 Part 4: Remove screen info stuff from gfxPlatform.
Depends on: 1885197
Priority: P2 → P1
Blocks: 1881603
Attachment #9390654 - Attachment is obsolete: true
Depends on: 1885599

Bug 1885599 doesn't need to be a blocker. The updated patches can handle a missing DeviceManagerDx, concluding in such a case that the screen(s) are not HDR.

No longer depends on: 1885599
See Also: → 1885599
Attachment #9389505 - Attachment description: Bug 1764201 Part 2: Make widget::Screen track if the screen is HDR capable. → Bug 1764201 Part 1: Make widget::Screen track if the screen is HDR capable.
Attachment #9388805 - Attachment description: Bug 1764201 Part 3: Make Gecko_MediaFeatures_VideoDynamicRange check per-screen HDR. → Bug 1764201 Part 2: Make Gecko_MediaFeatures_VideoDynamicRange check per-screen HDR.
Attachment #9389507 - Attachment description: Bug 1764201 Part 4: Remove screen info stuff from gfxPlatform. → Bug 1764201 Part 3: Remove screen info stuff from gfxPlatform.
Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2d21d14a2df3 Part 1: Make widget::Screen track if the screen is HDR capable. r=geckoview-reviewers,ahale,m_kato https://hg.mozilla.org/integration/autoland/rev/ff751c2ce8ef Part 2: Make Gecko_MediaFeatures_VideoDynamicRange check per-screen HDR. r=emilio https://hg.mozilla.org/integration/autoland/rev/ea6921c88429 Part 3: Remove screen info stuff from gfxPlatform. r=jgilbert,geckoview-reviewers

One problem is that the removal of gfxPlatform::PopulateScreenInfo removed the call to gfxVars::SetScreenDepth with a value from the primary screen. This is needed in GLContextProviderEGL::CreateConfigScreen to have a sane bit depth value. Possible fixes:

  1. Restore gfxPlatform::PopulateScreenInfo just to preserve the setting of gfxVars screen depth for the primary screen.
  2. Make GLContextProviderEGL::CreateConfigScreen pull primary screen scene depth from the widget::ScreenManager.
  3. Modify GLContextProviderEGL::CreateConfigScreen to take a screen parameter, and use that to get the specific screen's depth from the widget::ScreenManager.

Option 3 is the best, most forward-looking choice. I fear it may be a bunch of code modification that snarls up this patch further. I'm tempted to pursue Option 2 (preserving current behavior) and file a new bug for the improvements to GLContextProviderEGL::CreateConfigScreen.

See Also: → 1886573

(In reply to Brad Werth [:bradwerth] from comment #15)

One problem is that the removal of gfxPlatform::PopulateScreenInfo removed the call to gfxVars::SetScreenDepth with a value from the primary screen. This is needed in GLContextProviderEGL::CreateConfigScreen to have a sane bit depth value. Possible fixes:

  1. Restore gfxPlatform::PopulateScreenInfo just to preserve the setting of gfxVars screen depth for the primary screen.
  2. Make GLContextProviderEGL::CreateConfigScreen pull primary screen scene depth from the widget::ScreenManager.
  3. Modify GLContextProviderEGL::CreateConfigScreen to take a screen parameter, and use that to get the specific screen's depth from the widget::ScreenManager.

It wasn't effective to try Option 2, because the ScreenManager can only be instantiated on the main thread, and GLContextProviderEGL::CreateConfigScreen runs on the render thread. So instead pursuing Option 1.

Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/09f6a0b25938 Part 1: Make widget::Screen track if the screen is HDR capable. r=geckoview-reviewers,ahale,m_kato https://hg.mozilla.org/integration/autoland/rev/88d751bcbf03 Part 2: Make Gecko_MediaFeatures_VideoDynamicRange check per-screen HDR. r=emilio https://hg.mozilla.org/integration/autoland/rev/f42d24696e43 Part 3: Remove screen info stuff from gfxPlatform. r=jgilbert,geckoview-reviewers
Flags: needinfo?(bwerth)
Regressions: 1890939
See Also: → 1884960
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: