Update to mesa 22.3.0-rc2

Resolves: rhbz#2117184
This commit is contained in:
Dave Airlie 2022-11-11 13:44:28 +10:00
parent 59b3409b97
commit 54717c8ad9
7 changed files with 184 additions and 422 deletions

View File

@ -0,0 +1,37 @@
From a17c79c9df4a55ce9dfbe878d9cd19441a4e193e Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 10 Nov 2022 15:20:24 +1000
Subject: [PATCH 1/2] Revert "glx: Guard usage of infer_zink && !explicit_zink
in glxext.c"
This reverts commit ffab4c8cb7bc7362cd3318f39162a98629bd4d19.
---
src/glx/glxext.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 7f2fc2a0691..156bfc90946 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -969,7 +969,6 @@ __glXInitialize(Display * dpy)
#endif
if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
-#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
Bool fail = true;
/* if zink was inferred, retry without zink */
if (infer_zink && !explicit_zink) {
@@ -981,10 +980,6 @@ __glXInitialize(Display * dpy)
free(dpyPriv);
return NULL;
}
-#else
- free(dpyPriv);
- return NULL;
-#endif
}
__glX_send_client_info(dpyPriv);
--
2.38.1

View File

@ -1,39 +0,0 @@
From 0db29ee48d4f4fd0858bcf7def39926e2ee19d63 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 1 Sep 2022 11:37:27 +1000
Subject: [PATCH] llvmpipe: finish rendering before flushing frontbuffer
resources.
Fixes misrendering on front with mesa demos
---
src/gallium/drivers/llvmpipe/lp_screen.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 333d7695ee7..0fcbcccedd2 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -51,6 +51,7 @@
#include "lp_limits.h"
#include "lp_rast.h"
#include "lp_cs_tpool.h"
+#include "lp_flush.h"
#include "frontend/sw_winsys.h"
@@ -835,8 +836,11 @@ llvmpipe_flush_frontbuffer(struct pipe_screen *_screen,
struct llvmpipe_resource *texture = llvmpipe_resource(resource);
assert(texture->dt);
- if (texture->dt)
+
+ if (texture->dt) {
+ llvmpipe_flush_resource(_pipe, resource, 0, true, true, false, "frontbuffer");
winsys->displaytarget_display(winsys, texture->dt, context_private, sub_box);
+ }
}
static void
--
2.31.1

View File

@ -1,229 +0,0 @@
From 64e7c42f1b68250d2280320e01da2f5a0c4b07eb Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Fri, 22 Jul 2022 11:12:58 +1000
Subject: [PATCH 1/2] llvmpipe: make last_fence a screen/rast object not a
context one.
When a flush happens the per-context setup is used to hold the fence
for the last scene sent to the rasterizer. However when multiple
contexts are in use, this fence won't get returned to be blocked on.
Instead move the last fence to the rasterizer object, and return
that instead as it should be valid across contexts.
Fixes gtk4 bugs on llvmpipe since overlapping vertex/fragment.
Fixes: 6bbbe15a783a ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17702>
---
src/gallium/drivers/llvmpipe/lp_flush.c | 12 ++++++---
src/gallium/drivers/llvmpipe/lp_rast.c | 14 +++++++++-
src/gallium/drivers/llvmpipe/lp_rast.h | 3 ++-
src/gallium/drivers/llvmpipe/lp_rast_priv.h | 2 ++
src/gallium/drivers/llvmpipe/lp_setup.c | 26 +++++--------------
src/gallium/drivers/llvmpipe/lp_setup.h | 1 -
.../drivers/llvmpipe/lp_setup_context.h | 1 -
7 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c
index c231f334eaf..c72944232e7 100644
--- a/src/gallium/drivers/llvmpipe/lp_flush.c
+++ b/src/gallium/drivers/llvmpipe/lp_flush.c
@@ -38,7 +38,9 @@
#include "lp_flush.h"
#include "lp_context.h"
#include "lp_setup.h"
-
+#include "lp_fence.h"
+#include "lp_screen.h"
+#include "lp_rast.h"
/**
* \param fence if non-null, returns pointer to a fence which can be waited on
@@ -49,11 +51,15 @@ llvmpipe_flush( struct pipe_context *pipe,
const char *reason)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
-
+ struct llvmpipe_screen *screen = llvmpipe_screen(pipe->screen);
draw_flush(llvmpipe->draw);
/* ask the setup module to flush */
- lp_setup_flush(llvmpipe->setup, fence, reason);
+ lp_setup_flush(llvmpipe->setup, reason);
+
+ lp_rast_fence(screen->rast, (struct lp_fence **)fence);
+ if (fence && (!*fence))
+ *fence = (struct pipe_fence_handle *)lp_fence_create(0);
/* Enable to dump BMPs of the color/depth buffers each frame */
if (0) {
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index e27d78a3432..6cdaa51b62d 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -47,6 +47,7 @@
#include "gallivm/lp_bld_format.h"
#include "gallivm/lp_bld_debug.h"
#include "lp_scene.h"
+#include "lp_screen.h"
#include "lp_tex_sample.h"
@@ -1128,6 +1129,10 @@ lp_rast_queue_scene( struct lp_rasterizer *rast,
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
+ lp_fence_reference(&rast->last_fence, scene->fence);
+ if (rast->last_fence)
+ rast->last_fence->issued = TRUE;
+
if (rast->num_threads == 0) {
/* no threading */
unsigned fpstate = util_fpstate_get();
@@ -1384,6 +1389,8 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
align_free(rast->tasks[i].thread_data.cache);
}
+ lp_fence_reference(&rast->last_fence, NULL);
+
/* for synchronizing rasterization threads */
if (rast->num_threads > 0) {
util_barrier_destroy( &rast->barrier );
@@ -1394,4 +1401,9 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
FREE(rast);
}
-
+void lp_rast_fence(struct lp_rasterizer *rast,
+ struct lp_fence **fence)
+{
+ if (fence)
+ lp_fence_reference((struct lp_fence **)fence, rast->last_fence);
+}
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h
index 14a2710f7f5..1756345737f 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast.h
@@ -388,5 +388,6 @@ lp_debug_draw_bins_by_cmd_length( struct lp_scene *scene );
void
lp_debug_draw_bins_by_coverage( struct lp_scene *scene );
-
+void lp_rast_fence(struct lp_rasterizer *rast,
+ struct lp_fence **fence);
#endif
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
index c4da9cca2ff..8b28893aa22 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
@@ -129,6 +129,8 @@ struct lp_rasterizer
/** For synchronizing the rasterization threads */
util_barrier barrier;
+
+ struct lp_fence *last_fence;
};
void
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index ce681792683..ad92e2557c2 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -207,11 +207,6 @@ lp_setup_rasterize_scene( struct lp_setup_context *setup )
lp_scene_end_binning(scene);
- lp_fence_reference(&setup->last_fence, scene->fence);
-
- if (setup->last_fence)
- setup->last_fence->issued = TRUE;
-
mtx_lock(&screen->rast_mutex);
lp_rast_queue_scene(screen->rast, scene);
mtx_unlock(&screen->rast_mutex);
@@ -387,17 +382,10 @@ fail:
void
-lp_setup_flush( struct lp_setup_context *setup,
- struct pipe_fence_handle **fence,
- const char *reason)
+lp_setup_flush(struct lp_setup_context *setup,
+ const char *reason)
{
- set_scene_state( setup, SETUP_FLUSHED, reason );
-
- if (fence) {
- lp_fence_reference((struct lp_fence **)fence, setup->last_fence);
- if (!*fence)
- *fence = (struct pipe_fence_handle *)lp_fence_create(0);
- }
+ set_scene_state(setup, SETUP_FLUSHED, reason);
}
@@ -571,7 +559,7 @@ lp_setup_clear( struct lp_setup_context *setup,
if (flags & PIPE_CLEAR_DEPTHSTENCIL) {
unsigned flagszs = flags & PIPE_CLEAR_DEPTHSTENCIL;
if (!lp_setup_try_clear_zs(setup, depth, stencil, flagszs)) {
- lp_setup_flush(setup, NULL, __FUNCTION__);
+ set_scene_state( setup, SETUP_FLUSHED, __FUNCTION__ );
if (!lp_setup_try_clear_zs(setup, depth, stencil, flagszs))
assert(0);
@@ -583,7 +571,7 @@ lp_setup_clear( struct lp_setup_context *setup,
for (i = 0; i < setup->fb.nr_cbufs; i++) {
if ((flags & (1 << (2 + i))) && setup->fb.cbufs[i]) {
if (!lp_setup_try_clear_color_buffer(setup, color, i)) {
- lp_setup_flush(setup, NULL, __FUNCTION__);
+ set_scene_state( setup, SETUP_FLUSHED, __FUNCTION__ );
if (!lp_setup_try_clear_color_buffer(setup, color, i))
assert(0);
@@ -1589,7 +1577,6 @@ lp_setup_destroy( struct lp_setup_context *setup )
LP_DBG(DEBUG_SETUP, "number of scenes used: %d\n", setup->num_active_scenes);
slab_destroy(&setup->scene_slab);
- lp_fence_reference(&setup->last_fence, NULL);
FREE( setup );
}
@@ -1758,7 +1745,8 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq)
}
}
else {
- lp_fence_reference(&pq->fence, setup->last_fence);
+ struct llvmpipe_screen *screen = llvmpipe_screen(setup->pipe->screen);
+ lp_rast_fence(screen->rast, &pq->fence);
}
fail:
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h b/src/gallium/drivers/llvmpipe/lp_setup.h
index 5ecef123417..fe360be63ca 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup.h
@@ -64,7 +64,6 @@ lp_setup_clear(struct lp_setup_context *setup,
void
lp_setup_flush( struct lp_setup_context *setup,
- struct pipe_fence_handle **fence,
const char *reason);
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h
index 420b78e2f52..fac84fb56ec 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h
@@ -96,7 +96,6 @@ struct lp_setup_context
struct lp_scene *scenes[MAX_SCENES]; /**< all the scenes */
struct lp_scene *scene; /**< current scene being built */
- struct lp_fence *last_fence;
struct llvmpipe_query *active_queries[LP_MAX_ACTIVE_BINNED_QUERIES];
unsigned active_binned_queries;
--
2.37.1

View File

@ -0,0 +1,133 @@
From cb4d4c8e9c424969f2d7834e15fd8123dbbda84a Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 10 Nov 2022 15:27:08 +1000
Subject: [PATCH 2/2] Revert "egl/glx: add fallback for zink loading"
This reverts commit 2569215f43f6ce71fb8eb2181b36c6cf976bce2a.
This break glxinfo in a swrast only VM for me on Fedora
---
src/egl/main/eglapi.c | 22 ++++------------------
src/glx/drisw_glx.c | 5 ++++-
src/glx/glxext.c | 29 ++++++-----------------------
3 files changed, 14 insertions(+), 42 deletions(-)
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 15f6e2e173b..041f35aa7b6 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -701,26 +701,12 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
* If the initialisation fails, try again using only software rendering.
*/
if (!_eglDriver.Initialize(disp)) {
- bool fail = true;
- if (!disp->Options.ForceSoftware && !disp->Options.Zink &&
- !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && !getenv("GALLIUM_DRIVER")) {
- /* zink fallback */
- disp->Options.Zink = EGL_TRUE;
+ if (disp->Options.ForceSoftware)
+ RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
+ else {
disp->Options.ForceSoftware = EGL_TRUE;
- fail = !_eglDriver.Initialize(disp);
- if (fail) {
- disp->Options.Zink = EGL_FALSE;
- disp->Options.ForceSoftware = EGL_FALSE;
- }
- }
- if (fail) {
- if (disp->Options.ForceSoftware)
+ if (!_eglDriver.Initialize(disp))
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
- else {
- disp->Options.ForceSoftware = EGL_TRUE;
- if (!_eglDriver.Initialize(disp))
- RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
- }
}
}
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index c124c62c31e..25d853fcd16 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -1054,8 +1054,11 @@ static struct glx_screen *
driswCreateScreen(int screen, struct glx_display *priv)
{
const struct drisw_display *pdpyp = (struct drisw_display *)priv->driswDisplay;
+ if (pdpyp->zink && !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false)) {
+ return driswCreateScreenDriver(screen, priv, "zink");
+ }
- return driswCreateScreenDriver(screen, priv, pdpyp->zink ? "zink" : "swrast");
+ return driswCreateScreenDriver(screen, priv, "swrast");
}
/* Called from __glXFreeDisplayPrivate.
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 156bfc90946..e4da247b349 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -923,9 +923,9 @@ __glXInitialize(Display * dpy)
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
Bool glx_direct = !debug_get_bool_option("LIBGL_ALWAYS_INDIRECT", false);
Bool glx_accel = !debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
+ Bool zink;
const char *env = getenv("MESA_LOADER_DRIVER_OVERRIDE");
- Bool explicit_zink = env && !strcmp(env, "zink");
- Bool infer_zink = false;
+ zink = env && !strcmp(env, "zink");
dpyPriv->drawHash = __glxHashCreate();
@@ -940,25 +940,17 @@ __glXInitialize(Display * dpy)
** (e.g., those called in AllocAndFetchScreenConfigs).
*/
#if defined(GLX_USE_DRM)
- if (glx_direct && glx_accel && !explicit_zink) {
+ if (glx_direct && glx_accel && !zink) {
#if defined(HAVE_DRI3)
if (!debug_get_bool_option("LIBGL_DRI3_DISABLE", false))
dpyPriv->dri3Display = dri3_create_display(dpy);
#endif /* HAVE_DRI3 */
if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
dpyPriv->dri2Display = dri2CreateDisplay(dpy);
- /* zink fallback */
- if (!dpyPriv->dri3Display && !dpyPriv->dri2Display)
- infer_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && !getenv("GALLIUM_DRIVER");
}
#endif /* GLX_USE_DRM */
if (glx_direct)
- dpyPriv->driswDisplay = driswCreateDisplay(dpy, explicit_zink | infer_zink);
-
-#ifdef GLX_USE_WINDOWSGL
- if (glx_direct && glx_accel)
- dpyPriv->windowsdriDisplay = driwindowsCreateDisplay(dpy);
-#endif
+ dpyPriv->driswDisplay = driswCreateDisplay(dpy, zink);
#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */
#ifdef GLX_USE_APPLEGL
@@ -969,17 +961,8 @@ __glXInitialize(Display * dpy)
#endif
if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
- Bool fail = true;
- /* if zink was inferred, retry without zink */
- if (infer_zink && !explicit_zink) {
- free(dpyPriv->screens);
- driswCreateDisplay(dpy, false);
- fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv);
- }
- if (fail) {
- free(dpyPriv);
- return NULL;
- }
+ free(dpyPriv);
+ return NULL;
}
__glX_send_client_info(dpyPriv);
--
2.38.1

View File

@ -1,145 +0,0 @@
From af0e5160c4d81beed879b4669b7f3bb875056d1e Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Mon, 25 Jul 2022 13:28:08 +1000
Subject: [PATCH 2/2] llvmpipe: keep context list and use to track resource
usage.
Just check across all contexts if a resource is referenced.
Fixes: 6bbbe15a783a ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17702>
---
src/gallium/drivers/llvmpipe/lp_context.c | 12 ++++++++++--
src/gallium/drivers/llvmpipe/lp_context.h | 2 ++
src/gallium/drivers/llvmpipe/lp_flush.c | 10 ++++++----
src/gallium/drivers/llvmpipe/lp_screen.c | 2 ++
src/gallium/drivers/llvmpipe/lp_screen.h | 4 ++++
5 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 8038e219015..3cce460f213 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -57,8 +57,12 @@
static void llvmpipe_destroy( struct pipe_context *pipe )
{
struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
+ struct llvmpipe_screen *lp_screen = llvmpipe_screen(pipe->screen);
uint i;
+ mtx_lock(&lp_screen->ctx_mutex);
+ list_del(&llvmpipe->list);
+ mtx_unlock(&lp_screen->ctx_mutex);
lp_print_counters();
if (llvmpipe->csctx) {
@@ -189,8 +193,9 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
unsigned flags)
{
struct llvmpipe_context *llvmpipe;
+ struct llvmpipe_screen *lp_screen = llvmpipe_screen(screen);
- if (!llvmpipe_screen_late_init(llvmpipe_screen(screen)))
+ if (!llvmpipe_screen_late_init(lp_screen))
return NULL;
llvmpipe = align_malloc(sizeof(struct llvmpipe_context), 16);
@@ -254,7 +259,7 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
goto fail;
draw_set_disk_cache_callbacks(llvmpipe->draw,
- llvmpipe_screen(screen),
+ lp_screen,
lp_draw_disk_cache_find_shader,
lp_draw_disk_cache_insert_shader);
@@ -307,6 +312,9 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
*/
llvmpipe->dirty |= LP_NEW_SCISSOR;
+ mtx_lock(&lp_screen->ctx_mutex);
+ list_addtail(&llvmpipe->list, &lp_screen->ctx_list);
+ mtx_unlock(&lp_screen->ctx_mutex);
return &llvmpipe->pipe;
fail:
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
index 1cabf98177f..f6b7719c6de 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
@@ -35,6 +35,7 @@
#include "draw/draw_vertex.h"
#include "util/u_blitter.h"
+#include "util/list.h"
#include "lp_tex_sample.h"
#include "lp_jit.h"
@@ -58,6 +59,7 @@ struct lp_velems_state;
struct llvmpipe_context {
struct pipe_context pipe; /**< base class */
+ struct list_head list;
/** Constant state objects */
const struct pipe_blend_state *blend;
struct pipe_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c
index c72944232e7..c49836432a9 100644
--- a/src/gallium/drivers/llvmpipe/lp_flush.c
+++ b/src/gallium/drivers/llvmpipe/lp_flush.c
@@ -111,10 +111,12 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
boolean do_not_block,
const char *reason)
{
- unsigned referenced;
-
- referenced = llvmpipe_is_resource_referenced(pipe, resource, level);
-
+ unsigned referenced = 0;
+ struct llvmpipe_screen *lp_screen = llvmpipe_screen(pipe->screen);
+ mtx_lock(&lp_screen->ctx_mutex);
+ list_for_each_entry(struct llvmpipe_context, ctx, &lp_screen->ctx_list, list)
+ referenced |= llvmpipe_is_resource_referenced((struct pipe_context *)ctx, resource, level);
+ mtx_unlock(&lp_screen->ctx_mutex);
if ((referenced & LP_REFERENCED_FOR_WRITE) ||
((referenced & LP_REFERENCED_FOR_READ) && !read_only)) {
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 359c200279f..9c67d874c5f 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -1085,6 +1085,8 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
snprintf(screen->renderer_string, sizeof(screen->renderer_string), "llvmpipe (LLVM " MESA_LLVM_VERSION_STRING ", %u bits)", lp_native_vector_width );
+ list_inithead(&screen->ctx_list);
+ (void) mtx_init(&screen->ctx_mutex, mtx_plain);
(void) mtx_init(&screen->cs_mutex, mtx_plain);
(void) mtx_init(&screen->rast_mutex, mtx_plain);
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h
index c72bf838acb..18635c687bc 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.h
+++ b/src/gallium/drivers/llvmpipe/lp_screen.h
@@ -37,6 +37,7 @@
#include "pipe/p_screen.h"
#include "pipe/p_defines.h"
#include "os/os_thread.h"
+#include "util/list.h"
#include "gallivm/lp_bld.h"
#include "gallivm/lp_bld_misc.h"
@@ -67,6 +68,9 @@ struct llvmpipe_screen
mtx_t late_mutex;
bool late_init_done;
+ mtx_t ctx_mutex;
+ struct list_head ctx_list;
+
char renderer_string[100];
struct disk_cache *disk_shader_cache;
--
2.37.1

View File

@ -52,9 +52,9 @@
Name: mesa Name: mesa
Summary: Mesa graphics libraries Summary: Mesa graphics libraries
%global ver 22.1.5 %global ver 22.3.0-rc2
Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)} Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
Release: 2%{?dist} Release: 1%{?dist}
License: MIT License: MIT
URL: http://www.mesa3d.org URL: http://www.mesa3d.org
@ -64,11 +64,9 @@ Source0: https://mesa.freedesktop.org/archive/%{name}-%{ver}.tar.xz
# Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD. # Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD.
Source1: Mesa-MLAA-License-Clarification-Email.txt Source1: Mesa-MLAA-License-Clarification-Email.txt
# two llvmpipe multi-context fixes # revert zink autoloader it breaks glxinfo in a VM
Patch10: 0001-llvmpipe-make-last_fence-a-screen-rast-object-not-a-.patch Patch10: 0001-Revert-glx-Guard-usage-of-infer_zink-explicit_zink-i.patch
Patch11: 0002-llvmpipe-keep-context-list-and-use-to-track-resource.patch Patch11: 0002-Revert-egl-glx-add-fallback-for-zink-loading.patch
# a frontbuffer misrendering fix
Patch12: 0001-llvmpipe-finish-rendering-before-flushing-frontbuffe.patch
BuildRequires: meson >= 0.45 BuildRequires: meson >= 0.45
BuildRequires: gcc BuildRequires: gcc
@ -131,6 +129,7 @@ BuildRequires: pkgconfig(valgrind)
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-mako BuildRequires: python3-mako
BuildRequires: vulkan-headers BuildRequires: vulkan-headers
BuildRequires: glslang
%if 0%{?with_vulkan_hw} %if 0%{?with_vulkan_hw}
BuildRequires: pkgconfig(vulkan) BuildRequires: pkgconfig(vulkan)
%endif %endif
@ -400,7 +399,7 @@ popd
%files libEGL-devel %files libEGL-devel
%dir %{_includedir}/EGL %dir %{_includedir}/EGL
%{_includedir}/EGL/eglmesaext.h %{_includedir}/EGL/eglmesaext.h
%{_includedir}/EGL/eglextchromium.h %{_includedir}/EGL/eglext_angle.h
%ldconfig_scriptlets libglapi %ldconfig_scriptlets libglapi
%files libglapi %files libglapi
@ -492,6 +491,7 @@ popd
%ifarch %{arm} aarch64 %ifarch %{arm} aarch64
%{_libdir}/dri/ingenic-drm_dri.so %{_libdir}/dri/ingenic-drm_dri.so
%{_libdir}/dri/imx-drm_dri.so %{_libdir}/dri/imx-drm_dri.so
%{_libdir}/dri/imx-lcdif_dri.so
%{_libdir}/dri/mcde_dri.so %{_libdir}/dri/mcde_dri.so
%{_libdir}/dri/mxsfb-drm_dri.so %{_libdir}/dri/mxsfb-drm_dri.so
%{_libdir}/dri/stm_dri.so %{_libdir}/dri/stm_dri.so
@ -529,6 +529,7 @@ popd
%if 0%{?with_radeonsi} %if 0%{?with_radeonsi}
%{_libdir}/dri/radeonsi_drv_video.so %{_libdir}/dri/radeonsi_drv_video.so
%endif %endif
%{_libdir}/dri/virtio_gpu_drv_video.so
%endif %endif
%if 0%{?with_opencl} %if 0%{?with_opencl}
%dir %{_libdir}/gallium-pipe %dir %{_libdir}/gallium-pipe
@ -566,6 +567,7 @@ popd
%if 0%{?with_vdpau} %if 0%{?with_vdpau}
%files vdpau-drivers %files vdpau-drivers
%{_libdir}/vdpau/libvdpau_nouveau.so.1* %{_libdir}/vdpau/libvdpau_nouveau.so.1*
%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1*
%if 0%{?with_r300} %if 0%{?with_r300}
%{_libdir}/vdpau/libvdpau_r300.so.1* %{_libdir}/vdpau/libvdpau_r300.so.1*
%endif %endif
@ -599,6 +601,9 @@ popd
%endif %endif
%changelog %changelog
* Fri Nov 11 2022 Dave Airlie <airlied@redhat.com> - 22.3.0~rc2.1
- Update to mesa 22.3.0-rc2
* Thu Sep 01 2022 Dave Airlie <airlied@redhat.com> - 22.1.5-2 * Thu Sep 01 2022 Dave Airlie <airlied@redhat.com> - 22.1.5-2
- fix frontbuffer misrendering - fix frontbuffer misrendering

View File

@ -1 +1 @@
SHA512 (mesa-22.1.5.tar.xz) = 1aa72cd5b61635d489904944e5d80b1d923a38ffbd295341e6b30c492e469463bc4d0b63f74b071580572aec3a2cdfe19b3f2919ebc0fb4bcc35e114db925abc SHA512 (mesa-22.3.0-rc2.tar.xz) = dad41ba87b5f55c4e6f3478c348c14fc8b2b29beb87f20d99cedeeeb47bb787e2fe98570544cdb9bb06466fc3c61a43b9797d27e5f1b700c608ef539a5916fd4