[02/16] drm: Create Color Management DRM properties
diff mbox

Message ID 1436965780-6061-3-git-send-email-Kausal.Malladi@intel.com
State New
Headers show

Commit Message

Kausal Malladi July 15, 2015, 1:09 p.m. UTC
Color Management is an extension to Kernel display framework. It allows
abstraction of hardware color correction and enhancement capabilities by
virtue of DRM properties.

This patch initializes color management framework by :
1. Introducing new pointers in DRM mode_config structure to
   carry CTM and Palette color correction properties.
2. Creating these DRM properties in DRM standard properties creation
   sequence.

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Kausal Malladi <Kausal.Malladi@intel.com>
---
 drivers/gpu/drm/drm_crtc.c | 26 ++++++++++++++++++++++++++
 include/drm/drm_crtc.h     |  6 ++++++
 2 files changed, 32 insertions(+)

Comments

Thierry Reding July 15, 2015, 1:25 p.m. UTC | #1
On Wed, Jul 15, 2015 at 06:39:26PM +0530, Kausal Malladi wrote:
[...]
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 57ca8cc..408d39a 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1178,6 +1178,12 @@ struct drm_mode_config {
>  	struct drm_property *suggested_x_property;
>  	struct drm_property *suggested_y_property;
>  
> +	/* Color Management Properties */
> +	struct drm_property *prop_color_capabilities;
> +	struct drm_property *prop_palette_before_ctm;
> +	struct drm_property *prop_palette_after_ctm;
> +	struct drm_property *prop_ctm;

All existing properties are named *_property, and it'd be good to keep
things consistent by following that scheme. Perhaps they could have a
common prefix (cm_?) to group them?

Thierry
Sharma, Shashank July 15, 2015, 3:14 p.m. UTC | #2
Thanks for the comments, Thierry. 
We can surely do this. 

Regards
Shashank
-----Original Message-----
From: Thierry Reding [mailto:thierry.reding@gmail.com] 
Sent: Wednesday, July 15, 2015 6:55 PM
To: Malladi, Kausal
Cc: Roper, Matthew D; Barnes, Jesse; Lespiau, Damien; Jindal, Sonika; R, Durgadoss; Purushothaman, Vijay A; intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; hverkuil@xs4all.nl; daniel@fooishbar.org; Matheson, Annie J; Palleti, Avinash Reddy; Mukherjee, Indranil; R, Dhanya p; Kamath, Sunil; Vetter, Daniel; Bhattacharjee, Susanta; Kumar, Kiran S; Sharma, Shashank
Subject: Re: [PATCH 02/16] drm: Create Color Management DRM properties

On Wed, Jul 15, 2015 at 06:39:26PM +0530, Kausal Malladi wrote:
[...]
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 
> 57ca8cc..408d39a 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1178,6 +1178,12 @@ struct drm_mode_config {
>  	struct drm_property *suggested_x_property;
>  	struct drm_property *suggested_y_property;
>  
> +	/* Color Management Properties */
> +	struct drm_property *prop_color_capabilities;
> +	struct drm_property *prop_palette_before_ctm;
> +	struct drm_property *prop_palette_after_ctm;
> +	struct drm_property *prop_ctm;

All existing properties are named *_property, and it'd be good to keep things consistent by following that scheme. Perhaps they could have a common prefix (cm_?) to group them?

Thierry

Patch
diff mbox

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index a717d18..21da106 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1462,6 +1462,32 @@  static int drm_mode_create_standard_properties(struct drm_device *dev)
 		return -ENOMEM;
 	dev->mode_config.prop_mode_id = prop;
 
+	/* Color Management properties */
+	prop = drm_property_create(dev,
+			DRM_MODE_PROP_BLOB | DRM_MODE_PROP_IMMUTABLE,
+			"COLOR_CAPABILITIES", 0);
+	if (!prop)
+		return -ENOMEM;
+	dev->mode_config.prop_color_capabilities = prop;
+
+	prop = drm_property_create(dev,
+			DRM_MODE_PROP_BLOB, "PALETTE_AFTER_CTM", 0);
+	if (!prop)
+		return -ENOMEM;
+	dev->mode_config.prop_palette_after_ctm = prop;
+
+	prop = drm_property_create(dev,
+			DRM_MODE_PROP_BLOB, "PALETTE_BEFORE_CTM", 0);
+	if (!prop)
+		return -ENOMEM;
+	dev->mode_config.prop_palette_before_ctm = prop;
+
+	prop = drm_property_create(dev,
+			DRM_MODE_PROP_BLOB, "CTM", 0);
+	if (!prop)
+		return -ENOMEM;
+	dev->mode_config.prop_ctm = prop;
+
 	return 0;
 }
 
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 57ca8cc..408d39a 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1178,6 +1178,12 @@  struct drm_mode_config {
 	struct drm_property *suggested_x_property;
 	struct drm_property *suggested_y_property;
 
+	/* Color Management Properties */
+	struct drm_property *prop_color_capabilities;
+	struct drm_property *prop_palette_before_ctm;
+	struct drm_property *prop_palette_after_ctm;
+	struct drm_property *prop_ctm;
+
 	/* dumb ioctl parameters */
 	uint32_t preferred_depth, prefer_shadow;