67 lines
2.5 KiB
Diff
67 lines
2.5 KiB
Diff
From a7f87202ec94410eabff8df2f4fced0141794a9a Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
Date: Fri, 9 Apr 2021 17:07:32 +0200
|
|
Subject: [PATCH] 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.
|
|
|
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
|
---
|
|
drivers/gpu/drm/drm_connector.c | 20 +++++++++++++++++++
|
|
.../gpu/drm/i915/display/intel_connector.c | 3 +--
|
|
include/drm/drm_connector.h | 1 +
|
|
3 files changed, 22 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/gpu/drm/drm_connector.c
|
|
+++ b/drivers/gpu/drm/drm_connector.c
|
|
@@ -2165,6 +2165,26 @@ int drm_connector_attach_hdr_output_meta
|
|
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
|
|
--- a/drivers/gpu/drm/i915/display/intel_connector.c
|
|
+++ b/drivers/gpu/drm/i915/display/intel_connector.c
|
|
@@ -297,6 +297,5 @@ intel_attach_colorspace_property(struct
|
|
return;
|
|
}
|
|
|
|
- drm_object_attach_property(&connector->base,
|
|
- connector->colorspace_property, 0);
|
|
+ drm_connector_attach_colorspace_property(connector);
|
|
}
|
|
--- a/include/drm/drm_connector.h
|
|
+++ b/include/drm/drm_connector.h
|
|
@@ -1622,6 +1622,7 @@ int drm_connector_attach_scaling_mode_pr
|
|
u32 scaling_mode_mask);
|
|
int drm_connector_attach_vrr_capable_property(
|
|
struct drm_connector *connector);
|
|
+int drm_connector_attach_colorspace_property(struct drm_connector *connector);
|
|
int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector);
|
|
bool drm_connector_atomic_hdr_metadata_equal(struct drm_connector_state *old_state,
|
|
struct drm_connector_state *new_state);
|