From 8542de3915e6b8a88232a1f0f991a425e9289a96 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 31 Jul 2011 16:35:21 +0900 Subject: revise gralloc_drm bo interface Make it more intuitive to use. --- gralloc_drm.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'gralloc_drm.h') diff --git a/gralloc_drm.h b/gralloc_drm.h index 6d3aa1f..b9c0de8 100644 --- a/gralloc_drm.h +++ b/gralloc_drm.h @@ -71,20 +71,17 @@ static inline int gralloc_drm_get_bpp(int format) return bpp; } +int gralloc_drm_handle_register(buffer_handle_t handle, struct gralloc_drm_t *drm); +int gralloc_drm_handle_unregister(buffer_handle_t handle); + struct gralloc_drm_bo_t *gralloc_drm_bo_create(struct gralloc_drm_t *drm, int width, int height, int format, int usage); void gralloc_drm_bo_destroy(struct gralloc_drm_bo_t *bo); -struct gralloc_drm_bo_t *gralloc_drm_bo_register(struct gralloc_drm_t *drm, buffer_handle_t handle, int create); -void gralloc_drm_bo_unregister(struct gralloc_drm_bo_t *bo); - -static inline struct gralloc_drm_bo_t *gralloc_drm_bo_validate(struct gralloc_drm_t *drm, buffer_handle_t handle) -{ - return gralloc_drm_bo_register(drm, handle, 0); -} +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_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); -buffer_handle_t gralloc_drm_bo_get_handle(struct gralloc_drm_bo_t *bo, int *stride); int gralloc_drm_bo_need_fb(const struct gralloc_drm_bo_t *bo); int gralloc_drm_bo_add_fb(struct gralloc_drm_bo_t *bo); -- cgit v1.1