Merge pull request #11180 from Rmys/master

mesa-22.3.1
This commit is contained in:
Rmys
2022-12-15 21:46:27 +03:00
committed by GitHub
12 changed files with 12 additions and 2322 deletions
+4 -3
View File
@@ -18,11 +18,10 @@ def setup():
-Ddri3=enabled \
-Dgallium-extra-hud=true \
-Dgallium-vdpau=enabled \
-Dgallium-xvmc=enabled \
-Dgallium-va=enabled \
-Dgallium-xa=enabled \
-Dgallium-nine=true \
-Dvulkan-drivers=amd,intel,swrast \
-Dvulkan-drivers=amd,intel,intel_hasvk,swrast \
-Dvulkan-layers=device-select,intel-nullhw,overlay \
-Dvideo-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc \
-Dshared-glapi=enabled \
@@ -59,7 +58,9 @@ def setup():
pisitools.cflags.add("-m64 ")
pisitools.cxxflags.add("-m64")
options += " -Dgallium-omx=bellagio -Dlmsensors=enabled -Dzstd=enabled \
-Dgallium-drivers=r300,r600,nouveau,radeonsi,svga,iris,swrast,virgl,crocus,zink,d3d12"
-Dgallium-rusticl=true \
-Drust_std=2021 \
-Dgallium-drivers=r300,r600,nouveau,radeonsi,svga,iris,swrast,virgl,crocus,zink,d3d12"
#pisitools.ldflags.add("-fuse-ld=lld")
mesontools.configure(options)
File diff suppressed because it is too large Load Diff
@@ -1,96 +0,0 @@
From: Ilia Mirkin <imirkin@alum.mit.edu>
Date: Mon Jun 6 20:30:48 2016 -0400
Subject: [PATCH 2/5]nouveau: more locking - make sure that fence work is always done with the push mutex acquired
Patch-mainline: N/A
References: boo#997171
Signed-off-by: Max Staudt <mstaudt@suse.de>
Cherry-picked from 2733e5483e1c2b80e4b0ae21187ec5e3e1579397
at https://github.com/imirkin/mesa.git
Signed-off-by: Max Staudt <mstaudt@suse.de>
---
src/gallium/drivers/nouveau/nouveau_buffer.c | 4 ++++
src/gallium/drivers/nouveau/nv50/nv50_miptree.c | 7 +++++--
src/gallium/drivers/nouveau/nv50/nv50_query_hw.c | 5 ++++-
src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c | 5 ++++-
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c
index b54c19b..a5a06cf 100644
--- a/src/gallium/drivers/nouveau/nouveau_buffer.c
+++ b/src/gallium/drivers/nouveau/nouveau_buffer.c
@@ -80,6 +80,8 @@ release_allocation(struct nouveau_mm_allocation **mm,
inline void
nouveau_buffer_release_gpu_storage(struct nv04_resource *buf)
{
+ if (buf->fence)
+ pipe_mutex_lock(buf->fence->screen->push_mutex);
if (buf->fence && buf->fence->state < NOUVEAU_FENCE_STATE_FLUSHED) {
nouveau_fence_work(buf->fence, nouveau_fence_unref_bo, buf->bo);
buf->bo = NULL;
@@ -89,6 +91,8 @@ nouveau_buffer_release_gpu_storage(struct nv04_resource *buf)
if (buf->mm)
release_allocation(&buf->mm, buf->fence);
+ if (buf->fence)
+ pipe_mutex_unlock(buf->fence->screen->push_mutex);
if (buf->domain == NOUVEAU_BO_VRAM)
NOUVEAU_DRV_STAT_RES(buf, buf_obj_current_bytes_vid, -(uint64_t)buf->base.width0);
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
index 7450119..38e4faf 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
@@ -163,10 +163,13 @@ nv50_miptree_destroy(struct pipe_screen *pscreen, struct pipe_resource *pt)
{
struct nv50_miptree *mt = nv50_miptree(pt);
- if (mt->base.fence && mt->base.fence->state < NOUVEAU_FENCE_STATE_FLUSHED)
+ if (mt->base.fence && mt->base.fence->state < NOUVEAU_FENCE_STATE_FLUSHED) {
+ pipe_mutex_lock(nouveau_screen(pscreen)->push_mutex);
nouveau_fence_work(mt->base.fence, nouveau_fence_unref_bo, mt->base.bo);
- else
+ pipe_mutex_unlock(nouveau_screen(pscreen)->push_mutex);
+ } else {
nouveau_bo_ref(NULL, &mt->base.bo);
+ }
nouveau_fence_ref(NULL, &mt->base.fence);
nouveau_fence_ref(NULL, &mt->base.fence_wr);
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query_hw.c b/src/gallium/drivers/nouveau/nv50/nv50_query_hw.c
index 9067bcc..d2ad72e 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_query_hw.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_query_hw.c
@@ -56,9 +56,12 @@ nv50_hw_query_allocate(struct nv50_context *nv50, struct nv50_query *q,
if (hq->mm) {
if (hq->state == NV50_HW_QUERY_STATE_READY)
nouveau_mm_free(hq->mm);
- else
+ else {
+ pipe_mutex_lock(screen->base.push_mutex);
nouveau_fence_work(screen->base.fence.current,
nouveau_mm_free_work, hq->mm);
+ pipe_mutex_unlock(screen->base.push_mutex);
+ }
}
}
if (size) {
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
index f2584cb..4b51a67 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
@@ -48,9 +48,12 @@ nvc0_hw_query_allocate(struct nvc0_context *nvc0, struct nvc0_query *q,
if (hq->mm) {
if (hq->state == NVC0_HW_QUERY_STATE_READY)
nouveau_mm_free(hq->mm);
- else
+ else {
+ pipe_mutex_lock(screen->base.push_mutex);
nouveau_fence_work(screen->base.fence.current,
nouveau_mm_free_work, hq->mm);
+ pipe_mutex_unlock(screen->base.push_mutex);
+ }
}
}
if (size) {
@@ -1,120 +0,0 @@
From: Ilia Mirkin <imirkin@alum.mit.edu>
Date: Tue Jun 21 22:59:50 2016 -0400
Subject: [PATCH 3/5]nv30 locking fixes
Patch-mainline: N/A
References: boo#997171
Signed-off-by: Max Staudt <mstaudt@suse.de>
Cherry-picked from 940b3a773f264f3f52574160f0d06c48f8e8aeb2
at https://github.com/imirkin/mesa.git
Signed-off-by: Max Staudt <mstaudt@suse.de>
---
src/gallium/drivers/nouveau/nv30/nv30_draw.c | 20 ++++++++++++++++++--
src/gallium/drivers/nouveau/nv30/nv30_fragprog.c | 4 ++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index 7b0d074..1c71534 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -127,6 +127,8 @@ nv30_render_draw_elements(struct vbuf_render *render,
struct nouveau_pushbuf *push = nv30->screen->base.pushbuf;
unsigned i;
+ pipe_mutex_lock(nv30->screen->base.push_mutex);
+
BEGIN_NV04(push, NV30_3D(VTXBUF(0)), r->vertex_info.num_attribs);
for (i = 0; i < r->vertex_info.num_attribs; i++) {
PUSH_RESRC(push, NV30_3D(VTXBUF(i)), BUFCTX_VTXTMP,
@@ -134,8 +136,10 @@ nv30_render_draw_elements(struct vbuf_render *render,
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
}
- if (!nv30_state_validate(nv30, ~0, false))
+ if (!nv30_state_validate(nv30, ~0, false)) {
+ pipe_mutex_unlock(nv30->screen->base.push_mutex);
return;
+ }
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, r->prim);
@@ -160,6 +164,8 @@ nv30_render_draw_elements(struct vbuf_render *render,
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, NV30_3D_VERTEX_BEGIN_END_STOP);
PUSH_RESET(push, BUFCTX_VTXTMP);
+
+ pipe_mutex_unlock(nv30->screen->base.push_mutex);
}
static void
@@ -172,6 +178,8 @@ nv30_render_draw_arrays(struct vbuf_render *render, unsigned start, uint nr)
unsigned ps = fn + (pn ? 1 : 0);
unsigned i;
+ pipe_mutex_lock(nv30->screen->base.push_mutex);
+
BEGIN_NV04(push, NV30_3D(VTXBUF(0)), r->vertex_info.num_attribs);
for (i = 0; i < r->vertex_info.num_attribs; i++) {
PUSH_RESRC(push, NV30_3D(VTXBUF(i)), BUFCTX_VTXTMP,
@@ -179,8 +187,10 @@ nv30_render_draw_arrays(struct vbuf_render *render, unsigned start, uint nr)
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
}
- if (!nv30_state_validate(nv30, ~0, false))
+ if (!nv30_state_validate(nv30, ~0, false)) {
+ pipe_mutex_unlock(nv30->screen->base.push_mutex);
return;
+ }
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, r->prim);
@@ -197,6 +207,8 @@ nv30_render_draw_arrays(struct vbuf_render *render, unsigned start, uint nr)
BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
PUSH_DATA (push, NV30_3D_VERTEX_BEGIN_END_STOP);
PUSH_RESET(push, BUFCTX_VTXTMP);
+
+ pipe_mutex_unlock(nv30->screen->base.push_mutex);
}
static void
@@ -383,6 +395,8 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
nv30_render_validate(nv30);
+ pipe_mutex_unlock(nv30->screen->base.push_mutex);
+
if (nv30->draw_dirty & NV30_NEW_VIEWPORT)
draw_set_viewport_states(draw, 0, 1, &nv30->viewport);
if (nv30->draw_dirty & NV30_NEW_RASTERIZER)
@@ -448,6 +462,8 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
if (transfer[i])
pipe_buffer_unmap(pipe, transfer[i]);
+ pipe_mutex_lock(nv30->screen->base.push_mutex);
+
nv30->draw_dirty = 0;
nv30_state_release(nv30);
}
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c b/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
index 6de61bc..fd21f99 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
@@ -38,6 +38,8 @@ nv30_fragprog_upload(struct nv30_context *nv30)
struct nv30_fragprog *fp = nv30->fragprog.program;
struct pipe_context *pipe = &nv30->base.pipe;
+ pipe_mutex_unlock(nv->screen->push_mutex);
+
if (unlikely(!fp->buffer))
fp->buffer = pipe_buffer_create(pipe->screen, 0, 0, fp->insn_len * 4);
@@ -60,6 +62,8 @@ nv30_fragprog_upload(struct nv30_context *nv30)
if (nv04_resource(fp->buffer)->domain != NOUVEAU_BO_VRAM)
nouveau_buffer_migrate(nv, nv04_resource(fp->buffer), NOUVEAU_BO_VRAM);
+
+ pipe_mutex_lock(nv->screen->push_mutex);
}
void
@@ -1,24 +0,0 @@
From: Max Staudt <mstaudt@suse.de>
Date: Wed Oct 5 18:49:41 2016 +0200
Subject: [PATCH 4/5]nv50: Fix double lock in nv50_hw_sm_get_query_result()
Patch-mainline: N/A
References: boo#997171
Signed-off-by: Max Staudt <mstaudt@suse.de>
Signed-off-by: Max Staudt <mstaudt@suse.de>
---
src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c b/src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c
index 31445eb..acc64ac 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c
@@ -351,7 +351,7 @@ nv50_hw_sm_get_query_result(struct nv50_context *nv50, struct nv50_hw_query *hq,
pipe_mutex_lock(nv50->screen->base.push_mutex);
ret = nv50_hw_sm_query_read_data(count, nv50, wait, hq, cfg, mp_count);
- pipe_mutex_lock(nv50->screen->base.push_mutex);
+ pipe_mutex_unlock(nv50->screen->base.push_mutex);
if (!ret)
return false;
@@ -1,29 +0,0 @@
From: Max Staudt <mstaudt@suse.de>
Date: Wed Oct 5 18:51:38 2016 +0200
Subject: [PATCH 5/5]Use nv50_render_condition() in nv50_blitctx_post_blit()
Patch-mainline: N/A
References: boo#997171
Signed-off-by: Max Staudt <mstaudt@suse.de>
Analogous to what happens in nvc0_blitctx_post_blit()
Signed-off-by: Max Staudt <mstaudt@suse.de>
---
src/gallium/drivers/nouveau/nv50/nv50_surface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
index d6b9de0..36cd72b 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
@@ -1328,8 +1328,8 @@ nv50_blitctx_post_blit(struct nv50_blitctx *blit)
nv50->samplers[2][1] = blit->saved.sampler[1];
if (nv50->cond_query && !blit->render_condition_enable)
- nv50->base.pipe.render_condition(&nv50->base.pipe, nv50->cond_query,
- nv50->cond_cond, nv50->cond_mode);
+ nv50_render_condition(&nv50->base.pipe, nv50->cond_query,
+ nv50->cond_cond, nv50->cond_mode);
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_FB);
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_TEXTURES);
-61
View File
@@ -1,61 +0,0 @@
From ff1a3a00cb37d84ab9a563f0aa241714876f56b4 Mon Sep 17 00:00:00 2001
From: Karol Herbst <kherbst@redhat.com>
Date: Thu, 2 Apr 2020 13:00:14 +0200
Subject: [PATCH] clover: fix build with single library clang build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes: #2560
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4417>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4417>
---
src/gallium/targets/opencl/meson.build | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
index 907cc74337d..6ce01025d0b 100644
--- a/src/gallium/targets/opencl/meson.build
+++ b/src/gallium/targets/opencl/meson.build
@@ -33,16 +33,9 @@ llvm_libdir = dep_llvm.get_configtool_variable('libdir')
opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL'
-libopencl = shared_library(
- opencl_libname,
- [],
- link_args : [ld_args_gc_sections, opencl_link_args],
- link_depends : opencl_link_deps,
- link_whole : libclover,
- link_with : [libpipe_loader_dynamic, libgallium],
- dependencies : [
- idep_mesautil,
- dep_clock, dep_dl, dep_unwind, dep_elf,
+dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
+if not dep_clang.found()
+ dep_clang = [
cpp.find_library('clangCodeGen', dirs : llvm_libdir),
cpp.find_library('clangFrontendTool', dirs : llvm_libdir),
cpp.find_library('clangFrontend', dirs : llvm_libdir),
@@ -56,6 +49,19 @@ libopencl = shared_library(
cpp.find_library('clangEdit', dirs : llvm_libdir),
cpp.find_library('clangLex', dirs : llvm_libdir),
cpp.find_library('clangBasic', dirs : llvm_libdir),
+ ]
+endif
+
+libopencl = shared_library(
+ opencl_libname,
+ [],
+ link_args : [ld_args_gc_sections, opencl_link_args],
+ link_depends : opencl_link_deps,
+ link_whole : libclover,
+ link_with : [libpipe_loader_dynamic, libgallium],
+ dependencies : [
+ idep_mesautil,
+ dep_clock, dep_dl, dep_unwind, dep_elf, dep_clang
],
version : '@0@.0.0'.format(opencl_version),
install : true,
@@ -1,40 +0,0 @@
From: Egbert Eich <eich@suse.de>
Date: Fri Mar 11 13:29:43 2016 +0100
Subject: [PATCH]Define GLAPIVAR separate from GLAPI
Patch-mainline: never
Git-commit: 88dda160564c8c23cb533b0eb258404f1687a2e8
References: bsc#
Signed-off-by: Egbert Eich <eich@suse.com>
GLAPI doesn't contain 'extern' in some environments.
This is needed for variables (GLw).
Signed-off-by: Egbert Eich <eich@suse.de>
---
Mesa-10.0.3/include/GL/gl.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/GL/gl.h b/Mesa-10.0.3/include/GL/gl.h
index b484b96..5189008 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -59,6 +59,7 @@
#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define GLAPI __attribute__((visibility("default")))
# define GLAPIENTRY
+# define GLAPIVAR extern GLAPI
#endif /* WIN32 && !CYGWIN */
/*
@@ -80,6 +81,10 @@
#define GLAPI extern
#endif
+#ifndef GLAPIVAR
+#define GLAPIVAR extern
+#endif
+
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
@@ -1,52 +0,0 @@
From a9af1af5f1f9aa9fdea9e73135a92f053478f849 Mon Sep 17 00:00:00 2001
From: Stefan Dirsch <sndirsch@suse.de>
Date: Wed, 20 Jan 2016 16:10:15 +0100
Subject: [PATCH] VDPAU/XVMC libs: Replace hardlinks with copies
Since these are packaged separately in (open)SUSE anyway, one can use
copies as well. This makes debug packages possible again. (bnc #962609)
Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
---
src/gallium/targets/vdpau/Makefile.am | 4 ++--
src/gallium/targets/xvmc/Makefile.am | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gallium/targets/vdpau/Makefile.am b/src/gallium/targets/vdpau/Makefile.am
index d388f8b..c9cc534 100644
--- a/src/gallium/targets/vdpau/Makefile.am
+++ b/src/gallium/targets/vdpau/Makefile.am
@@ -86,7 +86,7 @@ all-local: $(vdpau_LTLIBRARIES)
j=libvdpau_gallium.$(LIB_EXT); \
k=libvdpau_$${i}.$(LIB_EXT); \
l=$${k}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0; \
- ln -f .libs/$${j}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
+ cp -a .libs/$${j}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
$${link_dir}/$${l}; \
ln -sf $${l} \
$${link_dir}/$${k}.$(VDPAU_MAJOR).$(VDPAU_MINOR); \
@@ -111,7 +111,7 @@ install-data-hook:
j=libvdpau_gallium.$(LIB_EXT); \
k=libvdpau_$${i}.$(LIB_EXT); \
l=$${k}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0; \
- ln -f $${dest_dir}/$${j}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
+ cp -a $${dest_dir}/$${j}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
$${dest_dir}/$${l}; \
ln -sf $${l} \
$${dest_dir}/$${k}.$(VDPAU_MAJOR).$(VDPAU_MINOR); \
diff --git a/src/gallium/targets/xvmc/Makefile.am b/src/gallium/targets/xvmc/Makefile.am
index fdc5f4b..93ef230 100644
--- a/src/gallium/targets/xvmc/Makefile.am
+++ b/src/gallium/targets/xvmc/Makefile.am
@@ -73,7 +73,7 @@ install-data-hook:
j=libXvMCgallium.$(LIB_EXT); \
k=libXvMC$${i}.$(LIB_EXT); \
l=$${k}.$(XVMC_MAJOR).$(XVMC_MINOR).0; \
- ln -f $${dest_dir}/$${j}.$(XVMC_MAJOR).$(XVMC_MINOR).0 \
+ cp -a $${dest_dir}/$${j}.$(XVMC_MAJOR).$(XVMC_MINOR).0 \
$${dest_dir}/$${l}; \
ln -sf $${l} \
$${dest_dir}/$${k}.$(XVMC_MAJOR).$(XVMC_MINOR); \
--
2.6.2
@@ -1,92 +0,0 @@
From a20dc1dd150a6c31153197ceda01827daab4203e Mon Sep 17 00:00:00 2001
From: Vinson Lee <vlee@freedesktop.org>
Date: Wed, 23 Jun 2021 21:58:08 -0700
Subject: [PATCH] swr: Fix build with llvm-13.
Fix build after llvm-13 commit 3302af9d4c39 ("Support: Remove
F_{None,Text,Append} compatibility synonyms, NFC").
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
.../swr/rasterizer/jitter/JitManager.cpp | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 44482939c76..2487f754dc1 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -437,7 +437,11 @@ void JitManager::DumpAsm(Function* pFunction, const char* fileName)
sprintf(fName, "%s.%s.asm", funcName, fileName);
#endif
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream filestream(fName, EC, llvm::sys::fs::OF_None);
+#else
raw_fd_ostream filestream(fName, EC, llvm::sys::fs::F_None);
+#endif
legacy::PassManager* pMPasses = new legacy::PassManager();
auto* pTarget = mpExec->getTargetMachine();
@@ -490,7 +494,11 @@ void JitManager::DumpToFile(Module* M,
#else
sprintf(fName, "%s.%s.ll", funcName, fileName);
#endif
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream fd(fName, EC, llvm::sys::fs::OF_None);
+#else
raw_fd_ostream fd(fName, EC, llvm::sys::fs::F_None);
+#endif
M->print(fd, annotater);
fd.flush();
}
@@ -512,7 +520,11 @@ void JitManager::DumpToFile(Function* f, const char* fileName)
#else
sprintf(fName, "%s.%s.ll", funcName, fileName);
#endif
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream fd(fName, EC, llvm::sys::fs::OF_None);
+#else
raw_fd_ostream fd(fName, EC, llvm::sys::fs::F_None);
+#endif
f->print(fd, nullptr);
#if defined(_WIN32)
@@ -522,7 +534,11 @@ void JitManager::DumpToFile(Function* f, const char* fileName)
#endif
fd.flush();
+#if LLVM_VERSION_MAJOR >= 13
+ raw_fd_ostream fd_cfg(fName, EC, llvm::sys::fs::OF_Text);
+#else
raw_fd_ostream fd_cfg(fName, EC, llvm::sys::fs::F_Text);
+#endif
WriteGraph(fd_cfg, (const Function*)f);
fd_cfg.flush();
@@ -726,7 +742,11 @@ void JitCache::notifyObjectCompiled(const llvm::Module* M, llvm::MemoryBufferRef
{
std::error_code err;
+#if LLVM_VERSION_MAJOR >= 13
+ llvm::raw_fd_ostream fileObj(objPath.c_str(), err, llvm::sys::fs::OF_None);
+#else
llvm::raw_fd_ostream fileObj(objPath.c_str(), err, llvm::sys::fs::F_None);
+#endif
fileObj << Obj.getBuffer();
fileObj.flush();
}
@@ -734,7 +754,11 @@ void JitCache::notifyObjectCompiled(const llvm::Module* M, llvm::MemoryBufferRef
{
std::error_code err;
+#if LLVM_VERSION_MAJOR >= 13
+ llvm::raw_fd_ostream fileObj(filePath.c_str(), err, llvm::sys::fs::OF_None);
+#else
llvm::raw_fd_ostream fileObj(filePath.c_str(), err, llvm::sys::fs::F_None);
+#endif
uint32_t objcrc = ComputeCRC(0, Obj.getBufferStart(), Obj.getBufferSize());
--
GitLab
@@ -1,129 +0,0 @@
From 98859f67c3d54c9c6d8bbf55251717cbe3511f4e Mon Sep 17 00:00:00 2001
From: Grigory Vasilyev <h0tc0d3@gmail.com>
Date: Fri, 8 Oct 2021 15:26:49 +0300
Subject: [PATCH] Fix swr build with LLVM 13
---
.../swr/rasterizer/jitter/builder_mem.cpp | 12 +++++++++++
.../swr/rasterizer/jitter/builder_mem.h | 4 ++++
src/gallium/drivers/swr/swr_shader.cpp | 20 ++++++++++++++-----
3 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
index b5eb0a782b1..ff0672cfd14 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
@@ -82,7 +82,11 @@ namespace SwrJit
std::vector<Value*> indices;
for (auto i : indexList)
indices.push_back(i);
+#if LLVM_VERSION_MAJOR >= 13
+ return IN_BOUNDS_GEP(ptr->getType(), ptr, indices);
+#else
return IN_BOUNDS_GEP(ptr, indices);
+#endif
}
Value* Builder::IN_BOUNDS_GEP(Value* ptr, const std::initializer_list<uint32_t>& indexList)
@@ -90,7 +94,11 @@ namespace SwrJit
std::vector<Value*> indices;
for (auto i : indexList)
indices.push_back(C(i));
+#if LLVM_VERSION_MAJOR >= 13
+ return IN_BOUNDS_GEP(ptr->getType(), ptr, indices);
+#else
return IN_BOUNDS_GEP(ptr, indices);
+#endif
}
LoadInst* Builder::LOAD(Value* Ptr, const char* Name, Type* Ty, MEM_CLIENT usage)
@@ -234,7 +242,11 @@ namespace SwrJit
/// @param pVecPassthru - SIMD wide vector of values to load when lane is inactive
Value* Builder::GATHER_PTR(Value* pVecSrcPtr, Value* pVecMask, Value* pVecPassthru)
{
+#if LLVM_VERSION_MAJOR >= 13
+ return MASKED_GATHER(pVecSrcPtr->getType(), pVecSrcPtr, AlignType(4), pVecMask, pVecPassthru);
+#else
return MASKED_GATHER(pVecSrcPtr, AlignType(4), pVecMask, pVecPassthru);
+#endif
}
void Builder::SCATTER_PTR(Value* pVecDstPtr, Value* pVecSrc, Value* pVecMask)
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
index 429d5779a4d..c6cfb812b81 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
@@ -84,7 +84,11 @@ virtual CallInst* MASKED_LOAD(Value* Ptr,
Type* Ty = nullptr,
MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
{
+#if LLVM_VERSION_MAJOR >= 13
+ return IRB()->CreateMaskedLoad(Ptr->getType(), Ptr, AlignType(Align), Mask, PassThru, Name);
+#else
return IRB()->CreateMaskedLoad(Ptr, AlignType(Align), Mask, PassThru, Name);
+#endif
}
virtual StoreInst* STORE(Value *Val, Value *Ptr, bool isVolatile = false, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
index 315036920fb..26e967759cd 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -1553,7 +1553,9 @@ BuilderSWR::CompileGS(struct swr_context *ctx, swr_jit_gs_key &key)
GlobalValue::ExternalLinkage,
"GS",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
@@ -1781,7 +1783,9 @@ BuilderSWR::CompileTES(struct swr_context *ctx, swr_jit_tes_key &key)
"TES",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
@@ -2082,7 +2086,9 @@ BuilderSWR::CompileTCS(struct swr_context *ctx, swr_jit_tcs_key &key)
"TCS",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
@@ -2337,7 +2343,9 @@ BuilderSWR::CompileVS(struct swr_context *ctx, swr_jit_vs_key &key)
GlobalValue::ExternalLinkage,
"VS",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
@@ -2642,7 +2650,9 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
GlobalValue::ExternalLinkage,
"FS",
JM()->mpCurrentModule);
-#if LLVM_VERSION_MAJOR < 5
+#if LLVM_VERSION_MAJOR >= 13
+ pFunction->addParamAttrs(AttributeList::FunctionIndex, attrBuilder);
+#elif LLVM_VERSION_MAJOR < 5
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
--
GitLab
+8 -1
View File
@@ -14,7 +14,7 @@
<Icon>mesa</Icon>
<Summary>Mesa graphics libraries and utilities</Summary>
<Description>Mesa is an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics.</Description>
<Archive sha1sum="021e162456b691092d5bcd72413b2b8b8e77e195" type="tarxz">https://archive.mesa3d.org/mesa-22.2.5.tar.xz</Archive>
<Archive sha1sum="3c996af7e8f82f1afe19fc5769424769f79df9d3" type="tarxz">https://archive.mesa3d.org/mesa-22.3.1.tar.xz</Archive>
<BuildDependencies>
<Dependency>meson</Dependency>
<Dependency>valgrind-devel</Dependency>
@@ -262,6 +262,13 @@
</Package>
<History>
<Update release="78">
<Date>2022-12-15</Date>
<Version>22.3.1</Version>
<Comment>Version bump.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="77">
<Date>2022-12-11</Date>
<Version>22.2.5</Version>