@@ -1490,6 +1490,19 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)
return -ENOMEM;
dev->mode_config.cm_ctm_property = prop;
+ /* DRM properties to query color capabilities */
+ prop = drm_property_create(dev, DRM_MODE_PROP_IMMUTABLE,
+ "COEFFICIENTS_BEFORE_CTM", 0);
+ if (!prop)
+ return -ENOMEM;
+ dev->mode_config.cm_coeff_before_ctm_property = prop;
+
+ prop = drm_property_create(dev, DRM_MODE_PROP_IMMUTABLE,
+ "COEFFICIENTS_AFTER_CTM", 0);
+ if (!prop)
+ return -ENOMEM;
+ dev->mode_config.cm_coeff_after_ctm_property = prop;
+
return 0;
}
@@ -1153,6 +1153,10 @@ struct drm_mode_config {
struct drm_property *cm_palette_after_ctm_property;
struct drm_property *cm_ctm_property;
+ /* Color management capabilities query */
+ struct drm_property *cm_coeff_before_ctm_property;
+ struct drm_property *cm_coeff_after_ctm_property;
+
/* dumb ioctl parameters */
uint32_t preferred_depth, prefer_shadow;
DRM color management is written to extract the color correction capabilities of various platforms, and every platform can showcase its capabilities using the query properties. Different hardwares can have different no of coefficients for palette correction. Also the correction can be applied after/before color transformation (CTM) unit in the display pipeline. This patch adds two new read-only properties, - cm_coeff_before_ctm_property: A platform driver should use this property to show supported no_of_coefficients for palette correction, which gets applied before ctm correction. - cm_coeff_after_ctm_property: A platform driver should use this property to show supported no_of_coefficients for palette correction, which gets applied after ctm correction. Signed-off-by: Shashank Sharma <shashank.sharma@intel.com> --- drivers/gpu/drm/drm_crtc.c | 13 +++++++++++++ include/drm/drm_crtc.h | 4 ++++ 2 files changed, 17 insertions(+)