Commit graph

186445 commits

Author SHA1 Message Date
Yonggang Luo
d17779430f util: Cleanup strtod.(h|c) by introduce _mesa_get_locale
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28174>
2024-03-19 04:05:08 +00:00
Marek Olšák
4ed3418a43 Unbreak Viewperf by reverting "util: use crc32_z instead of crc32 and bump zlib dep to 1.2.9"
It breaks apps shipping their own copy of zlib, such as Viewperf.
If we use crc32_z, Viewperf is unable to start because it's an undefined
symbol.

This reverts commit 010272b62e.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28233>
2024-03-19 03:08:10 +00:00
Marek Olšák
97084199bb radeonsi/ci: update failures
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28219>
2024-03-18 22:27:15 -04:00
Marek Olšák
b98bbb851c radeonsi/ci: run GLCTS, ESCTS, and dEQP from the glcts directory
GLCTS contains more recent dEQP, so we can remove the deqp clone.

Changes:
- glcts should use the main branch
- glcts/build contains gl-cts and deqp
- glcts/build_es contains gles-cts
- remove the escts and deqp directories and paths
- it saves about 27 GB of disk space

Updated build instructions:
    https://github.com/marekolsak/marek-build/

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28219>
2024-03-18 22:26:54 -04:00
Kenneth Graunke
8573e9bf47 ra: Add debug functions for printing spill costs and benefits
These have been incredibly useful when debugging regressions and weird
behavior in the Intel backend when trying to spill multiple registers
before retrying allocation.  With them, we can print out not only what
register was chosen, but the benefit and cost.  Seeing lists of chosen
registers where the benefit/cost was not sorted, and poor options were
chosen before better ones, led me to investigate a number of issues.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28257>
2024-03-19 00:40:52 +00:00
Connor Abbott
84e8a295a0 freedreno/afuc: Add section on reassembling firmwares and relocations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
2e6cfc9e23 freedreno/afuc: Add magic control reg values for a740
It looks like this is the same as a730.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
e7ed7a32cd freedreno/afuc: Add a7xx test case
This tests new instructions, alignment, and sections.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
11b4b570a9 freedreno/afuc: Run entire bootstrap routine
We also need the BV/LPAC info, so run the entire thing until we get to a
waitin or read $data without waitin, which the BV microcode does
because it is disabled by default and skips everything until a
CP_THREAD_CONTROL packet.

The actual microcode writes the packet table last, but my simple test
one doesn't, and there's no guarantee it will continue to do so.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
71f80d3deb freedreno/afuc: Emulate THREAD_SYNC on a660
This is similar to a7xx but slightly different, because it inverts the
sense of the bits (the firmware sets to 1 once it starts) and there are
only 2 processors. We didn't need this before because the waiting on
THREAD_SYNC only happens after setting the packet table.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
7e9380e2bc freedreno/afuc: Allow -e option on a7xx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
d860b2eca5 freedreno/afuc: Add support for multiple sections when assembling
Sections have names that are currently unused but we will need to use
them on a750 for relocations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
a5db8e9c1f freedreno/afuc: Add more general T_IDENTIFIER in lexer
This frees us from having to strip the trailing colon, and makes it
easier to add other identifiers like for section names. The downside is
that now we can't name a label with a reserved word like "mov" but that
doesn't seem too bad.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
f7bf4db339 freedreno/afuc: Add .align directive
This will be necessary for aligning the sections.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
542ae9de01 freedreno/afuc: Improve jump table handling
Some a7xx firmwares have junk after the LPAC jump table, and the old
method of hardcoding the location of the jumptable and the jumptable
offset when assembling and disassembling also doesn't work well on a7xx
where the location of the jumptable offset changes. Make jump tables
explicit in the disassembly with a ".jumptbl" directive which expands to
contain the contents of the jump table, make disassembly find the jump
table and emit the directive there. Then add the ability for a literal
to reference a label, which will be used for the jump table offset at
the beginning of the firmware. The disassembler guesses when a word is
actually the jump table offset and replaces it with a relocation.

This restores the ability to disassemble a630_sqe.fw and a650_sqe.fw and
reassemble to an identical binary without modifying the disassembly to
remove the jump table.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
46681d64f6 freedreno/afuc: Use left recursion in parser
Otherwise we'll run out of stack space with many instructions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
c1955a0b16 freedreno/afuc: Fix setbit/clrbit parsing
We can't modify the instruction when parsing an operand, we will modify
the previous instruction, so just flatten out the rule.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
105ea1fc68 freedreno/afuc: Bump max instructions for a7xx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
eeb2db3b5e freedreno/afuc: Add missing ALU encode case for bic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Connor Abbott
443e8b89ca freedreno/afuc: Decode (peek) modifier
This is an educated guess based on the location it is used in
(CP_INDIRECT_BUFFER).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26771>
2024-03-18 20:34:08 +00:00
Lucas Stach
f88c269148 etnaviv: tex_desc: emit texture comparator
For whatever reasons this has been known in rnndb for ages, but
never was hooked up in the driver. Do so now.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28218>
2024-03-18 20:07:22 +00:00
Lucas Stach
c6a6160583 etnaviv: don't use int filter for depth textures
The int filter has precision issues when used with depth textures,
causing failures in tests like piglit
spec@arb_depth_texture@fbo-depth-gl_depth_component16-drawpixels.

In addition to that the texture compare unit for GL_ARB_shadow
operations seems to be only implemented in the float filter pipe,
so this change also fixes this functionality on GPUs where it
isn't emulated, e.g. GC3000.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28218>
2024-03-18 20:07:21 +00:00
Gert Wollny
5464feed73 zink: set handle type also for user memory
Fixes the validation error
  VUID-vkBindBufferMemory-memory-02985
reported, e.g. by running piglit
  spec@amd_pinned_memory@map-buffer decrement-offset

v2: move setting the export type for user_mem get_export_flags and
    also set alloc_info->external for user_mem to avoid adding
    a conditional when finning the external buffer create info (Mike)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28244>
2024-03-18 19:45:34 +00:00
Konstantin Seurer
995727e575 zink: Handle aoa derefs of images
Only the index of the inner array was used.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28250>
2024-03-18 19:24:43 +00:00
Gert Wollny
50a6c5d5fa nir-to-spirv: Cast SSBO input pointer when needed
Fixes validation error:
  VUID-VkShaderModuleCreateInfo-pCode-08737
  AtomicFAddEXT: expected Pointer to point to a value of type Result
Type
     %51 = OpAtomicFAddEXT %float %49 %uint_1 %uint_0 %50
when running
  spec@nv_shader_atomic_float@execution@ssbo-atomicadd-float

Fixes: 9f6be8effb
    zink: store and use alu types for ntv defs

v2: Fix commit message (Mike)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28243>
2024-03-18 19:03:14 +00:00
duncan.hopkins
0108bae30f apple: Meson defines GLX_USE_APPLE to allow for Gallium drivers to work on MacOS.
By default, on MacOS, MESA will build a version that does not run the Gallium drivers on MacOS.
GLX_USE_APPLE must be defined to switch the code over to using the Gallium drivers.

GLX_USE_APPLE will be defined if any Gallium driver other than just SWRast is requested.
The default behaviour, due to default values, always asks for SWRast.
This logic leaves the default behaviour alone but allows the Gallium drivers to be actived without extra parameters.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28205>
2024-03-18 18:06:45 +00:00
duncan.hopkins
97b6851815 apple: Extended Apple feature support using GLX_USE_APPLE.
On MacOS/Apple/Dawin you can only get MESA to forward the GL funtions to
the systems OpenGL.framework or run SWRast directly. There is no way to use a gallium driver, even if they have been compiled.
The two gallium drivers of interest are SWRast and Zink, as the rest are hardware drivers and not relavent on MacOS.

The code changes add a new define GLX_USE_APPLE. This is used in combination with the existing GLX_USE_APPLEGL.
GLX_USE_APPLEGL calls the systems OpenGL.framework, Apple's OpenGL.
GLX_USE_APPLE calls the non-system OpenGL code, i.e. Gallium, hence the subtle naming difference. Apple systems are still used, just not the GL ones.
When GLX_USE_APPLE is defined the code will use the DRI/gallium driver sub-system so SWRast and Zink can selected at runtime on MacOS.

This also allows Zink to be run on MacOS, once it is fixed up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28205>
2024-03-18 18:06:45 +00:00
duncan.hopkins
b0bdd0cae3 meson: relaxed some meson restrictions on MacOS/Apple allowing for wider build support.
This patch allows the meson build files, on MacOS, to build the DRI2 and EGL code paths.

This is needed to activate the gallium drivers for swrast and zink to be used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28205>
2024-03-18 18:06:45 +00:00
duncan.hopkins
af04f17909 glx: Switched DRI2 functions over to use Apple specific alternatives and extension name.
DRI2 calls are different between Linux and MacOS.
Calling these Linux version on MacOS using xquartz fails with 'unknown' codes.

This patch hardwires a number of the utility DRI2 functions to use the MacOS
specific version that already exist for APPLEGL.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28205>
2024-03-18 18:06:45 +00:00
Mike Blumenkrantz
c0158b40ca mesa/st: use sanitized shader keys for feedback draws
the draw module shouldn't use any other shader keys, so ensure they
are never set

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28189>
2024-03-18 17:05:05 +00:00
Mike Blumenkrantz
5eb0136a3c mesa/st: when creating draw shader variants, use the base nir and skip driver opts
draw module shaders are sometimes incompatible with driver-specific
lowering passes, so ensure that the shaders received by draw are as
close to the originating source as possible

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28189>
2024-03-18 17:05:05 +00:00
Mike Blumenkrantz
1f7a4cf191 mesa/st: add is_draw_shader param to st_finalize_nir
this is used for skipping all the driver-specific lowering

it is not currently set

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28189>
2024-03-18 17:05:05 +00:00
Mike Blumenkrantz
f2f640f3c7 mesa/st: add 'base_serialized_nir'
this is the pre-finalize nir which has (ideally) not been mangled
by driver-specific lowering passes

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28189>
2024-03-18 17:05:05 +00:00
Valentine Burley
3d279bee0a tu/rmv: Remove tu_rmv_DebugMarkerSetObjectNameEXT
Replaced by DebugMarkerSetObjectNameEXT from the common Vulkan runtime
introduced in f3fe1f2f ("vulkan: Implement DebugMarkerSetObjectNameEXT")

Fixes: a13860e5 ("tu: add RMV support")
Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28125>
2024-03-18 16:10:21 +00:00
Eric Engestrom
ad580a711b radeonsi/ci: udpate expected failures
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/56378175
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/56393368
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/56414989

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28246>
2024-03-18 14:03:46 +00:00
Georg Lehmann
67997fd735 aco: avoid full 32bit imul for uniform reduce/scan
Foz-DB Navi31:
Totals from 24 (0.03% of 79395) affected shaders:
Instrs: 1172275 -> 1172078 (-0.02%)
CodeSize: 5974424 -> 5973860 (-0.01%)
Latency: 5896216 -> 5895923 (-0.00%)
InvThroughput: 1167928 -> 1167869 (-0.01%)
VALU: 625756 -> 625636 (-0.02%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28223>
2024-03-18 13:37:28 +00:00
Georg Lehmann
96ff511b75 aco/optimizer: combine v_mul_i32_i24 and add to mad
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28223>
2024-03-18 13:37:28 +00:00
Georg Lehmann
0c57340c23 aco/builder: use 24bit mul if low bits of imm are zero
Foz-DB Navi31:
Totals from 39 (0.05% of 79395) affected shaders:
Instrs: 62712 -> 62696 (-0.03%)
CodeSize: 330096 -> 329896 (-0.06%)
Latency: 192747 -> 192561 (-0.10%)
InvThroughput: 34078 -> 33889 (-0.55%)
VALU: 38979 -> 38963 (-0.04%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28223>
2024-03-18 13:37:28 +00:00
Georg Lehmann
b48a101d8f aco/builder: improve v_mul_imm for negative imm
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28223>
2024-03-18 13:37:27 +00:00
Juan A. Suarez Romero
4f6f2cea6a v3dv: enable smooth line rendering
This is based on a lowering that we are already using in the OpenGL
driver.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28171>
2024-03-18 12:09:12 +00:00
Juan A. Suarez Romero
f5d4242928 v3dv: assume that rasterization state can be NULL
So far to check if rasterization discard is enabled or not we assumed
that rasterization state struct was never NULL.

However, as this will change with VK_EXT_extended_dynamic_state3, it can
be a good idea just to assume it can be NULL, so adding the check too.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28171>
2024-03-18 12:09:11 +00:00
Juan A. Suarez Romero
d6553bf177 compiler,gallium: move u_reduced_prim to common
Useful function that even Vulkan drivers can use.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28171>
2024-03-18 12:09:11 +00:00
Amber
7a236dc785 tu: re-emit vertex buffer on MESA_VK_DYNAMIC_VI_BINDINGS_VALID dirty.
Previously cmd->state.vertex_buffers.size changing would not trigger
a re-emission of the state, leading to dEQP-VK.dynamic_state.*.line_width.*
failing on A7XX.

Signed-off-by: Amber Harmonia <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28208>
2024-03-18 11:37:00 +00:00
Amber
44a3a3e7d9 tu: Add MESA_VK_DYNAMIC_RS_LINE_WIDTH to tu_rast_state.
Dynamic graphics state for line width changing did not trigger a
re-emission of A6XX_GRAS_SU_CNTL.

fixes:
dEQP-VK.dynamic_state.*.blit
dEQP-VK.dynamic_state.*.clear
dEQP-VK.dynamic_state.*.resolve

For A7XX.

Signed-off-by: Amber Harmonia <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28206>
2024-03-18 11:15:58 +00:00
Eric Engestrom
f455ac88b8 vc4/ci: add flake
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/56377699
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/56392947
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/56421981

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28238>
2024-03-18 10:37:13 +00:00
Benjamin Tissoires
ba2af1dc36 CI: add mr-label-maker.yml config
We are currently relying on `mr-label-maker` to automatically tag MRs
or issues. However, the config of the bot was done in the python project
itself as a python class.

Since https://gitlab.freedesktop.org/freedesktop/mr-label-maker/-/merge_requests/25,
we can have an external yaml config file that can be included as an URL
from the bot point of view.

This means that we can now keep the configuration of the bot in the mesa
project itself, lowering the difficulties to include a change in this
configuration.

Note: https://gitlab.freedesktop.org/freedesktop/fdo-bots/-/merge_requests/19
needs to be merged so that this whole mechanic is in place.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28126>
2024-03-18 10:26:19 +00:00
David Rosca
4b7b185711 radv/video: Set maxActiveReferencePictures to 16 for H264/5
H265 supports 16 reference frames too.

Fixes validation errors when decoding H265 stream with more than 8 reference
frames.

Cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27541>
2024-03-18 10:04:52 +00:00
Nikita Popov
99f0449987 Pass no-verify-fixpoint option to instcombine in LLVM 18
When LLVM 18 is used, pass the no-verify-fixpoint option when
running the instcombine pass. Otherwise LLVM may abort with an
error.

The background here is that this option is enabled by default for
testing purposes, because instcombine is normally only explicitly
invoked like this inside tests. If it is used in an actual
production pipeline, the no-verify-fixpoint option needs to be
enabled.

This should fix the issue reported at
https://bugzilla.redhat.com/show_bug.cgi?id=2268800.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28101>
2024-03-18 09:27:15 +00:00
Eric Engestrom
7982751307 ci/deqp: backport fix for dEQP-VK.wsi.direct_drm.* bug
Fixes these tests:
- dEQP-VK.wsi.direct_drm.full_screen_exclusive.*
- dEQP-VK.wsi.direct_drm.maintenance1.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28229>
2024-03-17 11:09:30 +00:00
Eric Engestrom
eac703f691 Revert "nouveau: add missing vl lib"
This reverts commit 4e3f3c10e1.

That commit turns out to be breaking the build in some cases.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10830
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28226>
2024-03-16 20:51:15 +00:00