Mesa (master): winsys/svga: use c11 thread types/functions

Brian Paul brianp at kemper.freedesktop.org
Fri Apr 7 19:51:10 UTC 2017


Module: Mesa
Branch: master
Commit: e000b17f87bd960c4ce1c0892017023d4dc59609
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e000b17f87bd960c4ce1c0892017023d4dc59609

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Apr  5 15:15:27 2017 -0600

winsys/svga: use c11 thread types/functions

Gallium no longer has wrappers for mutexes and condition variables.

Reviewed-by: Charmaine Lee <charmainel at vmware.com>

---

 src/gallium/winsys/svga/drm/vmw_context.c | 14 +++++++-------
 src/gallium/winsys/svga/drm/vmw_screen.c  |  8 ++++----
 src/gallium/winsys/svga/drm/vmw_screen.h  |  4 ++--
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/gallium/winsys/svga/drm/vmw_context.c b/src/gallium/winsys/svga/drm/vmw_context.c
index 00c401a017..6e691756d1 100644
--- a/src/gallium/winsys/svga/drm/vmw_context.c
+++ b/src/gallium/winsys/svga/drm/vmw_context.c
@@ -196,17 +196,17 @@ vmw_swc_flush(struct svga_winsys_context *swc,
 
    ret = pb_validate_validate(vswc->validate);
    if (ret != PIPE_OK) {
-      pipe_mutex_lock(vws->cs_mutex);
+      mtx_lock(&vws->cs_mutex);
       while (ret == PIPE_ERROR_RETRY) {
          ret = pb_validate_validate(vswc->validate);
          if (ret == PIPE_ERROR_RETRY) {
-            pipe_condvar_wait(vws->cs_cond, vws->cs_mutex);
+            cnd_wait(&vws->cs_cond, &vws->cs_mutex);
          }
       }
       if (ret != PIPE_OK) {
-         pipe_condvar_broadcast(vws->cs_cond);
+         cnd_broadcast(&vws->cs_cond);
       }
-      pipe_mutex_unlock(vws->cs_mutex);
+      mtx_unlock(&vws->cs_mutex);
    }
 
    assert(ret == PIPE_OK);
@@ -243,9 +243,9 @@ vmw_swc_flush(struct svga_winsys_context *swc,
                            &fence);
 
       pb_validate_fence(vswc->validate, fence);
-      pipe_mutex_lock(vws->cs_mutex);
-      pipe_condvar_broadcast(vws->cs_cond);
-      pipe_mutex_unlock(vws->cs_mutex);
+      mtx_lock(&vws->cs_mutex);
+      cnd_broadcast(&vws->cs_cond);
+      mtx_unlock(&vws->cs_mutex);
    }
 
    vswc->command.used = 0;
diff --git a/src/gallium/winsys/svga/drm/vmw_screen.c b/src/gallium/winsys/svga/drm/vmw_screen.c
index 6041598cac..e122e0c990 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen.c
@@ -109,8 +109,8 @@ vmw_winsys_create( int fd )
    if (util_hash_table_set(dev_hash, &vws->device, vws) != PIPE_OK)
       goto out_no_hash_insert;
 
-   pipe_condvar_init(vws->cs_cond);
-   pipe_mutex_init(vws->cs_mutex);
+   cnd_init(&vws->cs_cond);
+   mtx_init(&vws->cs_mutex, mtx_plain);
 
    return vws;
 out_no_hash_insert:
@@ -136,8 +136,8 @@ vmw_winsys_destroy(struct vmw_winsys_screen *vws)
       vws->fence_ops->destroy(vws->fence_ops);
       vmw_ioctl_cleanup(vws);
       close(vws->ioctl.drm_fd);
-      pipe_mutex_destroy(vws->cs_mutex);
-      pipe_condvar_destroy(vws->cs_cond);
+      mtx_destroy(&vws->cs_mutex);
+      cnd_destroy(&vws->cs_cond);
       FREE(vws);
    }
 }
diff --git a/src/gallium/winsys/svga/drm/vmw_screen.h b/src/gallium/winsys/svga/drm/vmw_screen.h
index c1cc7c3253..0ef8e8415e 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen.h
+++ b/src/gallium/winsys/svga/drm/vmw_screen.h
@@ -100,8 +100,8 @@ struct vmw_winsys_screen
    dev_t device;
    int open_count;
 
-   pipe_condvar cs_cond;
-   pipe_mutex cs_mutex;
+   cnd_t cs_cond;
+   mtx_t cs_mutex;
 };
 
 




More information about the mesa-commit mailing list