summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--armada_bufmgr.c6
-rw-r--r--debian/changelog3
2 files changed, 7 insertions, 2 deletions
diff --git a/armada_bufmgr.c b/armada_bufmgr.c
index 938138f..0803309 100644
--- a/armada_bufmgr.c
+++ b/armada_bufmgr.c
@@ -74,6 +74,7 @@ struct armada_bo {
size_t alloc_size; /* Allocated size */
uint32_t ref; /* Reference count */
uint32_t name; /* Global name */
+ uint8_t reusable;
};
#define to_armada_bo(_bo) container_of(_bo, struct armada_bo, bo)
@@ -326,6 +327,7 @@ struct drm_armada_bo *drm_armada_bo_create(struct drm_armada_bufmgr *mgr,
bo->alloc_size = alloc_size;
bo->ref = 1;
bo->mgr = mgr;
+ bo->reusable = 1;
/* Add it to the handle hash table */
assert(drmHashInsert(mgr->handle_hash, bo->bo.handle, bo) == 0);
@@ -383,6 +385,7 @@ struct drm_armada_bo *drm_armada_bo_create_size(struct drm_armada_bufmgr *mgr,
bo->alloc_size = alloc_size;
bo->ref = 1;
bo->mgr = mgr;
+ bo->reusable = 1;
/* Add it to the handle hash table */
assert(drmHashInsert(mgr->handle_hash, bo->bo.handle, bo) == 0);
@@ -492,7 +495,7 @@ void drm_armada_bo_put(struct drm_armada_bo *dbo)
if (bo->ref-- == 1) {
int ret;
- if (bo->bo.type == DRM_ARMADA_BO_SHMEM)
+ if (bo->reusable)
armada_bo_cache_put(bo);
else
armada_bo_free(bo);
@@ -514,6 +517,7 @@ int drm_armada_bo_flink(struct drm_armada_bo *dbo, uint32_t *name)
if (ret)
return ret;
bo->name = flink.name;
+ bo->reusable = 0;
assert(drmHashInsert(bo->mgr->name_hash, bo->name, bo) == 0);
}
diff --git a/debian/changelog b/debian/changelog
index c6aa895..3c0c83a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,8 +2,9 @@ libdrm-armada (2.0.3-1) unstable; urgency=low
* Add drm_armada_bo_create_size()
* Add drm_armada_cache_reap()
+ * Better tracking of re-usable BOs
- -- Russell King <rmk_cubox@arm.linux.org.uk> Sat, 12 Oct 2014 19:31:04 +0100
+ -- Russell King <rmk_cubox@arm.linux.org.uk> Sat, 12 Oct 2014 19:50:35 +0100
libdrm-armada (2.0.2-1) unstable; urgency=low