etnaviv: add query_group_info for sw counters
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Mon, 5 Mar 2018 22:26:42 +0000 (23:26 +0100)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Thu, 8 Mar 2018 19:43:55 +0000 (20:43 +0100)
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
src/gallium/drivers/etnaviv/etnaviv_query_sw.c
src/gallium/drivers/etnaviv/etnaviv_query_sw.h

index 2e65065b285d5c537694ea070648d962386dcb38..f955d8e21060aff37d6dd3961e84b5dbe3346cd1 100644 (file)
@@ -118,16 +118,16 @@ etna_sw_create_query(struct etna_context *ctx, unsigned query_type)
    return q;
 }
 
+static const struct pipe_driver_query_info list[] = {
+   {"prims-emitted", PIPE_QUERY_PRIMITIVES_EMITTED, { 0 }},
+   {"draw-calls", ETNA_QUERY_DRAW_CALLS, { 0 }},
+   {"rs-operations", ETNA_QUERY_RS_OPERATIONS, { 0 }},
+};
+
 int
 etna_sw_get_driver_query_info(struct pipe_screen *pscreen, unsigned index,
                               struct pipe_driver_query_info *info)
 {
-   static const struct pipe_driver_query_info list[] = {
-      {"prims-emitted", PIPE_QUERY_PRIMITIVES_EMITTED, { 0 }},
-      {"draw-calls", ETNA_QUERY_DRAW_CALLS, { 0 }},
-      {"rs-operations", ETNA_QUERY_RS_OPERATIONS, { 0 }},
-   };
-
    if (!info)
       return ARRAY_SIZE(list);
 
@@ -138,3 +138,21 @@ etna_sw_get_driver_query_info(struct pipe_screen *pscreen, unsigned index,
 
    return 1;
 }
+
+int
+etna_sw_get_driver_query_group_info(struct pipe_screen *pscreen,
+                                    unsigned index,
+                                    struct pipe_driver_query_group_info *info)
+{
+   if (!info)
+      return ARRAY_SIZE(list);
+
+   if (index != 0)
+      return 0;
+
+   info->name = "driver";
+   info->max_active_queries = ARRAY_SIZE(list);
+   info->num_queries = ARRAY_SIZE(list);
+
+   return 1;
+}
index 9321147094d6244485952b843f2b781b21394da6..f5a2dbef1a6087de5129b965e504839ebd12fc80 100644 (file)
@@ -51,4 +51,9 @@ int
 etna_sw_get_driver_query_info(struct pipe_screen *pscreen, unsigned index,
                               struct pipe_driver_query_info *info);
 
+int
+etna_sw_get_driver_query_group_info(struct pipe_screen *pscreen,
+                                    unsigned index,
+                                    struct pipe_driver_query_group_info *info);
+
 #endif