From 7c224c10083e5a3cb109dd559497e846dd5d3ea2 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 8 Aug 2019 07:01:12 -0700 Subject: panfrost: Implement callbacks for PRIMITIVES queries We're just going to compute them in the driver but let's get the structures setup to handle them. Implementation from v3d. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon --- src/gallium/drivers/panfrost/pan_context.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/panfrost/pan_context.h') diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 1277629382a..3eac35023ce 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -79,8 +79,16 @@ struct panfrost_query { unsigned type; unsigned index; - /* Memory for the GPU to writeback the value of the query */ - struct panfrost_transfer transfer; + union { + /* For computed queries. 64-bit to prevent overflow */ + struct { + uint64_t start; + uint64_t end; + }; + + /* Memory for the GPU to writeback the value of the query */ + struct panfrost_transfer transfer; + }; }; struct panfrost_fence { @@ -123,6 +131,9 @@ struct panfrost_context { struct panfrost_memory tiler_dummy; struct panfrost_memory depth_stencil_buffer; + bool active_queries; + uint64_t prims_generated; + uint64_t tf_prims_generated; struct panfrost_query *occlusion_query; /* Each draw has corresponding vertex and tiler payloads */ -- cgit v1.2.3