Commit 66775ef1 authored by Lionel Landwerlin's avatar Lionel Landwerlin

iris: avoid excessive flushing with perf query buffers

Because performance queries are running on both batches to capture 3D
& compute performance values and because the performance query buffer
object are only accessed as write object from the GPU and only read
from CPU, there is no need to synchronize them between batches.

This change flags those buffers so that we can avoid the excessive
flushing on them.
Signed-off-by: Lionel Landwerlin's avatarLionel Landwerlin <>
parent 0d2b20dc
Pipeline #130880 waiting for manual action with stages
......@@ -298,7 +298,7 @@ iris_use_pinned_bo(struct iris_batch *batch,
if (bo != batch->bo) {
if (!bo->perf_query && bo != batch->bo) {
/* This is the first time our batch has seen this BO. Before we use it,
* we may need to flush and synchronize with other batches.
......@@ -823,6 +823,7 @@ bo_unreference_final(struct iris_bo *bo, time_t time)
if (bucket && iris_bo_madvise(bo, I915_MADV_DONTNEED)) {
bo->free_time = time;
bo->name = NULL;
bo->perf_query = false;
list_addtail(&bo->head, &bucket->head);
} else {
......@@ -192,6 +192,14 @@ struct iris_bo {
bool userptr;
* Boolean of whether this buffer is used for perf queries. If true, we can
* avoid excessive flushing of the batches as even though this buffer
* written to from both batches, each batch writes at a different location
* in that buffer and it is only read from CPU.
bool perf_query;
/** Pre-computed hash using _mesa_hash_pointer for cache tracking sets */
uint32_t hash;
......@@ -29,7 +29,11 @@ static void *
iris_oa_bo_alloc(struct iris_context *ice, const char *name, uint64_t size)
struct iris_screen *screen = (struct iris_screen *) ice->ctx.screen;
return iris_bo_alloc(screen->bufmgr, name, size, IRIS_MEMZONE_OTHER);
struct iris_bo *bo = iris_bo_alloc(screen->bufmgr, name, size, IRIS_MEMZONE_OTHER);
bo->perf_query = true;
return bo;
static void
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment