Re: [Intel-gfx] [PATCH 4/7] drm: Add Gamma correction structure

2015-06-02 Thread Jindal, Sonika



On 6/2/2015 1:22 AM, Kausal Malladi wrote:

From: Kausal Malladi kausal.mall...@intel.com

This patch adds a new structure in DRM layer for Gamma color correction.
This structure will be used by all user space agents to configure
appropriate Gamma precision and Gamma level.

struct drm_intel_gamma {
__u32 flags;
(The flag variable will indicate if the property to be set/get
is Gamma or DeGamma)
__u32 gamma_level;
(The gamma_level variable indicates if the Gamma correction is to be
applied on Pipe/plane)
__u32 gamma_precision;
(The Gamma precision indicates the Gamma mode to be applied)

Supported precisions are -
#define I915_GAMMA_PRECISION_UNKNOWN0
#define I915_GAMMA_PRECISION_CURRENT0x
#define I915_GAMMA_PRECISION_LEGACY (1  0)
#define I915_GAMMA_PRECISION_10BIT  (1  1)
#define I915_GAMMA_PRECISION_12BIT  (1  2)
#define I915_GAMMA_PRECISION_14BIT  (1  3)
#define I915_GAMMA_PRECISION_16BIT  (1  4)

__u32 num_samples;
(The num_samples indicates the number of Gamma correction
coefficients)
__u32 reserved;
__u64 gamma_ptr;
(Points to the raw Gamma color correction values)
};

Signed-off-by: Shashank Sharma shashank.sha...@intel.com
Signed-off-by: Kausal Malladi kausal.mall...@intel.com
---
  include/uapi/drm/drm.h |   11 +++
  1 file changed, 11 insertions(+)

diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 3801584..fe27e5c 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -829,6 +829,17 @@ struct drm_event_vblank {
__u32 reserved;
  };

+/* Color Management structure for Gamma */
+struct drm_intel_gamma {
I suppose, this can be used by other drivers as well? If yes, intel 
can be removed.

+   __u32 obj_id;
+   __u32 flags;
+   __u32 gamma_level;
+   __u32 gamma_precision;
+   __u32 num_samples;
+   __u32 reserved;
+   __u64 gamma_ptr;
+};
+
  /* typedef area */
  #ifndef __KERNEL__
  typedef struct drm_clip_rect drm_clip_rect_t;


___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 4/7] drm: Add Gamma correction structure

2015-06-02 Thread Daniel Stone
Hi,

On 2 June 2015 at 12:25, Jindal, Sonika sonika.jin...@intel.com wrote:
 On 6/2/2015 1:22 AM, Kausal Malladi wrote:
 struct drm_intel_gamma {
 __u32 flags;
 (The flag variable will indicate if the property to be set/get
 is Gamma or DeGamma)
 __u32 gamma_level;
 (The gamma_level variable indicates if the Gamma correction is to
 be
 applied on Pipe/plane)
 __u32 gamma_precision;
 (The Gamma precision indicates the Gamma mode to be applied)

 Supported precisions are -
 #define I915_GAMMA_PRECISION_UNKNOWN0
 #define I915_GAMMA_PRECISION_CURRENT0x
 #define I915_GAMMA_PRECISION_LEGACY (1  0)
 #define I915_GAMMA_PRECISION_10BIT  (1  1)
 #define I915_GAMMA_PRECISION_12BIT  (1  2)
 #define I915_GAMMA_PRECISION_14BIT  (1  3)
 #define I915_GAMMA_PRECISION_16BIT  (1  4)

 __u32 num_samples;
 (The num_samples indicates the number of Gamma correction
 coefficients)
 __u32 reserved;
 __u64 gamma_ptr;
 (Points to the raw Gamma color correction values)
 };

Please use the atomic interface and blob properties for this instead.
A user-created blob property can replace the contents of gamma_ptr,
you can replace gamma_level by choosing whether you apply the
properties to a CRTC (pipe) or plane, and then you just need separate
properties for precision and num_samples.

Cheers,
Daniel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx