gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

HDR Support for DRM/KMS?

Open JacekJagosz opened this issue 3 years ago • 1 comments

AMD's libdrm driver has supported HDR for years actually, Intel and Nvidia too in theory, not sure how do implementations differ. While support for HDR in compositors like Mutter is still in progress, applications using DRM directly can have working HDR, like this MPV PR or Kodi. Gamescope can directly use DRM/KMS, so it in theory could do what MPV does too, to output HDR data. I know it would also need support in Proton too. HDR in games is an important feature, that got quite mature on Windows. Could it be considered for gamescope to experiment with support for it, standards can get more mature once other compositors implement it?

JacekJagosz avatar Sep 12 '22 20:09 JacekJagosz

Yes, I plan to experiment with HDR support soon.

I started the work on the vkd3d side recently: https://github.com/HansKristian-Work/vkd3d-proton/pull/1227

misyltoad avatar Sep 12 '22 22:09 misyltoad

On driver support, RADV (mesa-git) seems to be missing VK_EXT_hdr_metadata. Is this a known issue, or should I report this to the Mesa tracker?

aqxa1 avatar Jan 16 '23 02:01 aqxa1

This is not needed, as it is implemented by the Gamescope WSI layer.

misyltoad avatar Jan 16 '23 04:01 misyltoad

It's required by mpv though correct? Nothing to do with your work of course though, so I'll leave it at that.

aqxa1 avatar Jan 16 '23 04:01 aqxa1

The Gamescope WSI layer implements VK_EXT_hdr_metadata which can be used by MPV.

MPV does work with it.

misyltoad avatar Jan 16 '23 05:01 misyltoad

Gotcha, I meant independent of gamescope. It does work but only through my primary card (I get a black screen on the secondary) and doesn't seem to have control over resolution or refresh rate (although perhaps --generate-drm-mode would cover me there). Whereas mpv's displayvk context works for everything, except the key point of HDR support, which I assume requires that extension.

aqxa1 avatar Jan 16 '23 05:01 aqxa1

You can use eg. -O "DP-1,*" to specify a display output. You can pick a Vulkan device with --prefer-vk-device too.

misyltoad avatar Jan 16 '23 05:01 misyltoad

The actual signal does go to my secondary gpu/display, and the display detects HDR, it just doesn't show any output, just a black screen. And it actually defaults to the secondary GPU and display, so even when forcing them through --prefer-output and --prefer-vk-device the problem persists.

However, no problem with either of my HDR supporting displays if they are connected to the primary GPU.

aqxa1 avatar Jan 16 '23 05:01 aqxa1