From 32c297e99175e14a5c2b347c5cb1684873023302 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Tue, 20 May 2025 12:06:26 -0700 Subject: [PATCH] anv/trtt: don't avoid the TR-TT submission when there is stuff to signal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When an application issues a sparse binding operation, it may be the case that the state the app is setting is the state that is already there. In that case, both n_l3l2_binds and n_l1_binds are zero, so the batch doesn't contain anything and, since 0802bbd48641, we just skip the batch submission and return. The problem is that skipping the batch submission and returning ignores the synchronization: there may be syncobjs that we have to wait and, more importantly, there may be syncobjs that we have to signal. This case is exercised by vkd3d-proton's test suite, but I'm not aware of any other workload that triggers it. This commit only affects Meteor Lake and older, as TR-TT is only the default behavior for the platforms running i915.ko. Testcase: vkd3d-proton/d3d12/test_sparse_buffer_memory_lifetime Fixes: 0802bbd48641 ("anv/trtt: don't submit empty batches when there are no binds to do") Reviewed-by: Iván Briano Signed-off-by: Paulo Zanoni Part-of: (cherry picked from commit d77b49eb0ac3797d357efd264cd39ad0338708ac) --- .pick_status.json | 2 +- src/intel/vulkan/anv_sparse.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 74e6df80206..eb718b8dd73 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2144,7 +2144,7 @@ "description": "anv/trtt: don't avoid the TR-TT submission when there is stuff to signal", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "0802bbd486415026ce98bbba97e2be012637db97", "notes": null diff --git a/src/intel/vulkan/anv_sparse.c b/src/intel/vulkan/anv_sparse.c index ac1d58a8f1c..30b237b3f14 100644 --- a/src/intel/vulkan/anv_sparse.c +++ b/src/intel/vulkan/anv_sparse.c @@ -820,7 +820,8 @@ anv_sparse_bind_trtt(struct anv_device *device, /* This is not an error, the application is simply trying to reset state * that was already there. */ - if (n_l3l2_binds == 0 && n_l1_binds == 0) + if (n_l3l2_binds == 0 && n_l1_binds == 0 && + sparse_submit->wait_count == 0 && sparse_submit->signal_count == 0) goto out_dynarrays; anv_genX(device->info, write_trtt_entries)(&submit->base,