Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDR support in Hyprland #4933

Open
Swomp2 opened this issue Mar 2, 2024 · 33 comments
Open

HDR support in Hyprland #4933

Swomp2 opened this issue Mar 2, 2024 · 33 comments
Labels
enhancement New feature or request

Comments

@Swomp2
Copy link

Swomp2 commented Mar 2, 2024

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?

@Swomp2 Swomp2 added the enhancement New feature or request label Mar 2, 2024
@vaxerski
Copy link
Member

vaxerski commented Mar 3, 2024

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

@Swomp2
Copy link
Author

Swomp2 commented Mar 3, 2024

Okay, thank you

@Swomp2 Swomp2 closed this as completed Mar 3, 2024
@nergdron
Copy link

nergdron commented Mar 4, 2024

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

@vaxerski
Copy link
Member

vaxerski commented Mar 4, 2024

merge request.

And please dont contribute an hdr display to me.

@nergdron
Copy link

nergdron commented Mar 5, 2024

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
Copy link
Member

vaxerski commented Mar 5, 2024

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
Copy link

crimist commented Mar 6, 2024

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
Copy link

crimist commented Mar 6, 2024

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
Copy link
Member

vaxerski commented Mar 6, 2024

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

@vaxerski vaxerski reopened this Mar 6, 2024
@Swomp2
Copy link
Author

Swomp2 commented Mar 7, 2024

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
Copy link
Member

vaxerski commented Mar 7, 2024

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

@abysssdweller
Copy link

HDR on hyprland would be crazy!

@ysimard94
Copy link

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
Copy link

crimist commented Mar 19, 2024

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
Copy link

abihf commented Apr 6, 2024

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
Copy link
Member

vaxerski commented Apr 6, 2024

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

@Andorreta
Copy link

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
Copy link
Member

vaxerski commented Apr 6, 2024

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
Copy link

Andorreta commented Apr 7, 2024

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 😄

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 😄

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
Copy link

cajual commented Apr 10, 2024

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
Copy link
Member

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
Copy link

cajual commented Apr 10, 2024

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
Copy link

ous50 commented May 26, 2024

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

@ducviet00
Copy link

Is there any update on this? That would be great if Hyprland supports HDR because I just ordered an HDR monitor (jk lol)

@vaxerski
Copy link
Member

not atm

@crimist
Copy link

crimist commented Jul 26, 2024

For subscribers: I believe HDR is no longer blocked on upstream wlroots since Hyprland migrated to aquamarine in #6608.
If you'd like to contribute HDR related features you can probably do so at https://github.com/hyprwm/aquamarine?

@vaxerski
Copy link
Member

correct, though worth noting it will require support in both aq and hl.

The first (easy) step would be to implement what KDE did - just the hdr profiles (not the actual data, IIRC that's still blocked on w-p mesa and kernel)

@Swomp2
Copy link
Author

Swomp2 commented Jul 26, 2024

WOW!!
I didn't know that you wrote new library, it's incredible work and I still hope that Hyprland will support HDR. Thank you all for your work, guys

@Ciel-MC
Copy link

Ciel-MC commented Aug 11, 2024

The only way I play HDR now is by switching to gamescope session, which has... quite a few inconveniences. Checked the post because I remembered that we're switching backends, so this is great to hear. Please call me when/if ever it's time for testing, thanks. (Or if there is work to be done I suppose, I can try but don't expect my C++ skills :p)

@proJM-Coding
Copy link

Sadly gamescope is not a solution for everyone as it doesn't work well with NVIDIA gpus. The gamescope session also doesn't work out of the box if you are not using systemd.

@littleblack111
Copy link
Contributor

correct, though worth noting it will require support in both aq and hl.

aren't those both owned by hyprwm? why can't we be like the KDE devs and implement it...

also do we need that protocol? Like other wayland protocols, will take forever to merge 😭

@vaxerski
Copy link
Member

why can't we be like the KDE devs and implement it...

because KDE has 50 full-time paid developers

@littleblack111
Copy link
Contributor

littleblack111 commented Sep 28, 2024

true...

EDIT: some other WMs already started working on it:
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/14#note_2144833
Smithay/smithay#1143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests