Merge branch 'wip/mvlad/link-bpc' into 'main'

Draft: backend-drm: Add 'link bpc' connector property

See merge request wayland/weston!1850
This commit is contained in:
Marius Vlad 2026-05-05 17:09:28 +03:00
commit 54e48ab17c
3 changed files with 30 additions and 0 deletions

View file

@ -124,6 +124,7 @@ enum wdrm_connector_property {
WDRM_CONNECTOR_CONTENT_TYPE,
WDRM_CONNECTOR_COLORSPACE,
WDRM_CONNECTOR_VRR_CAPABLE,
WDRM_CONNECTOR_LINK_BPC,
WDRM_CONNECTOR__COUNT
};

View file

@ -4022,6 +4022,26 @@ drm_connector_find_property_by_id(struct drm_connector *connector,
return prop;
}
static void
weston_head_verify_bpc_status(struct drm_head *head)
{
unsigned int link_bpc;
unsigned int current_max_bpc;
link_bpc = drm_property_get_value(&head->connector.props[WDRM_CONNECTOR_LINK_BPC],
head->connector.props_drm, 0);
/* inherited_max_bpc is used only at head creation or if max_bpc
* is not set by the user. Further more user might supply a different
* max_bpc than one in the range. */
current_max_bpc = drm_property_get_value(&head->connector.props[WDRM_CONNECTOR_MAX_BPC],
head->connector.props_drm, 0);
if (current_max_bpc != link_bpc)
weston_log("WARNING: max bpc was set to %u but current link bpc "
"set to %u\n", current_max_bpc, link_bpc);
}
static void
drm_backend_update_conn_props(struct drm_backend *b,
struct drm_device *device,
@ -4049,6 +4069,9 @@ drm_backend_update_conn_props(struct drm_backend *b,
weston_head_set_content_protection_status(&head->base,
drm_head_get_current_protection(head));
}
if (conn_prop == WDRM_CONNECTOR_LINK_BPC)
weston_head_verify_bpc_status(head);
}
static int

View file

@ -252,6 +252,7 @@ const struct drm_property_info connector_props[] = {
[WDRM_CONNECTOR_VRR_CAPABLE] = {
.name = "vrr_capable",
},
[WDRM_CONNECTOR_LINK_BPC] = { .name = "link bpc", },
};
const struct drm_property_info crtc_props[] = {
@ -1203,6 +1204,11 @@ drm_connector_set_max_bpc(struct drm_connector *connector,
assert(a <= b);
max_bpc = MAX(a, MIN(output->max_bpc, b));
if (max_bpc != output->max_bpc)
weston_log("Warning: user-specified 'max_bpc' %u, "
"outside of range: [%"PRIu64", %"PRIu64"]. "
"Using 'max_bpc': %"PRIu64"\n", output->max_bpc,
a, b, max_bpc);
}
return connector_add_prop(req, connector,