aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2008-04-08 11:48:44 +0200
committerJakob Bornecrantz <[email protected]>2008-04-08 11:48:44 +0200
commitcaa5b1736dd4c4ba85966fa7710c52da406b1dce (patch)
treedf755b0490d4f81062ce65198d486b4d86019985
parent4c0f72432393e324d608474d24d20ebb465cb2ca (diff)
Added fence counter to fence manager
-rw-r--r--src/gallium/winsys/dri/intel/ws_dri_fencemgr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/winsys/dri/intel/ws_dri_fencemgr.c b/src/gallium/winsys/dri/intel/ws_dri_fencemgr.c
index 8aaef1c6200..1f893b47ced 100644
--- a/src/gallium/winsys/dri/intel/ws_dri_fencemgr.c
+++ b/src/gallium/winsys/dri/intel/ws_dri_fencemgr.c
@@ -23,6 +23,7 @@ struct _DriFenceMgr {
_glthread_Mutex mutex;
int refCount;
drmMMListHead *heads;
+ int num_fences;
};
struct _DriFenceObject {
@@ -68,6 +69,7 @@ driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info)
_glthread_LOCK_MUTEX(tmp->mutex);
tmp->refCount = 1;
tmp->info = *info;
+ tmp->num_fences = 0;
tmp->heads = calloc(tmp->info.num_classes, sizeof(*tmp->heads));
if (!tmp->heads)
goto out_err;
@@ -114,9 +116,11 @@ driFenceUnReferenceLocked(struct _DriFenceObject **pFence)
DRMLISTDELINIT(&fence->head);
if (fence->private)
mgr->info.unreference(mgr, &fence->private);
+ --mgr->num_fences;
fence->mgr = NULL;
--mgr->refCount;
free(fence);
+
}
}
@@ -297,6 +301,7 @@ struct _DriFenceObject
DRMLISTADDTAIL(&fence->head, &mgr->heads[fence_class]);
fence->mgr = mgr;
++mgr->refCount;
+ ++mgr->num_fences;
_glthread_UNLOCK_MUTEX(mgr->mutex);
fence->fence_class = fence_class;
fence->fence_type = fence_type;