diff options
author | Maxime Ripard <maxime@cerno.tech> | 2021-04-30 11:44:50 +0200 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2021-05-07 17:14:59 +0200 |
commit | 21f79128e0a16e10fd0fa43485fdff01008e0296 (patch) | |
tree | 69fceed3e1e1ea1d9df0c8fb613773e0a6f3e524 /drivers/gpu/drm/drm_connector.c | |
parent | drm/vc4: Add HDR metadata property to the VC5 HDMI connectors (diff) | |
download | linux-dev-21f79128e0a16e10fd0fa43485fdff01008e0296.tar.xz linux-dev-21f79128e0a16e10fd0fa43485fdff01008e0296.zip |
drm/connector: Add a helper to attach the colorspace property
The intel driver uses the same logic to attach the Colorspace property
in multiple places and we'll need it in vc4 too. Let's move that common
code in a helper.
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210430094451.2145002-4-maxime@cerno.tech
Diffstat (limited to 'drivers/gpu/drm/drm_connector.c')
-rw-r--r-- | drivers/gpu/drm/drm_connector.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 7b2231b1661c..da39e7ff6965 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2174,6 +2174,26 @@ int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *conn EXPORT_SYMBOL(drm_connector_attach_hdr_output_metadata_property); /** + * drm_connector_attach_colorspace_property - attach "Colorspace" property + * @connector: connector to attach the property on. + * + * This is used to allow the userspace to signal the output colorspace + * to the driver. + * + * Returns: + * Zero on success, negative errno on failure. + */ +int drm_connector_attach_colorspace_property(struct drm_connector *connector) +{ + struct drm_property *prop = connector->colorspace_property; + + drm_object_attach_property(&connector->base, prop, DRM_MODE_COLORIMETRY_DEFAULT); + + return 0; +} +EXPORT_SYMBOL(drm_connector_attach_colorspace_property); + +/** * drm_connector_atomic_hdr_metadata_equal - checks if the hdr metadata changed * @old_state: old connector state to compare * @new_state: new connector state to compare |