summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Wei Huang <cwhuang@linux.org.tw>2015-04-29 23:09:50 +0800
committerChih-Wei Huang <cwhuang@linux.org.tw>2015-04-30 00:12:15 +0800
commitc624692ed4475924ce94841b8c0de174a148e815 (patch)
tree588e99521ece576142f7a3570ff35cee56c33a39
parent94f0840be9b9e0f6c37281222b7730c1b438a6a3 (diff)
downloadexternal_drm_gralloc-c624692ed4475924ce94841b8c0de174a148e815.zip
external_drm_gralloc-c624692ed4475924ce94841b8c0de174a148e815.tar.gz
external_drm_gralloc-c624692ed4475924ce94841b8c0de174a148e815.tar.bz2
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 <edgardogho@gmail.com>.
-rw-r--r--gralloc_drm.c5
1 files 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;