mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-06-14 14:32:57 -04:00
output: add color_format state field
Adds wlr_output_color_format (AUTO, RGB444, YCBCR444, YCBCR422, YCBCR420) matching the DRM connector color format property. The DRM backend discovers and sets this property on modeset. The wlr-output-management-unstable-v1 protocol is extended to version 5 with a color_format enum and set_color_format request, allowing clients to configure the output color encoding.
This commit is contained in:
parent
e4a1268b2a
commit
4fe9e0cfe8
11 changed files with 135 additions and 7 deletions
|
|
@ -216,6 +216,10 @@ static void output_apply_state(struct wlr_output *output,
|
|||
output->render_format = state->render_format;
|
||||
}
|
||||
|
||||
if (state->committed & WLR_OUTPUT_STATE_COLOR_FORMAT) {
|
||||
output->color_format = state->color_format;
|
||||
}
|
||||
|
||||
if (state->committed & WLR_OUTPUT_STATE_SUBPIXEL) {
|
||||
output->subpixel = state->subpixel;
|
||||
}
|
||||
|
|
@ -357,6 +361,7 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
|
|||
.impl = impl,
|
||||
.event_loop = event_loop,
|
||||
.render_format = DRM_FORMAT_XRGB8888,
|
||||
.color_format = WLR_OUTPUT_COLOR_FORMAT_AUTO,
|
||||
.transform = WL_OUTPUT_TRANSFORM_NORMAL,
|
||||
.scale = 1,
|
||||
.commit_seq = 0,
|
||||
|
|
@ -590,6 +595,10 @@ static uint32_t output_compare_state(struct wlr_output *output,
|
|||
output->color_range == state->color_range) {
|
||||
fields |= WLR_OUTPUT_STATE_COLOR_REPRESENTATION;
|
||||
}
|
||||
if ((state->committed & WLR_OUTPUT_STATE_COLOR_FORMAT) &&
|
||||
output->color_format == state->color_format) {
|
||||
fields |= WLR_OUTPUT_STATE_COLOR_FORMAT;
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,12 @@ void wlr_output_state_set_layers(struct wlr_output_state *state,
|
|||
state->layers_len = layers_len;
|
||||
}
|
||||
|
||||
void wlr_output_state_set_color_format(struct wlr_output_state *state,
|
||||
enum wlr_output_color_format color_format) {
|
||||
state->committed |= WLR_OUTPUT_STATE_COLOR_FORMAT;
|
||||
state->color_format = color_format;
|
||||
}
|
||||
|
||||
void wlr_output_state_set_wait_timeline(struct wlr_output_state *state,
|
||||
struct wlr_drm_syncobj_timeline *timeline, uint64_t src_point) {
|
||||
state->committed |= WLR_OUTPUT_STATE_WAIT_TIMELINE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue