From 69bebe06e3af70927472bd4bc59df6ee5bbe2e48 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Sun, 25 Mar 2018 22:29:59 +0200 Subject: [PATCH] etnaviv: support SH performance counters Signed-off-by: Christian Gmeiner Tested-by: Chris Healy --- .../drivers/etnaviv/etnaviv_query_pm.c | 63 +++++++++++++++++++ .../drivers/etnaviv/etnaviv_query_pm.h | 10 +++ 2 files changed, 73 insertions(+) diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_pm.c b/src/gallium/drivers/etnaviv/etnaviv_query_pm.c index 9be65cc6c5c..eaad925e608 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_pm.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query_pm.c @@ -108,6 +108,69 @@ static const struct etna_perfmon_config query_config[] = { .source = (const struct etna_perfmon_source[]) { { "PE", "PIXEL_COUNT_DRAWN_BY_DEPTH_PIPE" } } + }, + { + .name = "sh-shader-cycles", + .type = ETNA_QUERY_SH_SHADER_CYCLES, + .source = (const struct etna_perfmon_source[]) { + { "SH", "SHADER_CYCLES" } + } + }, + { + .name = "sh-ps-inst-counter", + .type = ETNA_QUERY_SH_PS_INST_COUNTER, + .source = (const struct etna_perfmon_source[]) { + { "SH", "PS_INST_COUNTER" } + } + }, + { + .name = "sh-rendered-pixel-counter", + .type = ETNA_QUERY_SH_RENDERED_PIXEL_COUNTER, + .source = (const struct etna_perfmon_source[]) { + { "SH", "RENDERED_PIXEL_COUNTER" } + } + }, + { + .name = "sh-vs-inst-counter", + .type = ETNA_QUERY_SH_VS_INST_COUNTER, + .source = (const struct etna_perfmon_source[]) { + { "SH", "VS_INST_COUNTER" } + } + }, + { + .name = "sh-rendered-vertice-counter", + .type = ETNA_QUERY_SH_RENDERED_VERTICE_COUNTER, + .source = (const struct etna_perfmon_source[]) { + { "SH", "RENDERED_VERTICE_COUNTER" } + } + }, + { + .name = "sh-vtx-branch-inst-counter", + .type = ETNA_QUERY_SH_RENDERED_VERTICE_COUNTER, + .source = (const struct etna_perfmon_source[]) { + { "SH", "VTX_BRANCH_INST_COUNTER" } + } + }, + { + .name = "sh-vtx-texld-inst-counter", + .type = ETNA_QUERY_SH_RENDERED_VERTICE_COUNTER, + .source = (const struct etna_perfmon_source[]) { + { "SH", "VTX_TEXLD_INST_COUNTER" } + } + }, + { + .name = "sh-plx-branch-inst-counter", + .type = ETNA_QUERY_SH_RENDERED_VERTICE_COUNTER, + .source = (const struct etna_perfmon_source[]) { + { "SH", "PXL_BRANCH_INST_COUNTER" } + } + }, + { + .name = "sh-plx-texld-inst-counter", + .type = ETNA_QUERY_SH_RENDERED_VERTICE_COUNTER, + .source = (const struct etna_perfmon_source[]) { + { "SH", "PXL_TEXLD_INST_COUNTER" } + } } }; diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_pm.h b/src/gallium/drivers/etnaviv/etnaviv_query_pm.h index 77fb37b3338..b5e7fe5ad35 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_pm.h +++ b/src/gallium/drivers/etnaviv/etnaviv_query_pm.h @@ -45,6 +45,16 @@ struct etna_screen; #define ETNA_QUERY_PE_PIXEL_COUNT_DRAWN_BY_DEPTH_PIPE (ETNA_PM_QUERY_BASE + 8) #define ETNA_QUERY_PE_PIXELS_RENDERED_2D (ETNA_PM_QUERY_BASE + 9) +#define ETNA_QUERY_SH_SHADER_CYCLES (ETNA_PM_QUERY_BASE + 10) +#define ETNA_QUERY_SH_PS_INST_COUNTER (ETNA_PM_QUERY_BASE + 11) +#define ETNA_QUERY_SH_RENDERED_PIXEL_COUNTER (ETNA_PM_QUERY_BASE + 12) +#define ETNA_QUERY_SH_VS_INST_COUNTER (ETNA_PM_QUERY_BASE + 13) +#define ETNA_QUERY_SH_RENDERED_VERTICE_COUNTER (ETNA_PM_QUERY_BASE + 14) +#define ETNA_QUERY_SH_VTX_BRANCH_INST_COUNTER (ETNA_PM_QUERY_BASE + 15) +#define ETNA_QUERY_SH_VTX_TEXLD_INST_COUNTER (ETNA_PM_QUERY_BASE + 16) +#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) + struct etna_pm_query { struct etna_query base; struct etna_perfmon_signal *signal; -- 2.30.2