summaryrefslogtreecommitdiffstats
path: root/gralloc_drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'gralloc_drm.c')
-rw-r--r--gralloc_drm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gralloc_drm.c b/gralloc_drm.c
index a175cbe..3478dde 100644
--- a/gralloc_drm.c
+++ b/gralloc_drm.c
@@ -225,10 +225,10 @@ static struct gralloc_drm_bo_t *validate_handle(buffer_handle_t _handle,
}
handle->data_owner = gralloc_drm_get_pid();
- handle->data = (int) bo;
+ handle->data = bo;
}
- return (struct gralloc_drm_bo_t *) handle->data;
+ return handle->data;
}
/*
@@ -310,7 +310,7 @@ struct gralloc_drm_bo_t *gralloc_drm_bo_create(struct gralloc_drm_t *drm,
bo->refcount = 1;
handle->data_owner = gralloc_drm_get_pid();
- handle->data = (int) bo;
+ handle->data = bo;
return bo;
}
@@ -379,7 +379,7 @@ void gralloc_drm_resolve_format(buffer_handle_t _handle,
uint32_t *pitches, uint32_t *offsets, uint32_t *handles)
{
struct gralloc_drm_handle_t *handle = gralloc_drm_handle(_handle);
- struct gralloc_drm_bo_t *bo = (struct gralloc_drm_bo_t *) handle->data;
+ struct gralloc_drm_bo_t *bo = handle->data;
struct gralloc_drm_t *drm = bo->drm;
/* if handle exists and driver implements resolve_format */
@@ -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;