[Mesa-dev] [PATCH 08/10] i965: use gen_device_info rather then brw_context
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Thu Jun 15 00:38:33 UTC 2017
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
src/mesa/drivers/dri/i965/brw_performance_query.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c
index c6574df302a..45be9b1a988 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query.c
@@ -503,9 +503,11 @@ emit_mi_report_perf_count(struct brw_context *brw,
uint32_t offset_in_bytes,
uint32_t report_id)
{
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
+
assert(offset_in_bytes % 64 == 0);
- if (brw->gen < 8) {
+ if (devinfo->gen < 8) {
BEGIN_BATCH(3);
OUT_BATCH(GEN6_MI_REPORT_PERF_COUNT);
OUT_RELOC(bo, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
@@ -856,6 +858,7 @@ static void
accumulate_oa_reports(struct brw_context *brw,
struct brw_perf_query_object *obj)
{
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
struct gl_perf_query_object *o = &obj->base;
uint32_t *start;
uint32_t *last;
@@ -934,7 +937,7 @@ accumulate_oa_reports(struct brw_context *brw,
* For Haswell we can rely on the HW to stop the progress
* of OA counters while any other context is acctive.
*/
- if (brw->gen >= 8) {
+ if (devinfo->gen >= 8) {
if (in_ctx && report[2] != ctx_id) {
DBG("i915 perf: Switch AWAY (observed by ID change)\n");
in_ctx = false;
@@ -1603,6 +1606,7 @@ add_basic_stat_reg(struct brw_perf_query_info *query,
static void
init_pipeline_statistic_query_registers(struct brw_context *brw)
{
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
struct brw_perf_query_info *query = append_query_info(brw);
query->kind = PIPELINE_STATS;
@@ -1618,7 +1622,7 @@ init_pipeline_statistic_query_registers(struct brw_context *brw)
add_basic_stat_reg(query, VS_INVOCATION_COUNT,
"N vertex shader invocations");
- if (brw->gen == 6) {
+ if (devinfo->gen == 6) {
add_stat_reg(query, GEN6_SO_PRIM_STORAGE_NEEDED, 1, 1,
"SO_PRIM_STORAGE_NEEDED",
"N geometry shader stream-out primitives (total)");
@@ -1667,7 +1671,7 @@ init_pipeline_statistic_query_registers(struct brw_context *brw)
add_basic_stat_reg(query, CL_PRIMITIVES_COUNT,
"N primitives leaving clipping");
- if (brw->is_haswell || brw->gen == 8)
+ if (devinfo->is_haswell || devinfo->gen == 8)
add_stat_reg(query, PS_INVOCATION_COUNT, 1, 4,
"N fragment shader invocations",
"N fragment shader invocations");
@@ -1677,7 +1681,7 @@ init_pipeline_statistic_query_registers(struct brw_context *brw)
add_basic_stat_reg(query, PS_DEPTH_COUNT, "N z-pass fragments");
- if (brw->gen >= 7)
+ if (devinfo->gen >= 7)
add_basic_stat_reg(query, CS_INVOCATION_COUNT,
"N compute shader invocations");
--
2.11.0
More information about the mesa-dev
mailing list