hyprwm / Hyprland

Hyprland is a highly customizable dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
17.95k stars 754 forks source link

HDR support in Hyprland #4933

Open Swomp2 opened 4 months ago

Swomp2 commented 4 months ago

Description

So, plasma 6 was recently released and has initial HDR support, which, as far as I know, can be ported to other graphics environments. GNOME, according to rumors, will also soon receive HDR support. Do you have any future plans to bring HDR to hyprland?

vaxerski commented 4 months ago

No; I don't have an HDR display. Feel free to MR, though, nothing against it.

Swomp2 commented 4 months ago

Okay, thank you

nergdron commented 4 months ago

what's MR stand for? also if someone contributed an HDR display to you, would this at all change the priority for you?

vaxerski commented 4 months ago

merge request.

And please dont contribute an hdr display to me.

nergdron commented 3 months ago

haha ok well. I'm not a C++ dev, so I'm not really able to create a patch to add this support, but it is super important to me. if there's something that would be useful to you that'd encourage you to work on it, just say the word.

vaxerski commented 3 months ago

I looked through the specs of my laptop and it should support HDR?

image

Anyways, we still should wait for the w-p, KDE uses a vendored, custom protocol it seems.

https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/14

Also why was this closed? It hasn't been solved?

I can dig into HDR a bit if my laptop proves to be actually compatible with HDR

Edit: looked around, this first needs support in wlr.

crimist commented 3 months ago

I looked through the specs of my laptop and it should support HDR?

Yes, those specs indicate your laptop has an OLED panel which will deliver an excellent HDR experience. It'll work for testing.

@Swomp2 It'd be great if you could reopen this issue to track progress.

crimist commented 3 months ago

Regarding the general state of HDR on Linux things are still in their infancy. @Zamundaaa has great blog posts about it but the TLDR is that most things aren't finalized or merged yet.

I believe theoretically any WM can implement HDR in a way that works with a hacky Vulkan layer at the moment. I imagine this is practically impossible for something based on wlr though.

I'm far from an expert so any and all corrections are welcome.

vaxerski commented 3 months ago

https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4594

Swomp2 commented 3 months ago

I closed the issue because I thought no one would be interested in it + personally, I’m not a programmer and I won’t be able to add anything ((

vaxerski commented 3 months ago

still it's better to have a place to track it

abysssdweller commented 3 months ago

HDR on hyprland would be crazy!

ysimard94 commented 3 months ago

Lack of HDR support is the only reason why I'm not making the full switch from KDE, would love for this to happen

crimist commented 3 months ago

The enthusiasm is nice but HDR won't be implemented until the wlroots MR is merged. If you're looking to show your support give the issue a thumbs up instead so that subscribers can track progress.

abihf commented 2 months ago

Btw, because Hyprland ship with its own wlroots, is it possible to patch wlroots with that MR?

@vaxerski I'm not familiar with color transformation, is there anything I can help?

My suggestion is first we enable hdr metadata on compositor level with sdr -> hdr tone mapping, next step will be protocol implementation so client can show their hdr contents.

vaxerski commented 2 months ago

we don't patch wlroots at all, we don't maintain a fork either. So, no.

Andorreta commented 2 months ago

Is there a way to enable our custom wlroots? Because when I try to enable the Vulkan renderer in my multi head setup, everything breaks 😆 And to use the Wayland HDR we need Vulkan (or at least trying with gamescope)

vaxerski commented 2 months ago

Is there a way to enable our custom wlroots?

No.

Because when I try to enable the Vulkan renderer in my multi head setup, everything breaks

Hyprland doesn't support vulkan as a backend

And to use the Wayland HDR we need Vulkan (or at least trying with gamescope)

This is false.

Andorreta commented 2 months ago

I don't know if vulkan is really needed, using wlroots directly. But acording to this post from a KDE developer, you need to install a vulkan layer to be able to use HDR to play the games in Kwin6 using HDR :smile:

If we (or i) can help in something, i could help code or reserach a bit more to see what's needed. The ENV variable that breaks Hyprland for me is env = WLR_RENDERER,vulkan . But without it i can't enable HDR in gamescope. If someone knows a way to enable HDR in gamescope using hyprland, please tell me :smile:

EDIT: in wlroots and sway they are testing adding color profiles. This is the MR https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4280

cajual commented 2 months ago

After reading this I'm wondering if I am missing something integral to the conversation.

  1. Up until today Hyprland was running in typical SDR, as expected. I use HighRes and 10-bit for my monitor, but otherwise it was showing as 3840x2160@120 VRR RGB 10b 4L10 SDR.
  2. SDDM was causing me issues and going to "no input" with X11, so I switched to Wayland and copied over my kwinoutputconfig.json to my SDDM config.
  3. SDDM now shows up on my screen without issue, but when I log-in to Hyprland, my monitor immediately shows the HDR logo and I see 3840x2160@120 VRR RGB 10b 4L10 HDR10.
  4. The color profile is pretty intense and RGB aliasing is pretty rough at 1:1 scaling, but I don't have any options to change it within Hyprland. I stumbled across this issue thread, so now I am wondering why Hyprland is showing as HDR.
  5. Disabling Wayland HDR support from Plasma does nothing.

Edit: Reverting SDDM did not return Hyprland to SDR.

vaxerski commented 2 months ago

kek drm did something funny.

I assume then that SDDM was running with KDE as a backend which supports HDR. Setting an HDR "mode" is the simple part of HDR and KWin probably submitted that to the pipeline

Hyprland doesn't support the HDR "mode" hints and thus can't change it.

That's my guess. Tho I have very little knowledge about HDR internals

cajual commented 2 months ago

I fixed it by strictly disabling HDR and Wide Color Gamut in the SDDM kwinoutputconfig.json file. This means there isn't any HDR in the pipeline for Hyprland. Finally have proper colors, and it doesn't affect my Plasma session HDR.

If anyone wants a hacky way to enable DE HDR on Hyprland...

ous50 commented 1 month ago

kek drm did something funny.

I assume then that SDDM was running with KDE as a backend which supports HDR. Setting an HDR "mode" is the simple part of HDR and KWin probably submitted that to the pipeline

Hyprland doesn't support the HDR "mode" hints and thus can't change it.

That's my guess. Tho I have very little knowledge about HDR internals

Enabling HDR in Plasmas 6 requires setting the following envrionment variables:

export KWIN_DRM_ALLOW_INTEL_COLORSPACE=1