summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@chromium.org>2017-07-06 15:40:05 +0900
committerchrome-bot <chrome-bot@chromium.org>2017-07-13 19:45:56 -0700
commit11f3d085d1bb5307960a71c99dde658823326d89 (patch)
tree59ac6d9ca12de91bbf9afec7b6fa3de4df84fab3
parentfd0b01640ed4bc022505717d7629c1ba4a731f54 (diff)
minigbm: Add GBM_BO_USE_CAMERA_{READ,WRITE} usage flags
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>
-rw-r--r--gbm.h8
-rw-r--r--gbm_helpers.c4
2 files changed, 12 insertions, 0 deletions
diff --git a/gbm.h b/gbm.h
index 312b098..5ec13bc 100644
--- 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
diff --git a/gbm_helpers.c b/gbm_helpers.c
index 2b9ce23..529d7fe 100644
--- a/gbm_helpers.c
+++ b/gbm_helpers.c
@@ -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;
}