aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_connector.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_connector.c')
-rw-r--r--drivers/gpu/drm/drm_connector.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index aa18b1d7d3e4..fa9baacc863b 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -932,6 +932,13 @@ DRM_ENUM_NAME_FN(drm_get_content_protection_name, drm_cp_enum_list)
932 * is no longer protected and userspace should take appropriate action 932 * is no longer protected and userspace should take appropriate action
933 * (whatever that might be). 933 * (whatever that might be).
934 * 934 *
935 * max bpc:
936 * This range property is used by userspace to limit the bit depth. When
937 * used the driver would limit the bpc in accordance with the valid range
938 * supported by the hardware and sink. Drivers to use the function
939 * drm_connector_attach_max_bpc_property() to create and attach the
940 * property to the connector during initialization.
941 *
935 * Connectors also have one standardized atomic property: 942 * Connectors also have one standardized atomic property:
936 * 943 *
937 * CRTC_ID: 944 * CRTC_ID:
@@ -1600,6 +1607,40 @@ void drm_connector_set_link_status_property(struct drm_connector *connector,
1600EXPORT_SYMBOL(drm_connector_set_link_status_property); 1607EXPORT_SYMBOL(drm_connector_set_link_status_property);
1601 1608
1602/** 1609/**
1610 * drm_connector_attach_max_bpc_property - attach "max bpc" property
1611 * @connector: connector to attach max bpc property on.
1612 * @min: The minimum bit depth supported by the connector.
1613 * @max: The maximum bit depth supported by the connector.
1614 *
1615 * This is used to add support for limiting the bit depth on a connector.
1616 *
1617 * Returns:
1618 * Zero on success, negative errno on failure.
1619 */
1620int drm_connector_attach_max_bpc_property(struct drm_connector *connector,
1621 int min, int max)
1622{
1623 struct drm_device *dev = connector->dev;
1624 struct drm_property *prop;
1625
1626 prop = connector->max_bpc_property;
1627 if (!prop) {
1628 prop = drm_property_create_range(dev, 0, "max bpc", min, max);
1629 if (!prop)
1630 return -ENOMEM;
1631
1632 connector->max_bpc_property = prop;
1633 }
1634
1635 drm_object_attach_property(&connector->base, prop, max);
1636 connector->state->max_requested_bpc = max;
1637 connector->state->max_bpc = max;
1638
1639 return 0;
1640}
1641EXPORT_SYMBOL(drm_connector_attach_max_bpc_property);
1642
1643/**
1603 * drm_connector_init_panel_orientation_property - 1644 * drm_connector_init_panel_orientation_property -
1604 * initialize the connecters panel_orientation property 1645 * initialize the connecters panel_orientation property
1605 * @connector: connector for which to init the panel-orientation property. 1646 * @connector: connector for which to init the panel-orientation property.