crocus: fixup workaround_bo to match 965.
authorDave Airlie <airlied@redhat.com>
Mon, 21 Jun 2021 05:31:06 +0000 (15:31 +1000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 22 Jun 2021 18:56:20 +0000 (18:56 +0000)
Always add to the batch, and don't set the reloc write flag when
adding to reloc list, as this will confuse the render/compute sync
code and cause over syncing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11507>

src/gallium/drivers/crocus/crocus_batch.c

index 63cfe28..037360c 100644 (file)
@@ -299,9 +299,6 @@ crocus_use_bo(struct crocus_batch *batch, struct crocus_bo *bo, bool writable)
 {
    assert(bo->bufmgr == batch->command.bo->bufmgr);
 
-   if (bo == batch->ice->workaround_bo)
-      writable = false;
-
    struct drm_i915_gem_exec_object2 *existing_entry =
       find_validation_entry(batch, bo);
 
@@ -376,6 +373,9 @@ emit_reloc(struct crocus_batch *batch,
 {
    assert(target != NULL);
 
+   if (target == batch->ice->workaround_bo)
+      reloc_flags &= ~RELOC_WRITE;
+
    bool writable = reloc_flags & RELOC_WRITE;
 
    struct drm_i915_gem_exec_object2 *entry =
@@ -473,6 +473,11 @@ create_batch(struct crocus_batch *batch)
 
    crocus_use_bo(batch, batch->command.bo, false);
 
+   /* Always add workaround_bo which contains a driver identifier to be
+    * recorded in error states.
+    */
+   crocus_use_bo(batch, batch->ice->workaround_bo, false);
+
    recreate_growing_buffer(batch, &batch->state,
                            "state buffer",
                            STATE_SZ);