summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2013-01-15 13:58:57 +0200
committerTapani Pälli <tapani.palli@intel.com>2013-01-15 14:04:00 +0200
commit421d4ec03917d13cc4449832275ac3c25e00acf5 (patch)
treeb98b7217250f46710a19c2273c98945fecb81673
parent16a747a9e551f462e559b14844fd20c3cde98b69 (diff)
downloadexternal_drm_gralloc-421d4ec03917d13cc4449832275ac3c25e00acf5.zip
external_drm_gralloc-421d4ec03917d13cc4449832275ac3c25e00acf5.tar.gz
external_drm_gralloc-421d4ec03917d13cc4449832275ac3c25e00acf5.tar.bz2
gralloc: new function to query the gem handle of buffer_handle_t
This function can be used from Mesa instead of having to expose the whole gralloc_drm_handle_t structure. Change-Id: I1aa5368b21e588d5d711c1005fff2a5296e143a0 Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
-rw-r--r--gralloc_drm.c6
-rw-r--r--gralloc_drm.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/gralloc_drm.c b/gralloc_drm.c
index 63b5217..cf0fe84 100644
--- a/gralloc_drm.c
+++ b/gralloc_drm.c
@@ -348,6 +348,12 @@ buffer_handle_t gralloc_drm_bo_get_handle(struct gralloc_drm_bo_t *bo, int *stri
return &bo->handle->base;
}
+int gralloc_drm_get_gem_handle(buffer_handle_t _handle)
+{
+ struct gralloc_drm_handle_t *handle = gralloc_drm_handle(_handle);
+ return (handle) ? handle->name : 0;
+}
+
/*
* Lock a bo. XXX thread-safety?
*/
diff --git a/gralloc_drm.h b/gralloc_drm.h
index 716173a..6c13138 100644
--- a/gralloc_drm.h
+++ b/gralloc_drm.h
@@ -120,6 +120,7 @@ void gralloc_drm_bo_decref(struct gralloc_drm_bo_t *bo);
struct gralloc_drm_bo_t *gralloc_drm_bo_from_handle(buffer_handle_t handle);
buffer_handle_t gralloc_drm_bo_get_handle(struct gralloc_drm_bo_t *bo, int *stride);
+int gralloc_drm_get_gem_handle(buffer_handle_t handle);
int gralloc_drm_bo_lock(struct gralloc_drm_bo_t *bo, int x, int y, int w, int h, int enable_write, void **addr);
void gralloc_drm_bo_unlock(struct gralloc_drm_bo_t *bo);