freedreno: Always attach bo to submit

Even if app triggers undefined behaviour by using a rsc on multiple
contexts without a flush, we still should attach the bo to the batch.

Fixes: b43e5aec0d ("freedreno/batch: Move submit bo tracking to batch")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26162>
(cherry picked from commit 4807c1e173)
This commit is contained in:
Rob Clark 2023-11-12 11:08:28 -08:00 committed by Eric Engestrom
parent 12ab5dfd52
commit 3902e9302d
2 changed files with 5 additions and 2 deletions

View file

@ -274,7 +274,7 @@
"description": "freedreno: Always attach bo to submit",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "b43e5aec0d2ce542d4ba68da947e3ad752855979",
"notes": null

View file

@ -549,8 +549,10 @@ fd_batch_resource_write(struct fd_batch *batch, struct fd_resource *rsc)
* ctx dependencies and let the app have the undefined behavior
* it asked for:
*/
if (track->write_batch->ctx != batch->ctx)
if (track->write_batch->ctx != batch->ctx) {
fd_ringbuffer_attach_bo(batch->draw, rsc->bo);
return;
}
flush_write_batch(rsc);
}
@ -599,6 +601,7 @@ fd_batch_resource_read_slowpath(struct fd_batch *batch, struct fd_resource *rsc)
* by avoiding cross-ctx dependencies and let the app have the
* undefined behavior it asked for:
*/
fd_ringbuffer_attach_bo(batch->draw, rsc->bo);
return;
}