summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-09-27 19:12:24 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-10-05 15:42:22 +0200
commit8a943564fd7ebacd2437bb907535b7765ff448e4 (patch)
tree1b44f125781f42057ca4cef1c27fbe7074c851b4
parent2a83036fe29262c8761812c65d6e81c7198da54e (diff)
virgl: use the new parent/child pools for transfers
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--src/gallium/drivers/virgl/virgl_buffer.c4
-rw-r--r--src/gallium/drivers/virgl/virgl_context.c5
-rw-r--r--src/gallium/drivers/virgl/virgl_context.h2
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.c4
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.h3
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c4
6 files changed, 14 insertions, 8 deletions
diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c
index de99796284..2e63aebc72 100644
--- a/src/gallium/drivers/virgl/virgl_buffer.c
+++ b/src/gallium/drivers/virgl/virgl_buffer.c
@@ -62,7 +62,7 @@ static void *virgl_buffer_transfer_map(struct pipe_context *ctx,
if (doflushwait)
ctx->flush(ctx, NULL, 0);
- trans = slab_alloc_st(&vctx->texture_transfer_pool);
+ trans = slab_alloc(&vctx->texture_transfer_pool);
if (!trans)
return NULL;
@@ -114,7 +114,7 @@ static void virgl_buffer_transfer_unmap(struct pipe_context *ctx,
}
}
- slab_free_st(&vctx->texture_transfer_pool, trans);
+ slab_free(&vctx->texture_transfer_pool, trans);
}
static void virgl_buffer_transfer_flush_region(struct pipe_context *ctx,
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index a6c0597598..e693a733a8 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -862,7 +862,7 @@ virgl_context_destroy( struct pipe_context *ctx )
u_upload_destroy(vctx->uploader);
util_primconvert_destroy(vctx->primconvert);
- slab_destroy(&vctx->texture_transfer_pool);
+ slab_destroy_child(&vctx->texture_transfer_pool);
FREE(vctx);
}
@@ -943,8 +943,7 @@ struct pipe_context *virgl_context_create(struct pipe_screen *pscreen,
virgl_init_so_functions(vctx);
list_inithead(&vctx->to_flush_bufs);
- slab_create(&vctx->texture_transfer_pool, sizeof(struct virgl_transfer),
- 16);
+ slab_create_child(&vctx->texture_transfer_pool, rs->texture_transfer_pool);
vctx->primconvert = util_primconvert_create(&vctx->base, rs->caps.caps.v1.prim_mask);
vctx->uploader = u_upload_create(&vctx->base, 1024 * 1024,
diff --git a/src/gallium/drivers/virgl/virgl_context.h b/src/gallium/drivers/virgl/virgl_context.h
index 3b9901f7e1..597ed49e34 100644
--- a/src/gallium/drivers/virgl/virgl_context.h
+++ b/src/gallium/drivers/virgl/virgl_context.h
@@ -56,7 +56,7 @@ struct virgl_context {
struct pipe_framebuffer_state framebuffer;
- struct slab_mempool texture_transfer_pool;
+ struct slab_child_pool texture_transfer_pool;
struct pipe_index_buffer index_buffer;
struct u_upload_mgr *uploader;
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index dd135a789d..5f98754189 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -547,6 +547,8 @@ virgl_destroy_screen(struct pipe_screen *screen)
struct virgl_screen *vscreen = virgl_screen(screen);
struct virgl_winsys *vws = vscreen->vws;
+ slab_destroy_parent(&vscreen->texture_transfer_pool);
+
if (vws)
vws->destroy(vws);
FREE(vscreen);
@@ -581,6 +583,8 @@ virgl_create_screen(struct virgl_winsys *vws)
screen->refcnt = 1;
+ slab_create_parent(&screen->texture_transfer_pool, sizeof(struct virgl_transfer), 16);
+
util_format_s3tc_init();
return &screen->base;
}
diff --git a/src/gallium/drivers/virgl/virgl_screen.h b/src/gallium/drivers/virgl/virgl_screen.h
index 8cac38d7e9..dcf5816d60 100644
--- a/src/gallium/drivers/virgl/virgl_screen.h
+++ b/src/gallium/drivers/virgl/virgl_screen.h
@@ -24,6 +24,7 @@
#define VIRGL_H
#include "pipe/p_screen.h"
+#include "util/slab.h"
#include "virgl_winsys.h"
struct virgl_screen {
@@ -38,6 +39,8 @@ struct virgl_screen {
struct virgl_drm_caps caps;
+ struct slab_parent_pool texture_transfer_pool;
+
uint32_t sub_ctx_id;
};
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 24bbc3ce60..150a5ebd8c 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -145,7 +145,7 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
if (doflushwait)
ctx->flush(ctx, NULL, 0);
- trans = slab_alloc_st(&vctx->texture_transfer_pool);
+ trans = slab_alloc(&vctx->texture_transfer_pool);
if (!trans)
return NULL;
@@ -235,7 +235,7 @@ static void virgl_texture_transfer_unmap(struct pipe_context *ctx,
if (trans->resolve_tmp)
pipe_resource_reference((struct pipe_resource **)&trans->resolve_tmp, NULL);
- slab_free_st(&vctx->texture_transfer_pool, trans);
+ slab_free(&vctx->texture_transfer_pool, trans);
}