iris: Pin pixel hashing table BO from iris_batch submission instead of from iris_state.

This fixes sporadic rendering corruption reported on MTL with ChromeOS
in cases where multiple processes including Chrome were utilizing the
GPU concurrently, and one of the processes happened to submit a
BLORP-only batch buffer right after a switch from a different context.

In such a scenario we would fail to add the BO that holds the pixel
hashing tables to the execbuf IOCTL for the BLORP batch, because it
was being pinned from iris_restore_render_saved_bos() which isn't
called for BLORP operations, potentially causing it to use garbage as
pixel pipe hashing tables, which led to corruption of the BLORP
rendering.

Technically this could have affected DG2 as well, but it has only been
reported on MTL so far.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Sushma Venkatesh Reddy <sushma.venkatesh.reddy@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30274>
This commit is contained in:
Francisco Jerez
2024-07-18 23:35:40 -07:00
committed by Marge Bot
parent 7513a0bf3a
commit 49b433d5e7
2 changed files with 14 additions and 7 deletions

View File

@@ -626,6 +626,19 @@ add_aux_map_bos_to_batch(struct iris_batch *batch)
}
}
static void
add_pixel_hash_table_bo_to_batch(struct iris_batch *batch)
{
if (batch->ice->state.pixel_hashing_tables &&
batch->name == IRIS_BATCH_RENDER) {
struct iris_bo *bo = iris_resource_bo(
batch->ice->state.pixel_hashing_tables);
ensure_exec_obj_space(batch, 1);
add_bo_to_batch(batch, bo, false);
}
}
static void
finish_seqno(struct iris_batch *batch)
{
@@ -658,6 +671,7 @@ iris_finish_batch(struct iris_batch *batch)
}
add_aux_map_bos_to_batch(batch);
add_pixel_hash_table_bo_to_batch(batch);
finish_seqno(batch);

View File

@@ -5971,13 +5971,6 @@ iris_restore_render_saved_bos(struct iris_context *ice,
IRIS_DOMAIN_VF_READ);
}
}
#if GFX_VERx10 == 125
iris_use_pinned_bo(batch, iris_resource_bo(ice->state.pixel_hashing_tables),
false, IRIS_DOMAIN_NONE);
#else
assert(!ice->state.pixel_hashing_tables);
#endif
}
static void