etnaviv: support PA performance counters
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Sun, 25 Mar 2018 20:30:00 +0000 (22:30 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Sun, 8 Apr 2018 20:20:46 +0000 (22:20 +0200)
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Chris Healy <cphealy@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_query_pm.c
src/gallium/drivers/etnaviv/etnaviv_query_pm.h

index eaad925e608e07b0459d7d57d892513f07d24057..8e83eb185cc82e043e4ab7b72bf149f7ff15849f 100644 (file)
@@ -171,6 +171,48 @@ static const struct etna_perfmon_config query_config[] = {
       .source = (const struct etna_perfmon_source[]) {
          { "SH", "PXL_TEXLD_INST_COUNTER" }
       }
+   },
+   {
+      .name = "pa-input-vtx-counter",
+      .type = ETNA_QUERY_PA_INPUT_VTX_COUNTER,
+      .source = (const struct etna_perfmon_source[]) {
+         { "PA", "INPUT_VTX_COUNTER" }
+      }
+   },
+   {
+      .name = "pa-input-prim-counter",
+      .type = ETNA_QUERY_PA_INPUT_PRIM_COUNTER,
+      .source = (const struct etna_perfmon_source[]) {
+         { "PA", "INPUT_PRIM_COUNTER" }
+      }
+   },
+   {
+      .name = "pa-output-prim-counter",
+      .type = ETNA_QUERY_PA_OUTPUT_PRIM_COUNTER,
+      .source = (const struct etna_perfmon_source[]) {
+         { "PA", "OUTPUT_PRIM_COUNTER" }
+      }
+   },
+   {
+      .name = "pa-depth-clipped-counter",
+      .type = ETNA_QUERY_PA_DEPTH_CLIPPED_COUNTER,
+      .source = (const struct etna_perfmon_source[]) {
+         { "PA", "DEPTH_CLIPPED_COUNTER" }
+      }
+   },
+   {
+      .name = "pa-trivial-rejected-counter",
+      .type = ETNA_QUERY_PA_TRIVIAL_REJECTED_COUNTER,
+      .source = (const struct etna_perfmon_source[]) {
+         { "PA", "TRIVIAL_REJECTED_COUNTER" }
+      }
+   },
+   {
+      .name = "pa-culled-counter",
+      .type = ETNA_QUERY_PA_CULLED_COUNTER,
+      .source = (const struct etna_perfmon_source[]) {
+         { "PA", "CULLED_COUNTER" }
+      }
    }
 };
 
index b5e7fe5ad35ee39e302501a5623c5b44d33f06d9..00fea71f23b27f0d02a44684151334061c8117a7 100644 (file)
@@ -55,6 +55,13 @@ struct etna_screen;
 #define ETNA_QUERY_SH_PXL_BRANCH_INST_COUNTER            (ETNA_PM_QUERY_BASE + 17)
 #define ETNA_QUERY_SH_PXL_TEXLD_INST_COUNTER             (ETNA_PM_QUERY_BASE + 18)
 
+#define ETNA_QUERY_PA_INPUT_VTX_COUNTER                  (ETNA_PM_QUERY_BASE + 19)
+#define ETNA_QUERY_PA_INPUT_PRIM_COUNTER                 (ETNA_PM_QUERY_BASE + 20)
+#define ETNA_QUERY_PA_OUTPUT_PRIM_COUNTER                (ETNA_PM_QUERY_BASE + 21)
+#define ETNA_QUERY_PA_DEPTH_CLIPPED_COUNTER              (ETNA_PM_QUERY_BASE + 22)
+#define ETNA_QUERY_PA_TRIVIAL_REJECTED_COUNTER           (ETNA_PM_QUERY_BASE + 23)
+#define ETNA_QUERY_PA_CULLED_COUNTER                     (ETNA_PM_QUERY_BASE + 24)
+
 struct etna_pm_query {
    struct etna_query base;
    struct etna_perfmon_signal *signal;