aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_transfer_queue.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2019-05-15 15:52:34 -0700
committerChia-I Wu <[email protected]>2019-06-12 18:20:30 -0700
commit514e12b1b8fae55319cbc3702215a305e3d7d60f (patch)
treefbdf1e07747ae7dcd57c7a4ff5761856c7b2b808 /src/gallium/drivers/virgl/virgl_transfer_queue.c
parent308ba2c0f92e4ad0584b02c06bcd27fcabc33196 (diff)
virgl: init transfer queue from virgl_context
A pipe_transfer is a context object. It is fine for virgl_transfer_queue to have access to the context. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Alexandros Frantzis <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_transfer_queue.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_transfer_queue.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/virgl/virgl_transfer_queue.c b/src/gallium/drivers/virgl/virgl_transfer_queue.c
index da2eda41b6a..020c42ac14c 100644
--- a/src/gallium/drivers/virgl/virgl_transfer_queue.c
+++ b/src/gallium/drivers/virgl/virgl_transfer_queue.c
@@ -25,6 +25,7 @@
#include "util/u_inlines.h"
#include "virgl_protocol.h"
+#include "virgl_context.h"
#include "virgl_screen.h"
#include "virgl_encode.h"
#include "virgl_resource.h"
@@ -122,7 +123,7 @@ static void remove_transfer(struct virgl_transfer_queue *queue,
struct pipe_resource *pres = queued->base.resource;
list_del(&queued->queue_link);
pipe_resource_reference(&pres, NULL);
- virgl_resource_destroy_transfer(queue->pool, queued);
+ virgl_resource_destroy_transfer(&queue->vctx->transfer_pool, queued);
}
static void replace_unmapped_transfer(struct virgl_transfer_queue *queue,
@@ -246,11 +247,12 @@ static void add_internal(struct virgl_transfer_queue *queue,
void virgl_transfer_queue_init(struct virgl_transfer_queue *queue,
- struct virgl_screen *vs,
- struct slab_child_pool *pool)
+ struct virgl_context *vctx)
{
+ struct virgl_screen *vs = virgl_screen(vctx->base.screen);
+
queue->vs = vs;
- queue->pool = pool;
+ queue->vctx = vctx;
queue->num_dwords = 0;
for (uint32_t i = 0; i < MAX_LISTS; i++)
@@ -282,7 +284,7 @@ void virgl_transfer_queue_fini(struct virgl_transfer_queue *queue)
vws->cmd_buf_destroy(queue->tbuf);
queue->vs = NULL;
- queue->pool = NULL;
+ queue->vctx = NULL;
queue->tbuf = NULL;
queue->num_dwords = 0;
}