From 92eac93723361ff4f28c6b341edbb2658c09f099 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 30 Jul 2011 16:29:54 +0900 Subject: allow FB to be mapped This is useful for testing software renderer with FB. --- gralloc_drm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gralloc_drm.c b/gralloc_drm.c index 2ec11ef..0e0943b 100644 --- a/gralloc_drm.c +++ b/gralloc_drm.c @@ -300,8 +300,11 @@ int gralloc_drm_bo_lock(struct gralloc_drm_bo_t *bo, int usage, int x, int y, int w, int h, void **addr) { - if ((bo->handle->usage & usage) != usage) - return -EINVAL; + if ((bo->handle->usage & usage) != usage) { + /* make FB special for testing software renderer with */ + if (!(bo->handle->usage & GRALLOC_USAGE_HW_FB)) + return -EINVAL; + } /* allow multiple locks with compatible usages */ if (bo->lock_count && (bo->locked_for & usage) != usage) -- cgit v1.2.3