am 25ffbfe5: exynos: gralloc: implement gralloc_lock_ycbcr
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos5.git] / include / gralloc_priv.h
index 7cec618557c657e8e51ccc593cc48ab9a6f07511..416101c934571062f927d18b4e267a9a293b2421 100644 (file)
 
 struct private_module_t;
 struct private_handle_t;
+typedef int ion_user_handle_t;
 
 struct private_module_t {
     gralloc_module_t base;
 
-    private_handle_t* framebuffer;
+    struct private_handle_t* framebuffer;
     uint32_t flags;
     uint32_t numBuffers;
     uint32_t bufferMask;
     pthread_mutex_t lock;
+    unsigned int refcount;
     buffer_handle_t currentBuffer;
     int ionfd;
 
@@ -65,6 +67,9 @@ struct private_handle_t {
     struct native_handle nativeHandle;
 #endif
 
+// set if using video encoding colorspace
+#define GRALLOC_USAGE_PRIVATE_CHROMA (GRALLOC_USAGE_PRIVATE_0)
+
     enum {
         PRIV_FLAGS_FRAMEBUFFER = 0x00000001,
         PRIV_FLAGS_USES_UMP    = 0x00000002,
@@ -86,18 +91,20 @@ struct private_handle_t {
     int     height;
     int     stride;
     int     vstride;
+    int     gamut;
+    int     chroma;
 
     // FIXME: the attributes below should be out-of-line
     void    *base;
     void    *base1;
     void    *base2;
-    struct ion_handle *handle;
-    struct ion_handle *handle1;
-    struct ion_handle *handle2;
+    ion_user_handle_t handle;
+    ion_user_handle_t handle1;
+    ion_user_handle_t handle2;
 
 #ifdef __cplusplus
     static const int sNumFds = 3;
-    static const int sNumInts = 15;
+    static const int sNumInts = 17;
     static const int sMagic = 0x3141592;
 
 
@@ -105,7 +112,8 @@ struct private_handle_t {
                     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), chroma(0), base(0), handle(0), handle1(0),
+        handle2(0)
     {
         version = sizeof(native_handle);
         numInts = sNumInts + 2;
@@ -116,8 +124,8 @@ struct private_handle_t {
                     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), chroma(0), base(0), base1(0), base2(0),
+        handle(0), handle1(0), handle2(0)
     {
         version = sizeof(native_handle);
         numInts = sNumInts + 1;
@@ -128,8 +136,8 @@ struct private_handle_t {
                     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), chroma(0), base(0), base1(0), base2(0),
+        handle(0), handle1(0), handle2(0)
     {
         version = sizeof(native_handle);
         numInts = sNumInts;