virgl: keep track of number of computations
authorGurchetan Singh <gurchetansingh@chromium.org>
Wed, 6 Feb 2019 02:56:30 +0000 (18:56 -0800)
committerGert Wollny <gert.wollny@collabora.com>
Fri, 15 Feb 2019 10:19:05 +0000 (11:19 +0100)
It's good to keep track of these things.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
src/gallium/drivers/virgl/virgl_context.c
src/gallium/drivers/virgl/virgl_context.h

index 41201c59d1c274174954786442422660180abbd3..664f0fe915b90687d902b715e3b326034ec41d52 100644 (file)
@@ -751,7 +751,7 @@ static void virgl_flush_eq(struct virgl_context *ctx, void *closure,
       u_upload_unmap(ctx->uploader);
 
    /* send the buffer to the remote side for decoding */
-   ctx->num_transfers = ctx->num_draws = 0;
+   ctx->num_transfers = ctx->num_draws = ctx->num_compute = 0;
 
    rs->vws->submit_cmd(rs->vws, ctx->cbuf, ctx->cbuf->in_fence_fd,
                        ctx->cbuf->needs_out_fence_fd ? &out_fence_fd : NULL);
@@ -1163,6 +1163,7 @@ static void virgl_launch_grid(struct pipe_context *ctx,
 {
    struct virgl_context *vctx = virgl_context(ctx);
    virgl_encode_launch_grid(vctx, info);
+   vctx->num_compute++;
 }
 
 static void
index 79a1a73e615fe68488cc253b8bb2136e8f3338ba..65485475d9d18be317e9f8498f292af0452f6b67 100644 (file)
@@ -79,8 +79,7 @@ struct virgl_context {
 
    struct pipe_resource *ssbos[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_BUFFERS];
    struct pipe_resource *images[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_BUFFERS];
-   int num_transfers;
-   int num_draws;
+   uint32_t num_transfers, num_draws, num_compute;
 
    struct pipe_resource *atomic_buffers[PIPE_MAX_HW_ATOMIC_BUFFERS];