Revert "chore: Revert to Mesa 23.3.3 temporarily while upstream is having issues with gamescope"

This reverts commit e43786eb29.
This commit is contained in:
Kyle Gospodnetich 2024-02-03 13:34:30 -08:00
parent 01e7c36839
commit 39a54a780f
7 changed files with 0 additions and 2774 deletions

View File

@ -1,204 +0,0 @@
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 561f3cc02e0..ebc54a900e3 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -12526,7 +12526,8 @@ select_rt_prolog(Program* program, ac_shader_config* config,
*/
PhysReg out_uniform_shader_addr = get_arg_reg(out_args, out_args->rt.uniform_shader_addr);
PhysReg out_launch_size_x = get_arg_reg(out_args, out_args->rt.launch_size);
- PhysReg out_launch_size_z = out_launch_size_x.advance(8);
+ PhysReg out_launch_size_y = out_launch_size_x.advance(4);
+ PhysReg out_launch_size_z = out_launch_size_y.advance(4);
PhysReg out_launch_ids[3];
for (unsigned i = 0; i < 3; i++)
out_launch_ids[i] = get_arg_reg(out_args, out_args->rt.launch_id).advance(i * 4);
@@ -12534,9 +12535,13 @@ select_rt_prolog(Program* program, ac_shader_config* config,
PhysReg out_record_ptr = get_arg_reg(out_args, out_args->rt.shader_record);
/* Temporaries: */
- num_sgprs = align(num_sgprs, 2) + 4;
- PhysReg tmp_raygen_sbt = PhysReg{num_sgprs - 4};
- PhysReg tmp_ring_offsets = PhysReg{num_sgprs - 2};
+ num_sgprs = align(num_sgprs, 2);
+ PhysReg tmp_raygen_sbt = PhysReg{num_sgprs};
+ num_sgprs += 2;
+ PhysReg tmp_ring_offsets = PhysReg{num_sgprs};
+ num_sgprs += 2;
+
+ PhysReg tmp_invocation_idx = PhysReg{256 + num_vgprs++};
/* Confirm some assumptions about register aliasing */
assert(in_ring_offsets == out_uniform_shader_addr);
@@ -12610,6 +12615,36 @@ select_rt_prolog(Program* program, ac_shader_config* config,
bld.vop1(aco_opcode::v_mov_b32, Definition(out_record_ptr.advance(4), v1),
Operand(tmp_raygen_sbt.advance(4), s1));
+ /* For 1D dispatches converted into 2D ones, we need to fix up the launch IDs.
+ * Calculating the 1D launch ID is: id = local_invocation_index + (wg_id.x * wg_size).
+ * in_wg_id_x now holds wg_id.x * wg_size.
+ */
+ bld.sop2(aco_opcode::s_lshl_b32, Definition(in_wg_id_x, s1), Definition(scc, s1),
+ Operand(in_wg_id_x, s1), Operand::c32(program->workgroup_size == 32 ? 5 : 6));
+
+ /* Calculate and add local_invocation_index */
+ bld.vop3(aco_opcode::v_mbcnt_lo_u32_b32, Definition(tmp_invocation_idx, v1), Operand::c32(-1u),
+ Operand(in_wg_id_x, s1));
+ if (program->wave_size == 64) {
+ if (program->gfx_level <= GFX7)
+ bld.vop2(aco_opcode::v_mbcnt_hi_u32_b32, Definition(tmp_invocation_idx, v1),
+ Operand::c32(-1u), Operand(tmp_invocation_idx, v1));
+ else
+ bld.vop3(aco_opcode::v_mbcnt_hi_u32_b32_e64, Definition(tmp_invocation_idx, v1),
+ Operand::c32(-1u), Operand(tmp_invocation_idx, v1));
+ }
+
+ /* Make fixup operations a no-op if this is not a converted 2D dispatch. */
+ bld.sopc(aco_opcode::s_cmp_lg_u32, Definition(scc, s1),
+ Operand::c32(ACO_RT_CONVERTED_2D_LAUNCH_SIZE), Operand(out_launch_size_y, s1));
+ bld.sop2(Builder::s_cselect, Definition(vcc, bld.lm),
+ Operand::c32_or_c64(-1u, program->wave_size == 64),
+ Operand::c32_or_c64(0, program->wave_size == 64), Operand(scc, s1));
+ bld.vop2(aco_opcode::v_cndmask_b32, Definition(out_launch_ids[0], v1),
+ Operand(tmp_invocation_idx, v1), Operand(out_launch_ids[0], v1), Operand(vcc, bld.lm));
+ bld.vop2(aco_opcode::v_cndmask_b32, Definition(out_launch_ids[1], v1), Operand::zero(),
+ Operand(out_launch_ids[1], v1), Operand(vcc, bld.lm));
+
/* jump to raygen */
bld.sop1(aco_opcode::s_setpc_b64, Operand(out_uniform_shader_addr, s2));
diff --git a/src/amd/compiler/aco_interface.h b/src/amd/compiler/aco_interface.h
index 8f35e18b5b0..9d2c1dbb2af 100644
--- a/src/amd/compiler/aco_interface.h
+++ b/src/amd/compiler/aco_interface.h
@@ -32,6 +32,9 @@
extern "C" {
#endif
+/* Special launch size to indicate this dispatch is a 1D dispatch converted into a 2D one */
+#define ACO_RT_CONVERTED_2D_LAUNCH_SIZE -1u
+
typedef struct nir_shader nir_shader;
struct ac_shader_config;
struct aco_shader_info;
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index cdede679552..c7dd4b216d4 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -42,6 +42,8 @@
#include "ac_debug.h"
#include "ac_shader_args.h"
+#include "aco_interface.h"
+
#include "util/fast_idiv_by_const.h"
enum {
@@ -10003,7 +10005,26 @@ enum radv_rt_mode {
};
static void
-radv_trace_rays(struct radv_cmd_buffer *cmd_buffer, const VkTraceRaysIndirectCommand2KHR *tables, uint64_t indirect_va,
+radv_upload_trace_rays_params(struct radv_cmd_buffer *cmd_buffer, VkTraceRaysIndirectCommand2KHR *tables,
+ enum radv_rt_mode mode, uint64_t *launch_size_va, uint64_t *sbt_va)
+{
+ uint32_t upload_size = mode == radv_rt_mode_direct ? sizeof(VkTraceRaysIndirectCommand2KHR)
+ : offsetof(VkTraceRaysIndirectCommand2KHR, width);
+
+ uint32_t offset;
+ if (!radv_cmd_buffer_upload_data(cmd_buffer, upload_size, tables, &offset))
+ return;
+
+ uint64_t upload_va = radv_buffer_get_va(cmd_buffer->upload.upload_bo) + offset;
+
+ if (mode == radv_rt_mode_direct)
+ *launch_size_va = upload_va + offsetof(VkTraceRaysIndirectCommand2KHR, width);
+ if (sbt_va)
+ *sbt_va = upload_va;
+}
+
+static void
+radv_trace_rays(struct radv_cmd_buffer *cmd_buffer, VkTraceRaysIndirectCommand2KHR *tables, uint64_t indirect_va,
enum radv_rt_mode mode)
{
if (cmd_buffer->device->instance->debug_flags & RADV_DEBUG_NO_RT)
@@ -10024,34 +10045,43 @@ radv_trace_rays(struct radv_cmd_buffer *cmd_buffer, const VkTraceRaysIndirectCom
cmd_buffer->compute_scratch_size_per_wave_needed =
MAX2(cmd_buffer->compute_scratch_size_per_wave_needed, scratch_bytes_per_wave);
+ /* Since the workgroup size is 8x4 (or 8x8), 1D dispatches can only fill 8 threads per wave at most. To increase
+ * occupancy, it's beneficial to convert to a 2D dispatch in these cases. */
+ if (tables && tables->height == 1 && tables->width >= cmd_buffer->state.rt_prolog->info.cs.block_size[0])
+ tables->height = ACO_RT_CONVERTED_2D_LAUNCH_SIZE;
+
struct radv_dispatch_info info = {0};
info.unaligned = true;
- uint64_t launch_size_va;
- uint64_t sbt_va;
+ uint64_t launch_size_va = 0;
+ uint64_t sbt_va = 0;
if (mode != radv_rt_mode_indirect2) {
- uint32_t upload_size = mode == radv_rt_mode_direct ? sizeof(VkTraceRaysIndirectCommand2KHR)
- : offsetof(VkTraceRaysIndirectCommand2KHR, width);
-
- uint32_t offset;
- if (!radv_cmd_buffer_upload_data(cmd_buffer, upload_size, tables, &offset))
- return;
-
- uint64_t upload_va = radv_buffer_get_va(cmd_buffer->upload.upload_bo) + offset;
-
- launch_size_va =
- (mode == radv_rt_mode_direct) ? upload_va + offsetof(VkTraceRaysIndirectCommand2KHR, width) : indirect_va;
- sbt_va = upload_va;
+ launch_size_va = indirect_va;
+ radv_upload_trace_rays_params(cmd_buffer, tables, mode, &launch_size_va, &sbt_va);
} else {
launch_size_va = indirect_va + offsetof(VkTraceRaysIndirectCommand2KHR, width);
sbt_va = indirect_va;
}
+ uint32_t remaining_ray_count = 0;
+
if (mode == radv_rt_mode_direct) {
info.blocks[0] = tables->width;
info.blocks[1] = tables->height;
info.blocks[2] = tables->depth;
+
+ if (tables->height == ACO_RT_CONVERTED_2D_LAUNCH_SIZE) {
+ /* We need the ray count for the 2D dispatch to be a multiple of the y block size for the division to work, and
+ * a multiple of the x block size because the invocation offset must be a multiple of the block size when
+ * dispatching the remaining rays. Fortunately, the x block size is itself a multiple of the y block size, so
+ * we only need to ensure that the ray count is a multiple of the x block size. */
+ remaining_ray_count = tables->width % rt_prolog->info.cs.block_size[0];
+
+ uint32_t ray_count = tables->width - remaining_ray_count;
+ info.blocks[0] = ray_count / rt_prolog->info.cs.block_size[1];
+ info.blocks[1] = rt_prolog->info.cs.block_size[1];
+ }
} else
info.va = launch_size_va;
@@ -10085,6 +10115,22 @@ radv_trace_rays(struct radv_cmd_buffer *cmd_buffer, const VkTraceRaysIndirectCom
assert(cmd_buffer->cs->cdw <= cdw_max);
radv_dispatch(cmd_buffer, &info, pipeline, rt_prolog, VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR);
+
+ if (remaining_ray_count) {
+ info.blocks[0] = remaining_ray_count;
+ info.blocks[1] = 1;
+ info.offsets[0] = tables->width - remaining_ray_count;
+
+ /* Reset the ray launch size so the prolog doesn't think this is a converted dispatch */
+ tables->height = 1;
+ radv_upload_trace_rays_params(cmd_buffer, tables, mode, &launch_size_va, NULL);
+ if (size_loc->sgpr_idx != -1) {
+ radv_emit_shader_pointer(cmd_buffer->device, cmd_buffer->cs, base_reg + size_loc->sgpr_idx * 4, launch_size_va,
+ true);
+ }
+
+ radv_dispatch(cmd_buffer, &info, pipeline, rt_prolog, VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR);
+ }
}
VKAPI_ATTR void VKAPI_CALL

View File

@ -1,117 +0,0 @@
Subject: RE: Question about Mesa MLAA license
From: Jorge Jimenez <iryoku@gmail.com>
Date: 01/08/2013 12:50 PM
To: Tom Callaway <tcallawa@redhat.com>
CC: "jorge@iryoku.com" <jorge@iryoku.com>
Yes to both questions.
Thanks,
Jorge
From: Tom Callaway <tcallawa@redhat.com>
Sent: January 8, 2013 6:49 PM
To: Jorge Jimenez <iryoku@gmail.com>
CC: jorge@iryoku.com
Subject: Re: Question about Mesa MLAA license
On 01/08/2013 12:39 PM, Jorge Jimenez wrote:
> Hi Tom,
>
> What we meant with that is that we made an exception for clause 2.
> Instead of clause 2, in the case of the Mesa project, you have to name
> the technique Jimenez's MLAA in the config options of Mesa. We did that
> just to allow them to solve license issues. This exception should be for
> the Mesa project, and any project using Mesa, like Fedora.
>
> We want to widespread usage of our MLAA, so we want to avoid any kind of
> license complications. Hope current one is good for Fedora, if not
> please tell, and we'll see what we can do!
Okay, a few more questions:
* If Fedora decides to simply reproduce the quoted statement:
"Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia,
Jose I. Echevarria, Fernando Navarro and Diego Gutierrez."
Specifically, if this is done as part of documentation included with
Mesa, is that sufficient to meet clause 2 even if the Mesa config option
is not set as described in your exception?
* Currently, the Mesa config option for MLAA says: "Morphological
anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default
quality". Is this in compliance with your exception?
Thanks again,
~tom
==
Fedora Project
Subject: RE: Question about Mesa MLAA license
From: Jorge Jimenez <iryoku@gmail.com>
Date: 01/08/2013 12:39 PM
To: "jorge@iryoku.com" <jorge@iryoku.com>, Tom Callaway <tcallawa@redhat.com>
Hi Tom,
What we meant with that is that we made an exception for clause 2.
Instead of clause 2, in the case of the Mesa project, you have to name
the technique Jimenez's MLAA in the config options of Mesa. We did that
just to allow them to solve license issues. This exception should be for
the Mesa project, and any project using Mesa, like Fedora.
We want to widespread usage of our MLAA, so we want to avoid any kind of
license complications. Hope current one is good for Fedora, if not
please tell, and we'll see what we can do!
Cheers,
Jorge
From: Tom Callaway <tcallawa@redhat.com>
Sent: January 8, 2013 6:30 PM
To: jorge@iryoku.com
Subject: Question about Mesa MLAA license
Jorge,
Thanks for all of your fantastic graphics work! I have been auditing
Fedora (a popular distribution of Linux) for license compliance and I
came across your MLAA code in Mesa.
The license says:
* 2. Redistributions in binary form must reproduce the following
statement:
*
* "Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia,
* Jose I. Echevarria, Fernando Navarro and Diego Gutierrez."
*
* Only for use in the Mesa project, this point 2 is filled by naming the
* technique Jimenez's MLAA in the Mesa config options.
That wording is unclear. When you say "Only for use in the Mesa
project...", it seems like you could either be saying:
- This code may only be used as part of Mesa.
OR
- In Mesa, you can comply with clause 2 by simply selecting "Jimenez's
MLAA" in the Mesa config options.
*****
If the first item is true, then we may have to remove the MLAA code from
Fedora's copy of Mesa. However, looking at the license on your SMAA
code, I do not believe it to be the case. Please let me know either way!
Thanks in advance,
Tom Callaway
Fedora Legal
==
Fedora Project

View File

@ -1,11 +0,0 @@
diff -up mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf.dma mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf
--- mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf.dma 2022-11-25 10:32:32.175879868 +1000
+++ mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf 2022-11-25 10:32:43.743067470 +1000
@@ -653,6 +653,7 @@ TODO: document the other workarounds.
<application name="gnome-shell" executable="gnome-shell">
<option name="adaptive_sync" value="false" />
<option name="v3d_nonmsaa_texture_size_limit" value="true" />
+ <option name="mesa_glthread" value="false"/>
</application>
<application name="Desktop — Plasma" executable="plasmashell">
<option name="adaptive_sync" value="false" />

View File

@ -1,42 +0,0 @@
meson: C type error in strtod_l/strtof_l probe
Future compilers will fail compilation due to the C type error:
…/testfile.c: In function 'main':
…/testfile.c:12:30: error: passing argument 2 of 'strtod_l' from incompatible pointer type
12 | double d = strtod_l(s, end, loc);
| ^~~
| |
| char *
/usr/include/stdlib.h:416:43: note: expected 'char ** restrict' but argument is of type 'char *'
416 | char **__restrict __endptr, locale_t __loc)
| ~~~~~~~~~~~~~~~~~~^~~~~~~~
…/testfile.c:13:29: error: passing argument 2 of 'strtof_l' from incompatible pointer type
13 | float f = strtof_l(s, end, loc);
| ^~~
| |
| char *
/usr/include/stdlib.h:420:42: note: expected 'char ** restrict' but argument is of type 'char *'
420 | char **__restrict __endptr, locale_t __loc)
| ~~~~~~~~~~~~~~~~~~^~~~~~~~
This means that the probe no longer tests is objective and always
fails.
Submitted upstream: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26927>
diff --git a/meson.build b/meson.build
index 35cc5f1cd5fd9079..1a5d2ba492be0b31 100644
--- a/meson.build
+++ b/meson.build
@@ -1425,8 +1425,8 @@ if cc.links('''
locale_t loc = newlocale(LC_CTYPE_MASK, "C", NULL);
const char *s = "1.0";
char *end;
- double d = strtod_l(s, end, loc);
- float f = strtof_l(s, end, loc);
+ double d = strtod_l(s, &end, loc);
+ float f = strtof_l(s, &end, loc);
freelocale(loc);
return 0;
}''',

View File

@ -1,691 +0,0 @@
%ifnarch s390x
%global with_hardware 1
%global with_vulkan_hw 1
%global with_vdpau 1
%global with_va 1
%if !0%{?rhel}
%global with_nine 1
%global with_omx 1
%global with_opencl 1
%endif
%global base_vulkan ,amd,nouveau-experimental
%endif
%ifarch %{ix86} x86_64
%global with_crocus 1
%global with_i915 1
%if !0%{?rhel}
%global with_intel_clc 1
%endif
%global with_iris 1
%global with_xa 1
%global intel_platform_vulkan ,intel,intel_hasvk
%endif
%ifarch aarch64 x86_64 %{ix86}
%if !0%{?rhel}
%global with_lima 1
%global with_vc4 1
%endif
%global with_etnaviv 1
%global with_freedreno 1
%global with_kmsro 1
%global with_panfrost 1
%global with_tegra 1
%global with_v3d 1
%global with_xa 1
%global extra_platform_vulkan ,broadcom,freedreno,panfrost
%endif
%ifnarch s390x
%if !0%{?rhel}
%global with_r300 1
%global with_r600 1
%endif
%global with_radeonsi 1
%global with_vmware 1
%endif
%if !0%{?rhel}
%global with_libunwind 1
%global with_lmsensors 1
%endif
%ifarch %{valgrind_arches}
%bcond_without valgrind
%else
%bcond_with valgrind
%endif
%global vulkan_drivers swrast%{?base_vulkan}%{?intel_platform_vulkan}%{?extra_platform_vulkan}
Name: mesa
Summary: Mesa graphics libraries
%global ver 23.3.3
Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
Release: 100.bazzite.{{{ git_dir_version }}}
License: MIT AND BSD-3-Clause AND SGI-B-2.0
URL: http://www.mesa3d.org
Source0: https://archive.mesa3d.org/mesa-%{ver}.tar.xz
# src/gallium/auxiliary/postprocess/pp_mlaa* have an ... interestingly worded license.
# Source1 contains email correspondence clarifying the license terms.
# 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
Patch10: gnome-shell-glthread-disable.patch
Patch11: zink-fix-resizable-bar-detection-logic.patch
Patch12: mesa-meson-c99.patch
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26105/
Patch30: 26105.patch
# https://gitlab.com/evlaV/mesa/
Patch40: valve.patch
BuildRequires: meson >= 1.2.0
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gettext
%if 0%{?with_hardware}
BuildRequires: kernel-headers
%endif
# We only check for the minimum version of pkgconfig(libdrm) needed so that the
# SRPMs for each arch still have the same build dependencies. See:
# https://bugzilla.redhat.com/show_bug.cgi?id=1859515
BuildRequires: pkgconfig(libdrm) >= 2.4.97
%if 0%{?with_libunwind}
BuildRequires: pkgconfig(libunwind)
%endif
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(zlib) >= 1.2.3
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(libselinux)
BuildRequires: pkgconfig(wayland-scanner)
BuildRequires: pkgconfig(wayland-protocols) >= 1.8
BuildRequires: pkgconfig(wayland-client) >= 1.11
BuildRequires: pkgconfig(wayland-server) >= 1.11
BuildRequires: pkgconfig(wayland-egl-backend) >= 3
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xdamage) >= 1.1
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(xcb-glx) >= 1.8.1
BuildRequires: pkgconfig(xxf86vm)
BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(x11-xcb)
BuildRequires: pkgconfig(xcb-dri2) >= 1.8
BuildRequires: pkgconfig(xcb-dri3)
BuildRequires: pkgconfig(xcb-present)
BuildRequires: pkgconfig(xcb-sync)
BuildRequires: pkgconfig(xshmfence) >= 1.1
BuildRequires: pkgconfig(dri2proto) >= 2.8
BuildRequires: pkgconfig(glproto) >= 1.4.14
BuildRequires: pkgconfig(xcb-xfixes)
BuildRequires: pkgconfig(xcb-randr)
BuildRequires: pkgconfig(xrandr) >= 1.3
BuildRequires: bison
BuildRequires: flex
%if 0%{?with_lmsensors}
BuildRequires: lm_sensors-devel
%endif
%if 0%{?with_vdpau}
BuildRequires: pkgconfig(vdpau) >= 1.1
%endif
%if 0%{?with_va}
BuildRequires: pkgconfig(libva) >= 0.38.0
%endif
%if 0%{?with_omx}
BuildRequires: pkgconfig(libomxil-bellagio)
%endif
BuildRequires: pkgconfig(libelf)
BuildRequires: pkgconfig(libglvnd) >= 1.3.2
BuildRequires: llvm-devel >= 7.0.0
%if 0%{?with_opencl}
BuildRequires: clang-devel
BuildRequires: bindgen
BuildRequires: rust-packaging
BuildRequires: pkgconfig(libclc)
BuildRequires: pkgconfig(SPIRV-Tools)
BuildRequires: pkgconfig(LLVMSPIRVLib)
%endif
%if %{with valgrind}
BuildRequires: pkgconfig(valgrind)
%endif
BuildRequires: python3-devel
BuildRequires: python3-mako
%if 0%{?with_intel_clc}
BuildRequires: python3-ply
%endif
BuildRequires: vulkan-headers
BuildRequires: glslang
%if 0%{?with_vulkan_hw}
BuildRequires: pkgconfig(vulkan)
%endif
%description
%{summary}.
%package filesystem
Summary: Mesa driver filesystem
Provides: mesa-dri-filesystem = %{?epoch:%{epoch}:}%{version}-%{release}
%description filesystem
%{summary}.
%package libGL
Summary: Mesa libGL runtime libraries
Requires: %{name}-libglapi%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: libglvnd-glx%{?_isa} >= 1:1.3.2
Recommends: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description libGL
%{summary}.
%package libGL-devel
Summary: Mesa libGL development package
Requires: %{name}-libGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: libglvnd-devel%{?_isa} >= 1:1.3.2
Provides: libGL-devel
Provides: libGL-devel%{?_isa}
Recommends: gl-manpages
%description libGL-devel
%{summary}.
%package libEGL
Summary: Mesa libEGL runtime libraries
Requires: libglvnd-egl%{?_isa} >= 1:1.3.2
Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}-libglapi%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Recommends: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description libEGL
%{summary}.
%package libEGL-devel
Summary: Mesa libEGL development package
Requires: %{name}-libEGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: libglvnd-devel%{?_isa} >= 1:1.3.2
Requires: %{name}-khr-devel%{?_isa}
Provides: libEGL-devel
Provides: libEGL-devel%{?_isa}
%description libEGL-devel
%{summary}.
%package dri-drivers
Summary: Mesa-based DRI drivers
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}-libglapi%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%if 0%{?with_va}
Recommends: %{name}-va-drivers%{?_isa}
%endif
%description dri-drivers
%{summary}.
%if 0%{?with_omx}
%package omx-drivers
Summary: Mesa-based OMX drivers
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description omx-drivers
%{summary}.
%endif
%if 0%{?with_va}
%package va-drivers
Summary: Mesa-based VA-API video acceleration drivers
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: %{name}-vaapi-drivers < 22.2.0-5
%description va-drivers
%{summary}.
%endif
%if 0%{?with_vdpau}
%package vdpau-drivers
Summary: Mesa-based VDPAU drivers
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description vdpau-drivers
%{summary}.
%endif
%package libOSMesa
Summary: Mesa offscreen rendering libraries
Requires: %{name}-libglapi%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: libOSMesa
Provides: libOSMesa%{?_isa}
%description libOSMesa
%{summary}.
%package libOSMesa-devel
Summary: Mesa offscreen rendering development package
Requires: %{name}-libOSMesa%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description libOSMesa-devel
%{summary}.
%package libgbm
Summary: Mesa gbm runtime library
Provides: libgbm
Provides: libgbm%{?_isa}
Recommends: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
# If mesa-dri-drivers are installed, they must match in version. This is here to prevent using
# older mesa-dri-drivers together with a newer mesa-libgbm and its dependants.
# See https://bugzilla.redhat.com/show_bug.cgi?id=2193135 .
Requires: (%{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-dri-drivers%{?_isa})
%description libgbm
%{summary}.
%package libgbm-devel
Summary: Mesa libgbm development package
Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: libgbm-devel
Provides: libgbm-devel%{?_isa}
%description libgbm-devel
%{summary}.
%if 0%{?with_xa}
%package libxatracker
Summary: Mesa XA state tracker
Provides: libxatracker
Provides: libxatracker%{?_isa}
%description libxatracker
%{summary}.
%package libxatracker-devel
Summary: Mesa XA state tracker development package
Requires: %{name}-libxatracker%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: libxatracker-devel
Provides: libxatracker-devel%{?_isa}
%description libxatracker-devel
%{summary}.
%endif
%package libglapi
Summary: Mesa shared glapi
Provides: libglapi
Provides: libglapi%{?_isa}
# If mesa-dri-drivers are installed, they must match in version. This is here to prevent using
# older mesa-dri-drivers together with a newer mesa-libglapi or its dependants.
# See https://bugzilla.redhat.com/show_bug.cgi?id=2193135 .
Requires: (%{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-dri-drivers%{?_isa})
%description libglapi
%{summary}.
%if 0%{?with_opencl}
%package libOpenCL
Summary: Mesa OpenCL runtime library
Requires: ocl-icd%{?_isa}
Requires: libclc%{?_isa}
Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: opencl-filesystem
%description libOpenCL
%{summary}.
%package libOpenCL-devel
Summary: Mesa OpenCL development package
Requires: %{name}-libOpenCL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description libOpenCL-devel
%{summary}.
%endif
%if 0%{?with_nine}
%package libd3d
Summary: Mesa Direct3D9 state tracker
%description libd3d
%{summary}.
%package libd3d-devel
Summary: Mesa Direct3D9 state tracker development package
Requires: %{name}-libd3d%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description libd3d-devel
%{summary}.
%endif
%package vulkan-drivers
Summary: Mesa Vulkan drivers
Requires: vulkan%{_isa}
Obsoletes: mesa-vulkan-devel < %{?epoch:%{epoch}:}%{version}-%{release}
%description vulkan-drivers
The drivers with support for the Vulkan API.
%prep
%autosetup -n %{name}-%{ver} -p1
cp %{SOURCE1} docs/
%build
# ensure standard Rust compiler flags are set
export RUSTFLAGS="%build_rustflags"
# We've gotten a report that enabling LTO for mesa breaks some games. See
# https://bugzilla.redhat.com/show_bug.cgi?id=1862771 for details.
# Disable LTO for now
%define _lto_cflags %{nil}
%meson \
-Dplatforms=x11,wayland \
-Ddri3=enabled \
-Dosmesa=true \
%if 0%{?with_hardware}
-Dgallium-drivers=swrast,virgl,nouveau%{?with_r300:,r300}%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi}%{?with_r600:,r600}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_kmsro:,kmsro}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink} \
%else
-Dgallium-drivers=swrast,virgl \
%endif
-Dgallium-vdpau=%{?with_vdpau:enabled}%{!?with_vdpau:disabled} \
-Dgallium-omx=%{?with_omx:bellagio}%{!?with_omx:disabled} \
-Dgallium-va=%{?with_va:enabled}%{!?with_va:disabled} \
-Dgallium-xa=%{?with_xa:enabled}%{!?with_xa:disabled} \
-Dgallium-nine=%{?with_nine:true}%{!?with_nine:false} \
-Dgallium-opencl=%{?with_opencl:icd}%{!?with_opencl:disabled} \
%if 0%{?with_opencl}
-Dgallium-rusticl=true \
%endif
-Dvulkan-drivers=%{?vulkan_drivers} \
-Dvulkan-layers=device-select \
-Dshared-glapi=enabled \
-Dgles1=enabled \
-Dgles2=enabled \
-Dopengl=true \
-Dgbm=enabled \
-Dglx=dri \
-Degl=enabled \
-Dglvnd=true \
%if 0%{?with_intel_clc}
-Dintel-clc=enabled \
%endif
-Dmicrosoft-clc=disabled \
-Dllvm=enabled \
-Dshared-llvm=enabled \
-Dvalgrind=%{?with_valgrind:enabled}%{!?with_valgrind:disabled} \
-Dxlib-lease=enabled \
-Dbuild-tests=false \
-Dselinux=true \
%if !0%{?with_libunwind}
-Dlibunwind=disabled \
%endif
%if !0%{?with_lmsensors}
-Dlmsensors=disabled \
%endif
-Dandroid-libbacktrace=disabled \
%ifarch %{ix86}
-Dglx-read-only-text=true
%endif
%{nil}
%meson_build
%install
%meson_install
# libvdpau opens the versioned name, don't bother including the unversioned
rm -vf %{buildroot}%{_libdir}/vdpau/*.so
# likewise glvnd
rm -vf %{buildroot}%{_libdir}/libGLX_mesa.so
rm -vf %{buildroot}%{_libdir}/libEGL_mesa.so
# XXX can we just not build this
rm -vf %{buildroot}%{_libdir}/libGLES*
# glvnd needs a default provider for indirect rendering where it cannot
# determine the vendor
ln -s %{_libdir}/libGLX_mesa.so.0 %{buildroot}%{_libdir}/libGLX_system.so.0
# this keeps breaking, check it early. note that the exit from eu-ftr is odd.
pushd %{buildroot}%{_libdir}
for i in libOSMesa*.so libGL.so ; do
eu-findtextrel $i && exit 1
done
popd
%ifarch %{ix86}
rm -Rf %{buildroot}%{_datadir}/drirc.d/00-radv-defaults.conf
rm -Rf %{buildroot}%{_datadir}/drirc.d/00-mesa-defaults.conf
%endif
%files filesystem
%doc docs/Mesa-MLAA-License-Clarification-Email.txt
%dir %{_libdir}/dri
%if 0%{?with_hardware}
%if 0%{?with_vdpau}
%dir %{_libdir}/vdpau
%endif
%endif
%files libGL
%{_libdir}/libGLX_mesa.so.0*
%{_libdir}/libGLX_system.so.0*
%files libGL-devel
%dir %{_includedir}/GL/internal
%{_includedir}/GL/internal/dri_interface.h
%{_libdir}/pkgconfig/dri.pc
%{_libdir}/libglapi.so
%files libEGL
%{_datadir}/glvnd/egl_vendor.d/50_mesa.json
%{_libdir}/libEGL_mesa.so.0*
%files libEGL-devel
%dir %{_includedir}/EGL
%{_includedir}/EGL/eglext_angle.h
%{_includedir}/EGL/eglmesaext.h
%files libglapi
%{_libdir}/libglapi.so.0
%{_libdir}/libglapi.so.0.*
%files libOSMesa
%{_libdir}/libOSMesa.so.8*
%files libOSMesa-devel
%dir %{_includedir}/GL
%{_includedir}/GL/osmesa.h
%{_libdir}/libOSMesa.so
%{_libdir}/pkgconfig/osmesa.pc
%files libgbm
%{_libdir}/libgbm.so.1
%{_libdir}/libgbm.so.1.*
%files libgbm-devel
%{_libdir}/libgbm.so
%{_includedir}/gbm.h
%{_libdir}/pkgconfig/gbm.pc
%if 0%{?with_xa}
%files libxatracker
%if 0%{?with_hardware}
%{_libdir}/libxatracker.so.2
%{_libdir}/libxatracker.so.2.*
%endif
%files libxatracker-devel
%if 0%{?with_hardware}
%{_libdir}/libxatracker.so
%{_includedir}/xa_tracker.h
%{_includedir}/xa_composite.h
%{_includedir}/xa_context.h
%{_libdir}/pkgconfig/xatracker.pc
%endif
%endif
%if 0%{?with_opencl}
%files libOpenCL
%{_libdir}/libMesaOpenCL.so.*
%{_libdir}/libRusticlOpenCL.so.*
%{_sysconfdir}/OpenCL/vendors/mesa.icd
%{_sysconfdir}/OpenCL/vendors/rusticl.icd
%files libOpenCL-devel
%{_libdir}/libMesaOpenCL.so
%{_libdir}/libRusticlOpenCL.so
%endif
%if 0%{?with_nine}
%files libd3d
%dir %{_libdir}/d3d/
%{_libdir}/d3d/*.so.*
%files libd3d-devel
%{_libdir}/pkgconfig/d3d.pc
%{_includedir}/d3dadapter/
%{_libdir}/d3d/*.so
%endif
%files dri-drivers
%dir %{_datadir}/drirc.d
%ifarch aarch64 x86_64
%{_datadir}/drirc.d/00-mesa-defaults.conf
%endif
%{_libdir}/dri/kms_swrast_dri.so
%{_libdir}/dri/swrast_dri.so
%{_libdir}/dri/virtio_gpu_dri.so
%if 0%{?with_hardware}
%if 0%{?with_r300}
%{_libdir}/dri/r300_dri.so
%endif
%if 0%{?with_radeonsi}
%if 0%{?with_r600}
%{_libdir}/dri/r600_dri.so
%endif
%{_libdir}/dri/radeonsi_dri.so
%endif
%ifarch %{ix86} x86_64
%{_libdir}/dri/crocus_dri.so
%{_libdir}/dri/i915_dri.so
%{_libdir}/dri/iris_dri.so
%endif
%ifarch aarch64 x86_64 %{ix86}
%{_libdir}/dri/ingenic-drm_dri.so
%{_libdir}/dri/imx-drm_dri.so
%{_libdir}/dri/imx-lcdif_dri.so
%{_libdir}/dri/kirin_dri.so
%{_libdir}/dri/komeda_dri.so
%{_libdir}/dri/mali-dp_dri.so
%{_libdir}/dri/mcde_dri.so
%{_libdir}/dri/mxsfb-drm_dri.so
%{_libdir}/dri/rcar-du_dri.so
%{_libdir}/dri/stm_dri.so
%endif
%if 0%{?with_vc4}
%{_libdir}/dri/vc4_dri.so
%endif
%if 0%{?with_v3d}
%{_libdir}/dri/v3d_dri.so
%endif
%if 0%{?with_freedreno}
%{_libdir}/dri/kgsl_dri.so
%{_libdir}/dri/msm_dri.so
%endif
%if 0%{?with_etnaviv}
%{_libdir}/dri/etnaviv_dri.so
%endif
%if 0%{?with_tegra}
%{_libdir}/dri/tegra_dri.so
%endif
%if 0%{?with_lima}
%{_libdir}/dri/lima_dri.so
%endif
%if 0%{?with_panfrost}
%{_libdir}/dri/panfrost_dri.so
%endif
%{_libdir}/dri/nouveau_dri.so
%if 0%{?with_vmware}
%{_libdir}/dri/vmwgfx_dri.so
%endif
%endif
%if 0%{?with_opencl}
%dir %{_libdir}/gallium-pipe
%{_libdir}/gallium-pipe/*.so
%endif
%if 0%{?with_kmsro}
%{_libdir}/dri/armada-drm_dri.so
%{_libdir}/dri/exynos_dri.so
%{_libdir}/dri/hdlcd_dri.so
%{_libdir}/dri/hx8357d_dri.so
%{_libdir}/dri/ili9225_dri.so
%{_libdir}/dri/ili9341_dri.so
%{_libdir}/dri/imx-dcss_dri.so
%{_libdir}/dri/mediatek_dri.so
%{_libdir}/dri/meson_dri.so
%{_libdir}/dri/mi0283qt_dri.so
%{_libdir}/dri/pl111_dri.so
%{_libdir}/dri/repaper_dri.so
%{_libdir}/dri/rockchip_dri.so
%{_libdir}/dri/st7586_dri.so
%{_libdir}/dri/st7735r_dri.so
%{_libdir}/dri/sun4i-drm_dri.so
%endif
%if 0%{?with_vulkan_hw}
%{_libdir}/dri/zink_dri.so
%endif
%if 0%{?with_omx}
%files omx-drivers
%{_libdir}/bellagio/libomx_mesa.so
%endif
%if 0%{?with_va}
%files va-drivers
%{_libdir}/dri/nouveau_drv_video.so
%if 0%{?with_r600}
%{_libdir}/dri/r600_drv_video.so
%endif
%if 0%{?with_radeonsi}
%{_libdir}/dri/radeonsi_drv_video.so
%endif
%{_libdir}/dri/virtio_gpu_drv_video.so
%endif
%if 0%{?with_vdpau}
%files vdpau-drivers
%{_libdir}/vdpau/libvdpau_nouveau.so.1*
%if 0%{?with_r600}
%{_libdir}/vdpau/libvdpau_r600.so.1*
%endif
%if 0%{?with_radeonsi}
%{_libdir}/vdpau/libvdpau_radeonsi.so.1*
%endif
%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1*
%endif
%files vulkan-drivers
%{_libdir}/libvulkan_lvp.so
%{_datadir}/vulkan/icd.d/lvp_icd.*.json
%{_libdir}/libVkLayer_MESA_device_select.so
%{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json
%if 0%{?with_vulkan_hw}
%{_libdir}/libvulkan_radeon.so
%ifarch aarch64 x86_64
%{_datadir}/drirc.d/00-radv-defaults.conf
%endif
%{_datadir}/vulkan/icd.d/radeon_icd.*.json
%{_libdir}/libvulkan_nouveau.so
%{_datadir}/vulkan/icd.d/nouveau_icd.*.json
%ifarch %{ix86} x86_64
%{_libdir}/libvulkan_intel.so
%{_datadir}/vulkan/icd.d/intel_icd.*.json
%{_libdir}/libvulkan_intel_hasvk.so
%{_datadir}/vulkan/icd.d/intel_hasvk_icd.*.json
%endif
%ifarch aarch64 x86_64 %{ix86}
%{_libdir}/libvulkan_broadcom.so
%{_datadir}/vulkan/icd.d/broadcom_icd.*.json
%{_libdir}/libvulkan_freedreno.so
%{_datadir}/vulkan/icd.d/freedreno_icd.*.json
%{_libdir}/libvulkan_panfrost.so
%{_datadir}/vulkan/icd.d/panfrost_icd.*.json
%endif
%endif
%changelog
%autochangelog

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
From a077c14f150f1c4f670dce381ac2eb548f1a4ac2 Mon Sep 17 00:00:00 2001
From: Alessandro Astone <ales.astone@gmail.com>
Date: Wed, 10 Jan 2024 17:24:30 +0100
Subject: [PATCH] zink: Fix resizable BAR detection logic
This was broken in two ways:
* When looking for the MAX biggest_ram it was actually comparing
a candidate against biggest_vis_ram
* mem_props.memoryTypes[] should be accessed with the memory type
index as found in heap_map
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10341
Cc: 23.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26979>
---
src/gallium/drivers/zink/zink_screen.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 5a6d17cb4fa3..6697d7ab938c 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -3258,10 +3258,10 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
{
uint64_t biggest_vis_vram = 0;
for (unsigned i = 0; i < screen->heap_count[ZINK_HEAP_DEVICE_LOCAL_VISIBLE]; i++)
- biggest_vis_vram = MAX2(biggest_vis_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[i].heapIndex].size);
+ biggest_vis_vram = MAX2(biggest_vis_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[screen->heap_map[ZINK_HEAP_DEVICE_LOCAL_VISIBLE][i]].heapIndex].size);
uint64_t biggest_vram = 0;
for (unsigned i = 0; i < screen->heap_count[ZINK_HEAP_DEVICE_LOCAL]; i++)
- biggest_vram = MAX2(biggest_vis_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[i].heapIndex].size);
+ biggest_vram = MAX2(biggest_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[screen->heap_map[ZINK_HEAP_DEVICE_LOCAL][i]].heapIndex].size);
/* determine if vis vram is roughly equal to total vram */
if (biggest_vis_vram > biggest_vram * 0.9)
screen->resizable_bar = true;
--
GitLab