-
Notifications
You must be signed in to change notification settings - Fork 3k
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
wayland: add support for frog-color-management-v1 #14917
Conversation
I think so, we have to in order to resolve issues like #14592. There's no reason for |
2d0e00a
to
066c18e
Compare
I've separated the general colorspace and hdr metadata parts now. |
f89dc70
to
3fcbe75
Compare
Download the artifacts for this pull request: |
Tested a bit on KWin 6.1.5. Some observations:
|
@@ -1025,6 +1025,8 @@ endforeach | |||
features += {'wayland': wayland_deps and wayland['header'] and wayland['scanner'].found()} | |||
|
|||
if features['wayland'] | |||
frog_protocols = dependency('frog-protocols', required: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add meson wrap for those? I think this is recommended way of importing protocols. We could do the same as https://gitlab.freedesktop.org/mesa/mesa/-/blob/e328df0c575a5c193001d06c5659a70d7c071f62/subprojects/frog-protocols.wrap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well distros are already packaging it. I don't know if we have a stance on including wraps yet. Last time we tried a wrap didn't go so well but maybe we just did it wrong.
9899374
to
ca92430
Compare
ca92430
to
0b85efc
Compare
I am curious, is there any reason to use frog color management and not xx_color_management? IIRC xx color management is a copy of the PR for upstream and both are supported by kwin. |
I'm actually literally working on an xx-color-management-v4 branch right now. |
@@ -610,6 +610,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) | |||
|
|||
pts = frame->current ? frame->current->pts : 0; | |||
if (frame->current) { | |||
vo_wayland_handle_hdr_metadata(wl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dmabuf-wayland dont have wl->vo->target_params
, which would cause a access to null pointer in vo_wayland_handle_hdr_metadata
. thats why im using frame->current->params
in #14865 . can we workaround it like this?
vo_wayland_handle_hdr_metadata(wl); | |
wl->vo->target_params = &frame->current->params; | |
vo_wayland_handle_hdr_metadata(wl); |
https://invent.kde.org/plasma/kwin/-/merge_requests/6138 can be used for testing hdr on sdr display |
I'm probably not going to merge this since #14936 does the same and more. |
62abae8
to
b4d4fb7
Compare
a02fd04
to
184dc7d
Compare
1e16e44
to
38effe3
Compare
The big color-management MR in wayland-protocols has been in development for a very long time and honestly that protocol is super complex and painful to parse. The frog protocol stuff is relatively new but it turns out that kwin actually has support for this. Additionally, Arch and Fedora even package these protocols. Given that mpv is certainly a client that benefits from color stuff, it's not too much work to plug in this simple protocol so users can actually start using it. This adds an --wayland-colorspace-hint option which passes hdr metadata to the compositor. Unlike the existing solution (using vulkan), this is completely graphics API agnostic and will work with any wayland backend.
38effe3
to
0b902c4
Compare
Not sure this has any real utility when compared to xx-color-management, so will close for now. We can revisit later if for some reason it turns out this is useful. |
Completely untested. I don't even own any HDR displays. In theory, this should do something on Kwin which supports this protocol (didn't check if that is in a release or not yet). Basically this uses
frog-color-management
to implement a--wayland-colorspace-hint
option which is a graphics API-independent way to pass HDR metadata to the compositor.Some obvious questions (not an exhaustive list) that need to be answered.
--target-colorspace-hint
and--wayland-colorpace-hint
at the same timefrog_color_managed_surface_set_hdr_metadata
doesn't seem to have an obvious way to "unset" itself; is simply setting the primaries and transfer function back to unknown sufficient?wl->surface
for the frog color surface, but does that even work for dmabuf-wayland (which uses multiple subsurface)?Any feedback and testing much appreciated. Probably should split the primaries/transfer part from the hdr metadata part now that I look at it again.