From 6a03f255229b6e96d2bda0ce09bf6b260c9aa43a Mon Sep 17 00:00:00 2001 From: Alexandros Frantzis Date: Wed, 26 Jun 2019 12:12:17 +0300 Subject: virgl: Store the virgl_hw_res for copy transfers Store the virgl_hw_res instead of the pipe_resource for copy transfer sources. This prepares the codebase for a change to provide only the virgl_hw_res for the staging buffers in upcoming commits. Signed-off-by: Alexandros Frantzis Reviewed-by: Chia-I Wu --- src/gallium/drivers/virgl/virgl_encode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/virgl/virgl_encode.c') diff --git a/src/gallium/drivers/virgl/virgl_encode.c b/src/gallium/drivers/virgl/virgl_encode.c index 2975e6048cf..0489f088012 100644 --- a/src/gallium/drivers/virgl/virgl_encode.c +++ b/src/gallium/drivers/virgl/virgl_encode.c @@ -1168,16 +1168,17 @@ void virgl_encode_copy_transfer(struct virgl_context *ctx, struct virgl_transfer *trans) { uint32_t command; - struct virgl_resource *copy_src_res = virgl_resource(trans->copy_src_res); struct virgl_screen *vs = virgl_screen(ctx->base.screen); + assert(trans->copy_src_hw_res); + command = VIRGL_CMD0(VIRGL_CCMD_COPY_TRANSFER3D, 0, VIRGL_COPY_TRANSFER3D_SIZE); virgl_encoder_write_cmd_dword(ctx, command); /* Copy transfers need to explicitly specify the stride, since it may differ * from the image stride. */ virgl_encoder_transfer3d_common(vs, ctx->cbuf, trans, virgl_transfer3d_explicit_stride); - virgl_encoder_emit_resource(vs, ctx->cbuf, copy_src_res); + vs->vws->emit_res(vs->vws, ctx->cbuf, trans->copy_src_hw_res, TRUE); virgl_encoder_write_dword(ctx->cbuf, trans->copy_src_offset); /* At the moment all copy transfers are synchronized. */ virgl_encoder_write_dword(ctx->cbuf, 1); -- cgit v1.2.3