backend: drm: Implement "force color format" property

This commit is contained in:
Andri Yngvason 2024-01-04 13:17:54 +00:00
parent 5cfcb0a490
commit acebd78b5f
3 changed files with 6 additions and 0 deletions

View file

@ -335,6 +335,10 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn,
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 && active && conn->props.force_color_format && state->base->color_format) {
uint32_t format = 1 << (state->base->color_format - 1);
atomic_add(&atom, conn->id, conn->props.force_color_format, format);
}
atomic_add(&atom, crtc->id, crtc->props.mode_id, mode_id);
atomic_add(&atom, crtc->id, crtc->props.active, active);
if (active) {

View file

@ -26,6 +26,7 @@ static const struct prop_info connector_info[] = {
{ "EDID", INDEX(edid) },
{ "PATH", INDEX(path) },
{ "content type", INDEX(content_type) },
{ "force color format", INDEX(force_color_format) },
{ "link-status", INDEX(link_status) },
{ "max bpc", INDEX(max_bpc) },
{ "non-desktop", INDEX(non_desktop) },

View file

@ -23,6 +23,7 @@ union wlr_drm_connector_props {
uint32_t panel_orientation; // not guaranteed to exist
uint32_t content_type; // not guaranteed to exist
uint32_t max_bpc; // not guaranteed to exist
uint32_t force_color_format; // not guaranteed to exist
// atomic-modesetting only