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
|
|
@ -401,6 +401,7 @@ bool drm_atomic_connector_prepare(struct wlr_drm_connector_state *state, bool mo
|
|||
state->vrr_enabled = vrr_enabled;
|
||||
state->colorspace = colorspace;
|
||||
state->hdr_output_metadata = hdr_output_metadata;
|
||||
state->color_format = state->base->color_format;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -567,6 +568,10 @@ static void atomic_connector_add(struct atomic *atom,
|
|||
if (modeset && active && conn->props.max_bpc != 0 && conn->max_bpc_bounds[1] != 0) {
|
||||
atomic_add(atom, conn->id, conn->props.max_bpc, pick_max_bpc(conn, state->primary_fb));
|
||||
}
|
||||
if (modeset && conn->props.color_format != 0 &&
|
||||
state->base->committed & WLR_OUTPUT_STATE_COLOR_FORMAT) {
|
||||
atomic_add(atom, conn->id, conn->props.color_format, state->color_format);
|
||||
}
|
||||
if (conn->props.colorspace != 0) {
|
||||
atomic_add(atom, conn->id, conn->props.colorspace, state->colorspace);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ static const uint32_t COMMIT_OUTPUT_STATE =
|
|||
WLR_OUTPUT_STATE_SIGNAL_TIMELINE |
|
||||
WLR_OUTPUT_STATE_COLOR_TRANSFORM |
|
||||
WLR_OUTPUT_STATE_IMAGE_DESCRIPTION |
|
||||
WLR_OUTPUT_STATE_COLOR_REPRESENTATION;
|
||||
WLR_OUTPUT_STATE_COLOR_REPRESENTATION |
|
||||
WLR_OUTPUT_STATE_COLOR_FORMAT;
|
||||
|
||||
static const uint32_t SUPPORTED_OUTPUT_STATE =
|
||||
WLR_OUTPUT_STATE_BACKEND_OPTIONAL | COMMIT_OUTPUT_STATE;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ static const struct prop_info connector_info[] = {
|
|||
{ "EDID", INDEX(edid) },
|
||||
{ "HDR_OUTPUT_METADATA", INDEX(hdr_output_metadata) },
|
||||
{ "PATH", INDEX(path) },
|
||||
{ "color format", INDEX(color_format) },
|
||||
{ "content type", INDEX(content_type) },
|
||||
{ "link-status", INDEX(link_status) },
|
||||
{ "max bpc", INDEX(max_bpc) },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue