anv: fix intel perf queries availability writes
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 18 Dec 2019 07:16:44 +0000 (09:16 +0200)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 9 Jan 2020 18:42:36 +0000 (20:42 +0200)
The availability is not written at the location changed in
ee6fbb95a74d...

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ee6fbb95a74d ("anv: Properly handle host query reset of performance queries")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/genX_query.c

index 6a512d3ea7b50ce0dc5d6f92cdf87b157ce47d40..aa02db9ab05e579b895f2c10c0439a901a85c1d1 100644 (file)
@@ -491,9 +491,8 @@ emit_zero_queries(struct anv_cmd_buffer *cmd_buffer,
       for (uint32_t i = 0; i < num_queries; i++) {
          struct anv_address slot_addr =
             anv_query_address(pool, first_index + i);
-         gen_mi_memset(b, slot_addr, 0, pool->stride - 8);
-         emit_query_mi_availability(b, anv_address_add(slot_addr,
-                                                       pool->stride - 8), true);
+         gen_mi_memset(b, anv_address_add(slot_addr, 8), 0, pool->stride - 8);
+         emit_query_mi_availability(b, slot_addr, true);
       }
       break;
 
@@ -535,14 +534,8 @@ void genX(CmdResetQueryPool)(
       struct gen_mi_builder b;
       gen_mi_builder_init(&b, &cmd_buffer->batch);
 
-      for (uint32_t i = 0; i < queryCount; i++) {
-         emit_query_mi_availability(
-            &b,
-            anv_address_add(
-               anv_query_address(pool, firstQuery + i),
-               pool->stride - 8),
-            false);
-      }
+      for (uint32_t i = 0; i < queryCount; i++)
+         emit_query_mi_availability(&b, anv_query_address(pool, firstQuery + i), false);
       break;
    }
 
@@ -781,9 +774,7 @@ void genX(CmdEndQueryIndexedEXT)(
                                              intel_perf_mi_rpc_offset(true));
          rpc.ReportID = 0xdeadbeef; /* This goes in the first dword */
       }
-      emit_query_mi_availability(&b,
-                                 anv_address_add(query_addr, pool->stride - 8),
-                                 true);
+      emit_query_mi_availability(&b, query_addr, true);
       break;
    }