summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Marius Negreanu <adrian.m.negreanu@intel.com>2013-01-18 15:12:19 +0200
committerAdrian Marius Negreanu <adrian.m.negreanu@intel.com>2013-01-18 15:12:19 +0200
commit65a831d46cf14a85d523f386736ba0721b0d790b (patch)
tree3532cdcb467f032b04c414ed11427bc4848ede57
parent16a747a9e551f462e559b14844fd20c3cde98b69 (diff)
downloadexternal_drm_gralloc-65a831d46cf14a85d523f386736ba0721b0d790b.zip
external_drm_gralloc-65a831d46cf14a85d523f386736ba0721b0d790b.tar.gz
external_drm_gralloc-65a831d46cf14a85d523f386736ba0721b0d790b.tar.bz2
gralloc_drm_bo_lock: add special usage for GRALLOC_USAGE_HW_TEXTURE
The BO 'usage' can be different from the 'usage' passed to lock. For example when the BO is created by SurfaceMediaSource, having set GRALLOC_USAGE_HW_TEXTURE while the CPU locks it with GRALLOC_USAGE_SW_WRITE_OFTEN Change-Id: I4ba0ac05f1833439299e7fd694208076e66f8dfd Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
-rw-r--r--gralloc_drm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gralloc_drm.c b/gralloc_drm.c
index 63b5217..5912ba6 100644
--- a/gralloc_drm.c
+++ b/gralloc_drm.c
@@ -357,8 +357,13 @@ 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))
+
+ if (!(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;
+ }
}
/* allow multiple locks with compatible usages */