revert llvmpipe overlap patch to see if it fixes rawhide

This commit is contained in:
Dave Airlie 2022-05-26 06:59:43 +10:00
parent 1ec6f41978
commit 57415a0c66
2 changed files with 103 additions and 0 deletions

View File

@ -0,0 +1,102 @@
From 17138c1943afa845772e9d566bbe168ef678cb36 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 26 May 2022 06:58:40 +1000
Subject: [PATCH] Revert "Reinstate: llvmpipe: allow vertex processing and
fragment processing in parallel"
This reverts commit 6bbbe15a783a3b004d994057a96b91d5cf5d08da.
---
src/gallium/drivers/llvmpipe/lp_rast.c | 2 ++
src/gallium/drivers/llvmpipe/lp_scene.c | 2 +-
src/gallium/drivers/llvmpipe/lp_setup.c | 18 ++++++++++++++----
.../drivers/llvmpipe/lp_setup_context.h | 1 +
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index e27d78a3432..f67fbda6b01 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -81,6 +81,8 @@ lp_rast_begin( struct lp_rasterizer *rast,
static void
lp_rast_end( struct lp_rasterizer *rast )
{
+ lp_scene_end_rasterization( rast->curr_scene );
+
rast->curr_scene = NULL;
}
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
index dbe0cc3873c..3d109ff52b6 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
@@ -100,7 +100,7 @@ lp_scene_create( struct lp_setup_context *setup )
void
lp_scene_destroy(struct lp_scene *scene)
{
- lp_scene_end_rasterization(scene);
+ lp_fence_reference(&scene->fence, NULL);
mtx_destroy(&scene->mutex);
assert(scene->data.head == &scene->data.first);
slab_free_st(&scene->setup->scene_slab, scene);
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index ce681792683..366efceca42 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -73,7 +73,6 @@ lp_setup_wait_empty_scene(struct lp_setup_context *setup)
debug_printf("%s: wait for scene %d\n",
__FUNCTION__, setup->scenes[0]->fence->id);
lp_fence_wait(setup->scenes[0]->fence);
- lp_scene_end_rasterization(setup->scenes[0]);
}
return 0;
}
@@ -87,10 +86,8 @@ lp_setup_get_empty_scene(struct lp_setup_context *setup)
/* try and find a scene that isn't being used */
for (i = 0; i < setup->num_active_scenes; i++) {
if (setup->scenes[i]->fence) {
- if (lp_fence_signalled(setup->scenes[i]->fence)) {
- lp_scene_end_rasterization(setup->scenes[i]);
+ if (lp_fence_signalled(setup->scene->fence))
break;
- }
} else
break;
}
@@ -213,9 +210,22 @@ lp_setup_rasterize_scene( struct lp_setup_context *setup )
setup->last_fence->issued = TRUE;
mtx_lock(&screen->rast_mutex);
+
+ /* FIXME: We enqueue the scene then wait on the rasterizer to finish.
+ * This means we never actually run any vertex stuff in parallel to
+ * rasterization (not in the same context at least) which is what the
+ * multiple scenes per setup is about - when we get a new empty scene
+ * any old one is already empty again because we waited here for
+ * raster tasks to be finished. Ideally, we shouldn't need to wait here
+ * and rely on fences elsewhere when waiting is necessary.
+ * Certainly, lp_scene_end_rasterization() would need to be deferred too
+ * and there's probably other bits why this doesn't actually work.
+ */
lp_rast_queue_scene(screen->rast, scene);
+ lp_rast_finish(screen->rast);
mtx_unlock(&screen->rast_mutex);
+ lp_scene_end_rasterization(setup->scene);
lp_setup_reset( setup );
LP_DBG(DEBUG_SETUP, "%s done \n", __FUNCTION__);
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h
index 420b78e2f52..92dfeb890d5 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h
@@ -56,6 +56,7 @@ struct lp_setup_variant;
/** Max number of scenes */
+/* XXX: make multiple scenes per context work, see lp_setup_rasterize_scene */
#define INITIAL_SCENES 4
#define MAX_SCENES 64
--
2.35.3

View File

@ -74,6 +74,7 @@ Patch0006: 0004-Revert-nouveau-no-modifier-the-invalid-modifier.patch
Patch0007: 0005-Revert-nouveau-Use-DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEA.patch Patch0007: 0005-Revert-nouveau-Use-DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEA.patch
Patch0008: 0006-Revert-nouveau-Stash-supported-sector-layout-in-scre.patch Patch0008: 0006-Revert-nouveau-Stash-supported-sector-layout-in-scre.patch
Patch0009: 0001-Revert-Reinstate-llvmpipe-allow-vertex-processing-an.patch
BuildRequires: meson >= 0.45 BuildRequires: meson >= 0.45
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++