Skip to content

feat: add opt-in Auto HDR for SDR games with direct scanout - #753

Open
Raxcoms wants to merge 9 commits into
armada-os:mainfrom
Raxcoms:feat-direct-auto-hdr
Open

Raxcoms wants to merge 9 commits into
armada-os:mainfrom
Raxcoms:feat-direct-auto-hdr

Conversation

@Raxcoms

@Raxcoms Raxcoms commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Add opt-in Auto HDR for SDR games on supported HDR-capable primary displays.

  • Add a global and per-game toggle below game resolution in Armada Control. It is disabled by default.
  • Reuse Gamescope's SDR color-management and LUT utilities, adding inverse tone mapping for SDR game content.
  • Use the same generated LUTs for direct scanout and composition when composition is needed by something else. Auto HDR does not itself force composition.
  • Keep Steam's SDR overlays on their normal color-management path while the game underneath retains its HDR mapping.
  • Limit conversion to the primary display with suitable hardware color pipelines, leaving leased secondary displays, native HDR games, unsupported configurations, and the disabled setting on their existing paths.
  • Bound the HDR mapping to the running display's reported peak luminance.

The implementation is contained in one Gamescope patch plus Armada Control integration. It adds no packages or kernel patches and does not change the bottom-screen desktop session.

Verification

The changes were verified working on both the Retroid Pocket Nova and the AYN Thor, including direct-scanout Auto HDR presentation and Steam's HDR indication.

Regression coverage is included for settings and runtime lifecycle behavior, along with Gamescope tests for LUT luminance bounds, chromaticity, gain, curve continuity, and output-gamut handling. This does not claim exact visual equivalence between SDR and inverse-tone-mapped HDR or validation on every HDR-capable device.

Development disclosure

AI was used as a supporting tool during development, debugging, and code review. Hardware verification was performed on the Retroid Pocket Nova and AYN Thor.

Reuse settings inheritance and game lifetime tracking, with capability checks and restart-safe cleanup through the existing control daemon.
Extend the existing SDR LUT builder with a neutral inverse tone map. Apply the same tables to the game layer on suitable primary-output hardware planes or during composition, leaving SDR overlays and native HDR on their existing paths.
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Disk image

armada-disk-pr753, built from 1fc7435

Downloads as a zip holding armada-*.img.gz and its .sha256.
GitHub requires you to be signed in to download run artifacts.

Adapt AutoHDR to Gamescope 3.17 while preserving native gamut mapping and repeated-frame caching. Reuse the color-management update checkpoint, derive the LUT descriptor count and register tests without modifying the upstream source list.

@JPyke3 JPyke3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes.

Aside from this I'd love to get @virtudude @FeralAI or @justradical's opinion on if we should add a giant gamescope patch to support this. Just worried about drifting super far away from upstream projects like Gamescope. Personally I am a bit neutral but I am worried about how hard maintenance would be

Comment on lines +836 to +840
index 0000000..986d99d
--- /dev/null
+++ b/tests/test_auto_hdr.cpp
@@ -0,0 +1,347 @@
+#include <array>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insure if we really need to patch in a gamescope test file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept this as regression coverage for the new AutoHDR transform and its integration with Gamescope's LUT builder. Existing upstream color tests cover SDR gamut mapping, while Armada's shell tests cover settings and lifecycle; neither exercises AutoHDR's generated LUTs.

It checks peak bounds, RGB/chromaticity preservation after LUT quantization, gain ordering, and curve monotonicity against an independent reference. It reuses the optional gamescope_tests/Catch2 target, with no additional dependency or installed component.

These tests help catch color-processing changes during Gamescope updates. They cannot verify plane allocation, layer selection, or SDR-overlay presentation, which still need source review and device tests; those maintenance boundaries are now called out in the patch header.

@Raxcoms

Raxcoms commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Some minor changes.

Aside from this I'd love to get @virtudude @FeralAI or @justradical's opinion on if we should add a giant gamescope patch to support this. Just worried about drifting super far away from upstream projects like Gamescope. Personally I am a bit neutral but I am worried about how hard maintenance would be

@JPyke3 Gamescope does have a native inverse tone mapper, but that forces composition by default
The bulk of these changes are to ensure a direct scannout presentation to avoid the hefty performance cost

And ensuring the AutoHDR isn't applied to undesired layers like the steam overlay stuff

While the patch is big it shouldn't be affecting anything if the AutoHDR toggle is disabled, it is mostly adding a separate presentation flow for when AutoHDR is enabled, while reusing existing things as much as possible (at least as far as I tried to ensure)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants