mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 15:28:08 +02:00
backend-drm: Add 'link bpc' connector property
The 'link bpc' DRM connector property can be used to retrieve the physical bpc value. This property can be used to find out the physical link value as drivers will try to lower the bpc value when creaing an optimal output. If we detect change we would notify the user if the value set with 'max bpc' would be different than that of 'link bpc'. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
8ea328471b
commit
a37b496737
3 changed files with 25 additions and 0 deletions
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3891,6 +3891,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,
|
||||
|
|
@ -3918,6 +3938,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
|
||||
|
|
|
|||
|
|
@ -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[] = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue