summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/i965/SConscript1
-rw-r--r--src/glx/dri2_glx.c13
-rw-r--r--src/mesa/main/hash.c36
3 files changed, 38 insertions, 12 deletions
diff --git a/src/gallium/drivers/i965/SConscript b/src/gallium/drivers/i965/SConscript
index 9c2faaf4b49..d900ea25968 100644
--- a/src/gallium/drivers/i965/SConscript
+++ b/src/gallium/drivers/i965/SConscript
@@ -58,6 +58,7 @@ i965 = env.ConvenienceLibrary(
'brw_vs_emit.c',
'brw_vs_state.c',
'brw_vs_surface_state.c',
+ 'brw_winsys_debug.c',
'brw_wm.c',
# 'brw_wm_constant_buffer.c',
'brw_wm_debug.c',
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 5b0f335db6a..14788b89bea 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -202,6 +202,8 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
return &pdraw->base;
}
+#ifdef X_DRI2GetMSC
+
static int
dri2DrawableGetMSC(__GLXscreenConfigs *psc, __GLXDRIdrawable *pdraw,
int64_t *ust, int64_t *msc, int64_t *sbc)
@@ -209,6 +211,11 @@ dri2DrawableGetMSC(__GLXscreenConfigs *psc, __GLXDRIdrawable *pdraw,
return DRI2GetMSC(psc->dpy, pdraw->xDrawable, ust, msc, sbc);
}
+#endif
+
+
+#ifdef X_DRI2WaitMSC
+
static int
dri2WaitForMSC(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc)
@@ -225,6 +232,8 @@ dri2WaitForSBC(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust,
sbc);
}
+#endif /* X_DRI2WaitMSC */
+
static void
dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, int width, int height)
{
@@ -448,6 +457,8 @@ dri2GetBuffersWithFormat(__DRIdrawable * driDrawable,
return pdraw->buffers;
}
+#ifdef X_DRI2SwapInterval
+
static void
dri2SetSwapInterval(__GLXDRIdrawable *pdraw, int interval)
{
@@ -465,6 +476,8 @@ dri2GetSwapInterval(__GLXDRIdrawable *pdraw)
return priv->swap_interval;
}
+#endif /* X_DRI2SwapInterval */
+
static const __DRIdri2LoaderExtension dri2LoaderExtension = {
{__DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION},
dri2GetBuffers,
diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c
index 975775469d9..b624e6ecac1 100644
--- a/src/mesa/main/hash.c
+++ b/src/mesa/main/hash.c
@@ -120,15 +120,11 @@ _mesa_DeleteHashTable(struct _mesa_HashTable *table)
/**
- * Lookup an entry in the hash table.
- *
- * \param table the hash table.
- * \param key the key.
- *
- * \return pointer to user's data or NULL if key not in table
+ * Lookup an entry in the hash table, without locking.
+ * \sa _mesa_HashLookup
*/
-void *
-_mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
+static INLINE void *
+_mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key)
{
GLuint pos;
const struct HashEntry *entry;
@@ -137,20 +133,36 @@ _mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
assert(key);
pos = HASH_FUNC(key);
- _glthread_LOCK_MUTEX(table->Mutex);
entry = table->Table[pos];
while (entry) {
if (entry->Key == key) {
- _glthread_UNLOCK_MUTEX(table->Mutex);
return entry->Data;
}
entry = entry->Next;
}
- _glthread_UNLOCK_MUTEX(table->Mutex);
return NULL;
}
+/**
+ * Lookup an entry in the hash table.
+ *
+ * \param table the hash table.
+ * \param key the key.
+ *
+ * \return pointer to user's data or NULL if key not in table
+ */
+void *
+_mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
+{
+ void *res;
+ assert(table);
+ _glthread_LOCK_MUTEX(table->Mutex);
+ res = _mesa_HashLookup_unlocked(table, key);
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return res;
+}
+
/**
* Insert a key/pointer pair into the hash table.
@@ -447,7 +459,7 @@ _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys)
GLuint freeStart = 1;
GLuint key;
for (key = 1; key != maxKey; key++) {
- if (_mesa_HashLookup(table, key)) {
+ if (_mesa_HashLookup_unlocked(table, key)) {
/* darn, this key is already in use */
freeCount = 0;
freeStart = key+1;