OSDN Git Service

minigbm: Add GBM_BO_USE_CAMERA_{READ,WRITE} usage flags
authorTomasz Figa <tfiga@chromium.org>
Thu, 6 Jul 2017 06:40:05 +0000 (15:40 +0900)
committerchrome-bot <chrome-bot@chromium.org>
Fri, 14 Jul 2017 02:45:56 +0000 (19:45 -0700)
Add a new GBM usage flag for buffers used a output for camera subsystem.
It corresponds to Android GRALLOC_USAGE_HW_CAMERA_{READ,WRITE} flags and
translates to the same BO_USE_HW_CAMERA_{READ,WRITE} flags of drv.

BUG=b:62358788
TEST=compile

Change-Id: Ib7063437e39d1e08f643763c6ce383ce8657f5ce
Reviewed-on: https://chromium-review.googlesource.com/560935
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
gbm.h
gbm_helpers.c

diff --git a/gbm.h b/gbm.h
index 312b098..5ec13bc 100644 (file)
--- a/gbm.h
+++ b/gbm.h
@@ -243,6 +243,14 @@ enum gbm_bo_flags {
     * The buffer will be used as a texture that will be sampled from.
     */
    GBM_BO_USE_TEXTURING    = (1 << 5),
+   /**
+    * The buffer will be written to by a camera subsystem.
+    */
+   GBM_BO_USE_CAMERA_WRITE = (1 << 6),
+   /**
+    * The buffer will be read from by a camera subsystem.
+    */
+   GBM_BO_USE_CAMERA_READ = (1 << 7),
 };
 
 int
index 2b9ce23..529d7fe 100644 (file)
@@ -26,6 +26,10 @@ uint64_t gbm_convert_flags(uint32_t flags)
                usage |= BO_USE_TEXTURE;
        if (flags & GBM_BO_USE_LINEAR)
                usage |= BO_USE_LINEAR;
+       if (flags & GBM_BO_USE_CAMERA_WRITE)
+               usage |= BO_USE_CAMERA_WRITE;
+       if (flags & GBM_BO_USE_CAMERA_READ)
+               usage |= BO_USE_CAMERA_READ;
 
        return usage;
 }