[Mesa-stable] [PATCH v2 02/16] anv/query: Invalidate the correct range

Jason Ekstrand jason at jlekstrand.net
Thu Mar 16 21:33:57 UTC 2017


Reviewed-By: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: "17.0 13.0" <mesa-stable at lists.freedesktop.org>
---
 src/intel/vulkan/genX_query.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c
index 4e6638a..72ac2cb 100644
--- a/src/intel/vulkan/genX_query.c
+++ b/src/intel/vulkan/genX_query.c
@@ -132,8 +132,12 @@ VkResult genX(GetQueryPoolResults)(
    void *data_end = pData + dataSize;
    struct anv_query_pool_slot *slot = pool->bo.map;
 
-   if (!device->info.has_llc)
-      anv_invalidate_range(slot, MIN2(queryCount * sizeof(*slot), pool->bo.size));
+   if (!device->info.has_llc) {
+      uint64_t offset = firstQuery * sizeof(*slot);
+      uint64_t size = queryCount * sizeof(*slot);
+      anv_invalidate_range(pool->bo.map + offset,
+                           MIN2(size, pool->bo.size - offset));
+   }
 
    for (uint32_t i = 0; i < queryCount; i++) {
       switch (pool->type) {
-- 
2.5.0.400.gff86faf



More information about the mesa-stable mailing list