1
0
Fork 0
forked from wry/wry

head-management: add drm-color-space-setter-v1 extension

This commit is contained in:
Julian Orth 2025-07-14 16:23:45 +02:00
parent 15e68fc551
commit 1a306c4fa9
7 changed files with 187 additions and 0 deletions

View file

@ -267,6 +267,8 @@ impl JayHeadManagerSessionV1 {
new.mode = desired.mode;
new.non_desktop_override = desired.override_non_desktop;
new.format = desired.format;
new.color_space = desired.color_space;
new.transfer_function = desired.transfer_function;
if old == new {
continue;
}
@ -389,6 +391,7 @@ impl JayHeadManagerSessionV1RequestHandler for JayHeadManagerSessionV1 {
VRR_MODE_INFO = 1 << 8,
TEARING_MODE_INFO = 1 << 9,
FORMAT_INFO = 1 << 10,
DRM_COLOR_SPACE_INFO = 1 << 11,
COMPOSITOR_SPACE_INFO_ENABLED = 1 << 13,
}
for head in self.heads.lock().values() {
@ -446,6 +449,14 @@ impl JayHeadManagerSessionV1RequestHandler for JayHeadManagerSessionV1 {
state.format = f;
to_send |= FORMAT_INFO;
}
HeadOp::SetTransferFunction(e) => {
state.transfer_function = e;
to_send |= DRM_COLOR_SPACE_INFO;
}
HeadOp::SetColorSpace(c) => {
state.color_space = c;
to_send |= DRM_COLOR_SPACE_INFO;
}
}
}
if to_send.contains(CORE_INFO)
@ -499,6 +510,11 @@ impl JayHeadManagerSessionV1RequestHandler for JayHeadManagerSessionV1 {
{
i.send_format(state);
}
if to_send.contains(DRM_COLOR_SPACE_INFO)
&& let Some(i) = &head.ext.drm_color_space_info_v1
{
i.send_state(state);
}
}
slf.schedule_transaction_result(req.result, None)?;
Ok(())