summaryrefslogtreecommitdiffstats
path: root/gralloc.c
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2012-08-01 16:06:00 +0300
committerDaniel Leung <daniel.leung@intel.com>2012-10-12 08:20:45 -0700
commita86ecd9036df3862f7289378609509e50ef38cb3 (patch)
treed517ead1e2764990299357a86efb8a44d1248a6e /gralloc.c
parent12971f83cab2f56198bb16f00fbbbabfe84226ca (diff)
downloadexternal_drm_gralloc-a86ecd9036df3862f7289378609509e50ef38cb3.zip
external_drm_gralloc-a86ecd9036df3862f7289378609509e50ef38cb3.tar.gz
external_drm_gralloc-a86ecd9036df3862f7289378609509e50ef38cb3.tar.bz2
gralloc: add refcount to gralloc_drm_bo_t
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 <tapani.palli@intel.com>
Diffstat (limited to 'gralloc.c')
-rw-r--r--gralloc.c6
1 files changed, 2 insertions, 4 deletions
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;
}
}