From c624692ed4475924ce94841b8c0de174a148e815 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Wed, 29 Apr 2015 23:09:50 +0800 Subject: gralloc_drm: make GRALLOC_USAGE_SW_READ_OFTEN be a valid usage It allows the camera to get a lock on the buffer. This is required when a picture is taken. Credited to Edgardo Gho . --- gralloc_drm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gralloc_drm.c b/gralloc_drm.c index 0f1ce72..3478dde 100644 --- a/gralloc_drm.c +++ b/gralloc_drm.c @@ -398,8 +398,9 @@ int gralloc_drm_bo_lock(struct gralloc_drm_bo_t *bo, if ((bo->handle->usage & usage) != usage) { /* make FB special for testing software renderer with */ - if (!(bo->handle->usage & GRALLOC_USAGE_HW_FB) - && !(bo->handle->usage & GRALLOC_USAGE_HW_TEXTURE)) { + if (!(bo->handle->usage & GRALLOC_USAGE_SW_READ_OFTEN) && + !(bo->handle->usage & GRALLOC_USAGE_HW_FB) && + !(bo->handle->usage & GRALLOC_USAGE_HW_TEXTURE)) { ALOGE("bo.usage:x%X/usage:x%X is not GRALLOC_USAGE_HW_FB or GRALLOC_USAGE_HW_TEXTURE" ,bo->handle->usage,usage); return -EINVAL; -- cgit v1.1