gralloc: add private field to indicate gamut

Differentiate between YUV buffers with JFIF and BT.601 gamuts (value
ranges).

Bug: 7985212
Change-Id: I91c3d97858b4d2a54e2d2c67e3417715024561bb
diff --git a/include/exynos_format.h b/include/exynos_format.h
index 610c89d..01c4657 100644
--- a/include/exynos_format.h
+++ b/include/exynos_format.h
@@ -48,6 +48,15 @@
     HAL_PIXEL_FORMAT_CUSTOM_MAX
 };
 
+// Colorspace Gamuts
+enum {
+    HAL_PIXEL_GAMUT_DEFAULT = 0,
+    // Values range 0-255
+    HAL_PIXEL_GAMUT_JFIF_8,
+    // Values range 16-235
+    HAL_PIXEL_GAMUT_BT601_8
+};
+
 struct ADDRS {
     unsigned int addr_y;
     unsigned int addr_cbcr;
diff --git a/include/gralloc_priv.h b/include/gralloc_priv.h
index e831c0d..7a1e3e0 100644
--- a/include/gralloc_priv.h
+++ b/include/gralloc_priv.h
@@ -86,6 +86,7 @@
     int     height;
     int     stride;
     int     vstride;
+    int     gamut;
 
     // FIXME: the attributes below should be out-of-line
     void    *base;
@@ -97,7 +98,7 @@
 
 #ifdef __cplusplus
     static const int sNumFds = 3;
-    static const int sNumInts = 15;
+    static const int sNumInts = 16;
     static const int sMagic = 0x3141592;
 
 
@@ -105,7 +106,7 @@
 		     int h, int format, int stride, int vstride) :
         fd(fd), fd1(-1), fd2(-1), magic(sMagic), flags(flags), size(size),
         offset(0), format(format), width(w), height(h), stride(stride),
-        vstride(vstride), base(0), handle(0), handle1(0), handle2(0)
+        vstride(vstride), gamut(0), base(0), handle(0), handle1(0), handle2(0)
     {
         version = sizeof(native_handle);
         numInts = sNumInts + 2;
@@ -116,8 +117,8 @@
 		     int h, int format, int stride, int vstride) :
         fd(fd), fd1(fd1), fd2(-1), magic(sMagic), flags(flags), size(size),
         offset(0), format(format), width(w), height(h), stride(stride),
-        vstride(vstride), base(0), base1(0), base2(0), handle(0), handle1(0),
-        handle2(0)
+        vstride(vstride), gamut(0), base(0), base1(0), base2(0), handle(0),
+        handle1(0), handle2(0)
     {
         version = sizeof(native_handle);
         numInts = sNumInts + 1;
@@ -128,8 +129,8 @@
 		     int h, int format, int stride, int vstride) :
         fd(fd), fd1(fd1), fd2(fd2), magic(sMagic), flags(flags), size(size),
         offset(0), format(format), width(w), height(h), stride(stride),
-        vstride(vstride), base(0), base1(0), base2(0), handle(0), handle1(0),
-        handle2(0)
+        vstride(vstride), gamut(0), base(0), base1(0), base2(0), handle(0),
+        handle1(0), handle2(0)
     {
         version = sizeof(native_handle);
         numInts = sNumInts;