From a86ecd9036df3862f7289378609509e50ef38cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Wed, 1 Aug 2012 16:06:00 +0300 Subject: gralloc: add refcount to gralloc_drm_bo_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an basic enabler for gralloc to let buffers live while they are still in use by gralloc (for example during scanout), otherwise Android may choose to destroy them while they are still needed. This facility will get used with upcoming plane support and direct rendering support. Change-Id: I2f0bc595846a68e8d2feb5138b022d16f207e2b5 Signed-off-by: Tapani Pälli --- gralloc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gralloc.c') diff --git a/gralloc.c b/gralloc.c index 6d55307..e54aca6 100644 --- a/gralloc.c +++ b/gralloc.c @@ -174,9 +174,7 @@ static int drm_mod_free_gpu0(alloc_device_t *dev, buffer_handle_t handle) if (!bo) return -EINVAL; - if (gralloc_drm_bo_need_fb(bo)) - gralloc_drm_bo_rm_fb(bo); - gralloc_drm_bo_destroy(bo); + gralloc_drm_bo_decref(bo); return 0; } @@ -201,7 +199,7 @@ static int drm_mod_alloc_gpu0(alloc_device_t *dev, err = gralloc_drm_bo_add_fb(bo); if (err) { ALOGE("failed to add fb"); - gralloc_drm_bo_destroy(bo); + gralloc_drm_bo_decref(bo); return err; } } -- cgit v1.1