mirror of
https://github.com/swaywm/sway.git
synced 2025-01-30 20:56:43 +00:00
Add support for BT2020 primaries
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4976
This commit is contained in:
parent
d093c2e358
commit
9e805f06f0
|
@ -90,7 +90,7 @@ struct cmd_results *output_cmd_color_profile(int argc, char **argv) {
|
|||
free(icc_path);
|
||||
|
||||
struct wlr_color_transform *tmp =
|
||||
wlr_color_transform_init_linear_to_icc(data, size);
|
||||
wlr_color_transform_init_linear_to_icc(WLR_COLOR_NAMED_PRIMARIES_SRGB, data, size);
|
||||
if (!tmp) {
|
||||
free(data);
|
||||
return cmd_results_new(CMD_FAILURE,
|
||||
|
|
|
@ -490,6 +490,15 @@ static void queue_output_config(struct output_config *oc,
|
|||
} else {
|
||||
wlr_output_state_set_render_format(pending, DRM_FORMAT_XRGB8888);
|
||||
}
|
||||
|
||||
if (oc && oc->color_transform == NULL && oc->render_bit_depth == RENDER_BIT_DEPTH_10 &&
|
||||
(wlr_output->supported_primaries & WLR_COLOR_NAMED_PRIMARIES_BT2020) &&
|
||||
server.renderer->features.output_color_transform) {
|
||||
const struct wlr_output_image_description image_desc = {
|
||||
.primaries = WLR_COLOR_NAMED_PRIMARIES_BT2020,
|
||||
};
|
||||
wlr_output_state_set_image_description(pending, &image_desc);
|
||||
}
|
||||
}
|
||||
|
||||
static bool finalize_output_config(struct output_config *oc, struct sway_output *output) {
|
||||
|
@ -549,6 +558,12 @@ static bool finalize_output_config(struct output_config *oc, struct sway_output
|
|||
output->color_transform = NULL;
|
||||
}
|
||||
|
||||
if (output->color_transform == NULL && oc && oc->render_bit_depth == RENDER_BIT_DEPTH_10 &&
|
||||
(wlr_output->supported_primaries & WLR_COLOR_NAMED_PRIMARIES_BT2020) &&
|
||||
server.renderer->features.output_color_transform) {
|
||||
output->color_transform = wlr_color_transform_init_srgb(WLR_COLOR_NAMED_PRIMARIES_BT2020);
|
||||
}
|
||||
|
||||
output->max_render_time = oc && oc->max_render_time > 0 ? oc->max_render_time : 0;
|
||||
output->allow_tearing = oc && oc->allow_tearing > 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue