tu: Implement fallback linear staging blit for CopyImage
[mesa.git] / src / gallium / state_trackers / vdpau / htab.c
index 1d7b3fffab20ceea23b2643498e34f0e8ede2211..f596b2d571fd712e060f936b9c7fa5e64ec881d4 100644 (file)
@@ -30,7 +30,7 @@
 #include "vdpau_private.h"
 
 static struct handle_table *htab = NULL;
-pipe_static_mutex(htab_lock);
+static mtx_t htab_lock = _MTX_INITIALIZER_NP;
 
 boolean vlCreateHTAB(void)
 {
@@ -38,22 +38,22 @@ boolean vlCreateHTAB(void)
 
    /* Make sure handle table handles match VDPAU handles. */
    assert(sizeof(unsigned) <= sizeof(vlHandle));
-   pipe_mutex_lock(htab_lock);
+   mtx_lock(&htab_lock);
    if (!htab)
       htab = handle_table_create();
    ret = htab != NULL;
-   pipe_mutex_unlock(htab_lock);
+   mtx_unlock(&htab_lock);
    return ret;
 }
 
 void vlDestroyHTAB(void)
 {
-   pipe_mutex_lock(htab_lock);
+   mtx_lock(&htab_lock);
    if (htab && !handle_table_get_first_handle(htab)) {
       handle_table_destroy(htab);
       htab = NULL;
    }
-   pipe_mutex_unlock(htab_lock);
+   mtx_unlock(&htab_lock);
 }
 
 vlHandle vlAddDataHTAB(void *data)
@@ -61,10 +61,10 @@ vlHandle vlAddDataHTAB(void *data)
    vlHandle handle = 0;
 
    assert(data);
-   pipe_mutex_lock(htab_lock);
+   mtx_lock(&htab_lock);
    if (htab)
       handle = handle_table_add(htab, data);
-   pipe_mutex_unlock(htab_lock);
+   mtx_unlock(&htab_lock);
    return handle;
 }
 
@@ -73,17 +73,17 @@ void* vlGetDataHTAB(vlHandle handle)
    void *data = NULL;
 
    assert(handle);
-   pipe_mutex_lock(htab_lock);
+   mtx_lock(&htab_lock);
    if (htab)
       data = handle_table_get(htab, handle);
-   pipe_mutex_unlock(htab_lock);
+   mtx_unlock(&htab_lock);
    return data;
 }
 
 void vlRemoveDataHTAB(vlHandle handle)
 {
-   pipe_mutex_lock(htab_lock);
+   mtx_lock(&htab_lock);
    if (htab)
       handle_table_remove(htab, handle);
-   pipe_mutex_unlock(htab_lock);
+   mtx_unlock(&htab_lock);
 }