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>
This commit is contained in:
Tomasz Figa 2017-07-06 15:40:05 +09:00 committed by chrome-bot
parent fd0b01640e
commit 11f3d085d1
2 changed files with 12 additions and 0 deletions

8
gbm.h
View file

@ -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

View 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;
}