From 6b123fa07ff9d73d6e67416c2372eab5c17282b6 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Wed, 28 Oct 2015 10:48:31 +0000 Subject: virgl: add virgl_context/sampler_view/so_target() upcast wrappers Signed-off-by: Emil Velikov Reviewed-by: Dave Airlie --- src/gallium/drivers/virgl/virgl_streamout.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/virgl/virgl_streamout.c') diff --git a/src/gallium/drivers/virgl/virgl_streamout.c b/src/gallium/drivers/virgl/virgl_streamout.c index 95420f688d3..c3cbcffc193 100644 --- a/src/gallium/drivers/virgl/virgl_streamout.c +++ b/src/gallium/drivers/virgl/virgl_streamout.c @@ -32,7 +32,7 @@ static struct pipe_stream_output_target *virgl_create_so_target( unsigned buffer_offset, unsigned buffer_size) { - struct virgl_context *vctx = (struct virgl_context *)ctx; + struct virgl_context *vctx = virgl_context(ctx); struct virgl_resource *res = (struct virgl_resource *)buffer; struct virgl_so_target *t = CALLOC_STRUCT(virgl_so_target); uint32_t handle; @@ -55,8 +55,8 @@ static struct pipe_stream_output_target *virgl_create_so_target( static void virgl_destroy_so_target(struct pipe_context *ctx, struct pipe_stream_output_target *target) { - struct virgl_context *vctx = (struct virgl_context *)ctx; - struct virgl_so_target *t = (struct virgl_so_target *)target; + struct virgl_context *vctx = virgl_context(ctx); + struct virgl_so_target *t = virgl_so_target(target); pipe_resource_reference(&t->base.buffer, NULL); virgl_encode_delete_object(vctx, t->handle, VIRGL_OBJECT_STREAMOUT_TARGET); @@ -68,7 +68,7 @@ static void virgl_set_so_targets(struct pipe_context *ctx, struct pipe_stream_output_target **targets, const unsigned *offset) { - struct virgl_context *vctx = (struct virgl_context *)ctx; + struct virgl_context *vctx = virgl_context(ctx); int i; for (i = 0; i < num_targets; i++) { pipe_resource_reference(&vctx->so_targets[i].base.buffer, targets[i]->buffer); -- cgit v1.2.3