diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2011-07-30 16:29:54 +0900 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2011-07-30 16:32:27 +0900 |
commit | 92eac93723361ff4f28c6b341edbb2658c09f099 (patch) | |
tree | 875943b1f872d939b2751ffa9769ed715a20b1ce | |
parent | 25e041367040b6faadebc38acd44e96b8e29a5ab (diff) |
allow FB to be mapped
This is useful for testing software renderer with FB.
-rw-r--r-- | gralloc_drm.c | 7 |
1 files 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) |