diff options
author | Thomas Hellstrom <thellstrom-at-vmware-dot-com> | 2009-02-09 12:24:48 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom-at-vmware-dot-com> | 2009-02-09 12:24:48 +0100 |
commit | 484ee3c7a4c1a1f0947e96e7e085e45246c11fff (patch) | |
tree | 3cc5253979ffaf9d953ec89a313c805e0aaeddef | |
parent | 550e3ec095c30c0a751e08aa4f7eb330093ddd6e (diff) |
Add a wsbmFenceCreateSig function. Bump minor.
Don't add an already signaled fence to a buffer object.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/wsbm_fencemgr.c | 15 | ||||
-rw-r--r-- | src/wsbm_fencemgr.h | 8 | ||||
-rw-r--r-- | src/wsbm_slabpool.c | 4 |
5 files changed, 25 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 9f47d54..24191f2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.57) -AC_INIT([libwsbm], 1.0.0, [thomas@tungstengraphics.com], libwsbm) +AC_INIT([libwsbm], 1.1.0, [thomas@tungstengraphics.com], libwsbm) AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([dist-bzip2]) diff --git a/src/Makefile.am b/src/Makefile.am index 45d7ecc..4778f37 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libwsbm.la libwsbm_la_CFLAGS = @libdrm_CFLAGS@ -Wall -libwsbm_la_LDFLAGS = -version-number 1:0:0 -no-undefined @libdrm_LIBS@ +libwsbm_la_LDFLAGS = -version-number 1:1:0 -no-undefined @libdrm_LIBS@ libwsbm_la_SOURCES = \ wsbm_fencemgr.c \ wsbm_fencemgr.h \ diff --git a/src/wsbm_fencemgr.c b/src/wsbm_fencemgr.c index 047eb81..03b255c 100644 --- a/src/wsbm_fencemgr.c +++ b/src/wsbm_fencemgr.c @@ -294,8 +294,9 @@ wsbmFenceReference(struct _WsbmFenceObject *fence) } struct _WsbmFenceObject * -wsbmFenceCreate(struct _WsbmFenceMgr *mgr, uint32_t fence_class, - uint32_t fence_type, void *private, size_t private_size) +wsbmFenceCreateSig(struct _WsbmFenceMgr *mgr, uint32_t fence_class, + uint32_t fence_type, uint32_t signaled_types, + void *private, size_t private_size) { struct _WsbmFenceClass *fc = &mgr->classes[fence_class]; struct _WsbmFenceObject *fence; @@ -313,7 +314,7 @@ wsbmFenceCreate(struct _WsbmFenceMgr *mgr, uint32_t fence_class, fence->mgr = mgr; fence->fence_class = fence_class; fence->fence_type = fence_type; - wsbmAtomicSet(&fence->signaled_types, 0); + wsbmAtomicSet(&fence->signaled_types, signaled_types); fence->private = private; if (private_size) { fence->private = (void *)(((uint8_t *) fence) + fence_size); @@ -340,6 +341,14 @@ wsbmFenceCreate(struct _WsbmFenceMgr *mgr, uint32_t fence_class, return NULL; } +struct _WsbmFenceObject * +wsbmFenceCreate(struct _WsbmFenceMgr *mgr, uint32_t fence_class, + uint32_t fence_type, void *private, size_t private_size) +{ + return wsbmFenceCreateSig(mgr, fence_class, fence_type, 0, private, + private_size); +} + struct _WsbmTTMFenceMgrPriv { int fd; diff --git a/src/wsbm_fencemgr.h b/src/wsbm_fencemgr.h index 0cae2f3..cb10ae2 100644 --- a/src/wsbm_fencemgr.h +++ b/src/wsbm_fencemgr.h @@ -116,6 +116,14 @@ extern struct _WsbmFenceObject *wsbmFenceCreate(struct _WsbmFenceMgr *mgr, void *private, size_t private_size); + +extern struct _WsbmFenceObject *wsbmFenceCreateSig(struct _WsbmFenceMgr *mgr, + uint32_t fence_class, + uint32_t fence_type, + uint32_t signaled_types, + void *private, + size_t private_size); + extern uint32_t wsbmFenceType(struct _WsbmFenceObject *fence); /* diff --git a/src/wsbm_slabpool.c b/src/wsbm_slabpool.c index 9ee5011..17c184c 100644 --- a/src/wsbm_slabpool.c +++ b/src/wsbm_slabpool.c @@ -988,9 +988,11 @@ pool_fence(struct _WsbmBufStorage *buf, struct _WsbmFenceObject *fence) if (sBuf->fence) wsbmFenceUnreference(&sBuf->fence); - sBuf->fence = wsbmFenceReference(fence); kBuf = pool_kernel(buf); sBuf->fenceType = kBuf->fence_type_mask; + if (!wsbmFenceSignaledCached(fence, sBuf->fenceType)) + sBuf->fence = wsbmFenceReference(fence); + sBuf->unFenced = 0; WSBM_COND_BROADCAST(&sBuf->event); WSBM_MUTEX_UNLOCK(&buf->mutex); |