summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Piñeiro <apinheiro@igalia.com>2021-05-26 23:21:31 +0200
committerAlejandro Piñeiro <apinheiro@igalia.com>2021-06-01 12:22:28 +0200
commitec85862d7630765ece666f19296379345aaf1d07 (patch)
treee5ea08db38ba1f8538ae49826efbeb68f935cd75
parent7f3e34bcb4d9188aa06a0bafd7fd62f13ca92bed (diff)
downloadmesa-ec85862d7630765ece666f19296379345aaf1d07.tar.gz
mesa-ec85862d7630765ece666f19296379345aaf1d07.tar.bz2
mesa-ec85862d7630765ece666f19296379345aaf1d07.zip
v3d/simulator: use the proper register when waiting on a CSD submit
Until now we were waiting until having a dispatch current and/or queued. But that would only wait for all shaders to have started, it won't wait for them to have finished. With this commit we wait until the NUM_COMPLETED_JOBS (that in spite of that name, it is about dispatches) field got increased. This is in general safest, and it is needed after the latest simulator update to get CTS tests like the following ones working: dEQP-VK.compute.basic.copy_ssbo_multiple_invocations dEQP-VK.compute.basic.copy_ssbo_single_invocation dEQP-VK.compute.basic.ssbo_rw_single_invocation dEQP-VK.compute.basic.ssbo_unsized_arr_single_invocation dEQP-VK.compute.basic.ubo_to_ssbo_multiple_invocations dEQP-VK.compute.basic.ubo_to_ssbo_single_invocation v2 (from Juan feedback): * Clarify JOBS vs DISPATCHES Reviewed-by: Juan A. Suarez <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11039>
-rw-r--r--src/broadcom/simulator/v3dx_simulator.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/broadcom/simulator/v3dx_simulator.c b/src/broadcom/simulator/v3dx_simulator.c
index 6052f100d38..fe564596d6f 100644
--- a/src/broadcom/simulator/v3dx_simulator.c
+++ b/src/broadcom/simulator/v3dx_simulator.c
@@ -213,6 +213,8 @@ v3dX(simulator_submit_csd_ioctl)(struct v3d_hw *v3d,
struct drm_v3d_submit_csd *args,
uint32_t gmp_ofs)
{
+ int last_completed_jobs = (V3D_READ(V3D_CSD_0_STATUS) &
+ V3D_CSD_0_STATUS_NUM_COMPLETED_JOBS_SET);
g_gmp_ofs = gmp_ofs;
v3d_reload_gmp(v3d);
@@ -227,9 +229,13 @@ v3dX(simulator_submit_csd_ioctl)(struct v3d_hw *v3d,
/* CFG0 kicks off the job */
V3D_WRITE(V3D_CSD_0_QUEUED_CFG0, args->cfg[0]);
- while (V3D_READ(V3D_CSD_0_STATUS) &
- (V3D_CSD_0_STATUS_HAVE_CURRENT_DISPATCH_SET |
- V3D_CSD_0_STATUS_HAVE_QUEUED_DISPATCH_SET)) {
+ /* Now we wait for the dispatch to finish. The safest way is to check
+ * if NUM_COMPLETED_JOBS has increased. Note that in spite of that
+ * name that register field is about the number of completed
+ * dispatches.
+ */
+ while ((V3D_READ(V3D_CSD_0_STATUS) &
+ V3D_CSD_0_STATUS_NUM_COMPLETED_JOBS_SET) == last_completed_jobs) {
v3d_hw_tick(v3d);
}