X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_pipe_query.c;h=c44e0b8ec498af2a67d00a00d9ec4733695d9786;hb=4eb3225b38ce12cb34ab3d90804c9683bd7b4ed3;hp=08283e37317d083959b9d77a3537f08b4fdddf17;hpb=782b6885c2573e1f004d9572eb386d9e1f392254;p=mesa.git diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c index 08283e37317..c44e0b8ec49 100644 --- a/src/gallium/drivers/svga/svga_pipe_query.c +++ b/src/gallium/drivers/svga/svga_pipe_query.c @@ -30,7 +30,7 @@ #include "svga_cmd.h" #include "svga_context.h" #include "svga_screen.h" -#include "svga_screen_buffer.h" +#include "svga_resource_buffer.h" #include "svga_winsys.h" #include "svga_debug.h" @@ -63,11 +63,12 @@ svga_query( struct pipe_query *q ) static boolean svga_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, - uint64_t *result); + void *result); static struct pipe_query *svga_create_query( struct pipe_context *pipe, unsigned query_type ) { + struct svga_context *svga = svga_context( pipe ); struct svga_screen *svgascreen = svga_screen(pipe->screen); struct svga_winsys_screen *sws = svgascreen->sws; struct svga_query *sq; @@ -80,7 +81,7 @@ static struct pipe_query *svga_create_query( struct pipe_context *pipe, sq->type = SVGA3D_QUERYTYPE_OCCLUSION; - sq->hwbuf = svga_winsys_buffer_create(svgascreen, + sq->hwbuf = svga_winsys_buffer_create(svga, 1, SVGA_BUFFER_USAGE_PINNED, sizeof *sq->queryResult); @@ -89,7 +90,7 @@ static struct pipe_query *svga_create_query( struct pipe_context *pipe, sq->queryResult = (SVGA3dQueryResult *)sws->buffer_map(sws, sq->hwbuf, - PIPE_BUFFER_USAGE_CPU_WRITE); + PIPE_TRANSFER_WRITE); if(!sq->queryResult) goto no_query_result; @@ -206,13 +207,14 @@ static void svga_end_query(struct pipe_context *pipe, static boolean svga_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, - uint64_t *result) + void *vresult) { struct svga_context *svga = svga_context( pipe ); struct svga_screen *svgascreen = svga_screen( pipe->screen ); struct svga_winsys_screen *sws = svgascreen->sws; struct svga_query *sq = svga_query( q ); SVGA3dQueryState state; + uint64_t *result = (uint64_t*)vresult; SVGA_DBG(DEBUG_QUERY, "%s wait: %d\n", __FUNCTION__); @@ -239,7 +241,7 @@ static boolean svga_get_query_result(struct pipe_context *pipe, if(!wait) return FALSE; - sws->fence_finish(sws, sq->fence, 0); + sws->fence_finish(sws, sq->fence, SVGA_FENCE_FLAG_QUERY); state = sq->queryResult->state; }