summaryrefslogtreecommitdiffstats
path: root/gralloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gralloc.c')
-rw-r--r--gralloc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gralloc.c b/gralloc.c
index 850a39e..fd4f848 100644
--- a/gralloc.c
+++ b/gralloc.c
@@ -114,13 +114,24 @@ static int drm_mod_perform(const struct gralloc_module_t *mod, int op, ...)
static int drm_mod_register_buffer(const gralloc_module_t *mod,
buffer_handle_t handle)
{
- return (gralloc_drm_handle(handle)) ? 0 : -EINVAL;
+ struct drm_module_t *dmod = (struct drm_module_t *) mod;
+
+ return (gralloc_drm_bo_register(dmod->drm, handle, 1)) ? 0 : -EINVAL;
}
static int drm_mod_unregister_buffer(const gralloc_module_t *mod,
buffer_handle_t handle)
{
- return (gralloc_drm_handle(handle)) ? 0 : -EINVAL;
+ struct drm_module_t *dmod = (struct drm_module_t *) mod;
+ struct gralloc_drm_bo_t *bo;
+
+ bo = gralloc_drm_bo_validate(dmod->drm, handle);
+ if (!bo)
+ return -EINVAL;
+
+ gralloc_drm_bo_unregister(bo);
+
+ return 0;
}
static int drm_mod_lock(const gralloc_module_t *mod, buffer_handle_t handle,