Enabling HDR on my laptop (ASUS Zenbook 14 Flip OLED UN5401QA), either through Plasma 6 or running an app with gamescope
, causes the whole screen to continuously flicker.
The patch that caused it: https://lists.freedesktop.org/archives/amd-gfx/2024-January/102725.html
The attached patch is enough to fix it.
Start Plasma 6, open System Settings -> Display and Monitor -> Enable HDR.
Or, in a separate tty, run an HDR enabled app with gamescope
e.g mpv:
ENABLE_GAMESCOPE_WSI=1 gamescope --hdr-enabled --expose-wayland -- /usr/bin/mpv --no-config --vo=gpu-next --gpu-api=vulkan --gpu-context=waylandvk --target-colorspace-hint <path-to-hdr-video>
Yeah that works great! I have a couple of thoughts though:
At least on my gpu, adding VK_MEMORY_PROPERTY_HOST_CACHED_BIT
to the memory flags fixes the performance issues with no adverse affects.
The problem is format_props->features
corresponds to formatProperties.optimalTilingFeatures
but the dst image is linear. Instead formatProperties.linearTilingFeatures
needs to be checked. Also if blitting isn't supported vkCmdCopyImage
can be used, as done in the screenshot example. With these fixes it works on my nvidia gpu, but with pretty bad recording performance.
I'm using KDE, not Gnome. That command outputs 'No entries'.
I've tried mostly games e.g Witcher 3 and Battlefield V, so definitely direct rendering.
I'm using the nvidia beta driver 495.29.05, along with egl-wayland 1.19 and latest xwayland git. This is on KWin 5.23.1 with this MR on top. KWin debug logs show that normal wayland windows successfully scanout, but Xwayland windows fail due to an unsupported output modifier here.
This is after patching kwin to fix scanout in general after it seems to have been broken in general, see this issue.