From: Mark Janes Date: Wed, 29 May 2019 15:43:34 +0000 (-0700) Subject: intel/perf: move perf-related constants to common location X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2446f5cfd8408a69b3ebf2543f08b3ca2fb000d7;p=mesa.git intel/perf: move perf-related constants to common location The perf subsystem needs several macro definitions that were duplicated in Iris and i965 headers. Place these macros within perf, if the perf implementation contains the only references to the values. Reviewed-by: Kenneth Graunke --- diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index 0d2403cfa59..6d4a04f20b9 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -33,6 +33,7 @@ #include #include +#include "perf/gen_perf.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" #include "pipe/p_context.h" diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h index e9b6913ad21..2c34a37a08f 100644 --- a/src/intel/perf/gen_perf.h +++ b/src/intel/perf/gen_perf.h @@ -70,6 +70,27 @@ struct gen_pipeline_stat { */ #define MAX_OA_REPORT_COUNTERS 62 +#define IA_VERTICES_COUNT 0x2310 +#define IA_PRIMITIVES_COUNT 0x2318 +#define VS_INVOCATION_COUNT 0x2320 +#define HS_INVOCATION_COUNT 0x2300 +#define DS_INVOCATION_COUNT 0x2308 +#define GS_INVOCATION_COUNT 0x2328 +#define GS_PRIMITIVES_COUNT 0x2330 +#define CL_INVOCATION_COUNT 0x2338 +#define CL_PRIMITIVES_COUNT 0x2340 +#define PS_INVOCATION_COUNT 0x2348 +#define CS_INVOCATION_COUNT 0x2290 +#define PS_DEPTH_COUNT 0x2350 + +/* + * When currently allocate only one page for pipeline statistics queries. Here + * we derived the maximum number of counters for that amount. + */ +#define STATS_BO_SIZE 4096 +#define STATS_BO_END_OFFSET_BYTES (STATS_BO_SIZE / 2) +#define MAX_STAT_COUNTERS (STATS_BO_END_OFFSET_BYTES / 8) + struct gen_perf_query_result { /** * Storage for the final accumulated OA counters. diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 60052ee6f5f..a4ecc68ec0f 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -1523,20 +1523,6 @@ enum brw_pixel_shader_coverage_mask_mode { #define BR13_16161616 (0x4 << 24) #define BR13_32323232 (0x5 << 24) -/* Pipeline Statistics Counter Registers */ -#define IA_VERTICES_COUNT 0x2310 -#define IA_PRIMITIVES_COUNT 0x2318 -#define VS_INVOCATION_COUNT 0x2320 -#define HS_INVOCATION_COUNT 0x2300 -#define DS_INVOCATION_COUNT 0x2308 -#define GS_INVOCATION_COUNT 0x2328 -#define GS_PRIMITIVES_COUNT 0x2330 -#define CL_INVOCATION_COUNT 0x2338 -#define CL_PRIMITIVES_COUNT 0x2340 -#define PS_INVOCATION_COUNT 0x2348 -#define CS_INVOCATION_COUNT 0x2290 -#define PS_DEPTH_COUNT 0x2350 - #define GEN6_SO_PRIM_STORAGE_NEEDED 0x2280 #define GEN7_SO_PRIM_STORAGE_NEEDED(n) (0x5240 + (n) * 8) diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.h b/src/mesa/drivers/dri/i965/brw_performance_query.h index b0bf60cc4ff..16ba49d6a3b 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.h +++ b/src/mesa/drivers/dri/i965/brw_performance_query.h @@ -32,14 +32,6 @@ struct gen_perf_query_info; -/* - * When currently allocate only one page for pipeline statistics queries. Here - * we derived the maximum number of counters for that amount. - */ -#define STATS_BO_SIZE 4096 -#define STATS_BO_END_OFFSET_BYTES (STATS_BO_SIZE / 2) -#define MAX_STAT_COUNTERS (STATS_BO_END_OFFSET_BYTES / 8) - /** * i965 representation of a performance query object. * diff --git a/src/mesa/drivers/dri/i965/gen6_queryobj.c b/src/mesa/drivers/dri/i965/gen6_queryobj.c index ada28a4a824..a77ac823f7a 100644 --- a/src/mesa/drivers/dri/i965/gen6_queryobj.c +++ b/src/mesa/drivers/dri/i965/gen6_queryobj.c @@ -36,6 +36,7 @@ #include "brw_context.h" #include "brw_defines.h" #include "brw_state.h" +#include "perf/gen_perf.h" #include "intel_batchbuffer.h" #include "intel_buffer_objects.h"