summaryrefslogtreecommitdiff
path: root/gralloc_drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'gralloc_drm.c')
-rw-r--r--gralloc_drm.c7
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)