radeonsi: fix user fence space when MCBP is enabled
[mesa.git] / src / gallium / drivers / v3d / v3d_bufmgr.c
index b3e4d053cc030e662d07a6a59fdba583ee63b254..48f5a54936c8dbea641d8f826d91b3fc7ad1f312 100644 (file)
 #include "v3d_context.h"
 #include "v3d_screen.h"
 
-#ifdef HAVE_VALGRIND
-#include <valgrind.h>
-#include <memcheck.h>
-#define VG(x) x
-#else
-#define VG(x)
-#endif
-
 static bool dump_stats = false;
 
 static void
@@ -81,7 +73,7 @@ v3d_bo_dump_stats(struct v3d_screen *screen)
                 struct timespec time;
                 clock_gettime(CLOCK_MONOTONIC, &time);
                 fprintf(stderr, "  now:               %ld\n",
-                        time.tv_sec);
+                        (long)time.tv_sec);
         }
 }
 
@@ -367,12 +359,13 @@ v3d_bo_open_handle(struct v3d_screen *screen,
                         strerror(errno));
                 free(bo->map);
                 free(bo);
-                return NULL;
+                bo = NULL;
+                goto done;
         }
         bo->offset = get.offset;
         assert(bo->offset != 0);
 
-        util_hash_table_set(screen->bo_handles, (void *)(uintptr_t)handle, bo);
+        _mesa_hash_table_insert(screen->bo_handles, (void *)(uintptr_t)handle, bo);
 
         screen->bo_count++;
         screen->bo_size += bo->size;
@@ -433,7 +426,7 @@ v3d_bo_get_dmabuf(struct v3d_bo *bo)
 
         mtx_lock(&bo->screen->bo_handles_mutex);
         bo->private = false;
-        util_hash_table_set(bo->screen->bo_handles, (void *)(uintptr_t)bo->handle, bo);
+        _mesa_hash_table_insert(bo->screen->bo_handles, (void *)(uintptr_t)bo->handle, bo);
         mtx_unlock(&bo->screen->bo_handles_mutex);
 
         return fd;