u_blitter: add a msaa parameter to util_blitter_clear
[mesa.git] / src / gallium / drivers / v3d / v3d_bufmgr.c
index ba9aa65ba899c3ac65258f5ff6edbb1a0beebe12..f0df1b98373789ac276f2a8109bbcc28af6cfdb9 100644 (file)
@@ -131,6 +131,10 @@ v3d_bo_alloc(struct v3d_screen *screen, uint32_t size, const char *name)
         struct v3d_bo *bo;
         int ret;
 
+        /* The CLIF dumping requires that there is no whitespace in the name.
+         */
+        assert(!strchr(name, ' '));
+
         size = align(size, 4096);
 
         bo = v3d_bo_from_cache(screen, size, name);
@@ -327,7 +331,6 @@ v3d_bo_last_unreference_locked_timed(struct v3d_bo *bo, time_t time)
 
 static struct v3d_bo *
 v3d_bo_open_handle(struct v3d_screen *screen,
-                   uint32_t winsys_stride,
                    uint32_t handle, uint32_t size)
 {
         struct v3d_bo *bo;
@@ -351,8 +354,7 @@ v3d_bo_open_handle(struct v3d_screen *screen,
         bo->private = false;
 
 #ifdef USE_V3D_SIMULATOR
-        v3d_simulator_open_from_handle(screen->fd, winsys_stride,
-                                       bo->handle, bo->size);
+        v3d_simulator_open_from_handle(screen->fd, bo->handle, bo->size);
         bo->map = malloc(bo->size);
 #endif
 
@@ -372,14 +374,16 @@ v3d_bo_open_handle(struct v3d_screen *screen,
 
         util_hash_table_set(screen->bo_handles, (void *)(uintptr_t)handle, bo);
 
+        screen->bo_count++;
+        screen->bo_size += bo->size;
+
 done:
         mtx_unlock(&screen->bo_handles_mutex);
         return bo;
 }
 
 struct v3d_bo *
-v3d_bo_open_name(struct v3d_screen *screen, uint32_t name,
-                 uint32_t winsys_stride)
+v3d_bo_open_name(struct v3d_screen *screen, uint32_t name)
 {
         struct drm_gem_open o = {
                 .name = name
@@ -391,11 +395,11 @@ v3d_bo_open_name(struct v3d_screen *screen, uint32_t name,
                 return NULL;
         }
 
-        return v3d_bo_open_handle(screen, winsys_stride, o.handle, o.size);
+        return v3d_bo_open_handle(screen, o.handle, o.size);
 }
 
 struct v3d_bo *
-v3d_bo_open_dmabuf(struct v3d_screen *screen, int fd, uint32_t winsys_stride)
+v3d_bo_open_dmabuf(struct v3d_screen *screen, int fd)
 {
         uint32_t handle;
         int ret = drmPrimeFDToHandle(screen->fd, fd, &handle);
@@ -412,7 +416,7 @@ v3d_bo_open_dmabuf(struct v3d_screen *screen, int fd, uint32_t winsys_stride)
                 return NULL;
         }
 
-        return v3d_bo_open_handle(screen, winsys_stride, handle, size);
+        return v3d_bo_open_handle(screen, handle, size);
 }
 
 int