Commit Graph

9687 Commits

Author SHA1 Message Date
Eric Engestrom 2c67457e5e util/list: rename LIST_ENTRY() to list_entry()
This follows the Linux kernel convention, and avoids collision with
macOS header macro.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6751
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6840
Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17772>
2022-07-28 10:10:44 +00:00
Georg Lehmann df4b5914cd nir/fold_16bit_tex_image: Default to only_fold_all.
No driver doesn't use this option.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17757>
2022-07-27 18:57:12 +00:00
Georg Lehmann 22d860fe4a aco/ir: Add swapped opcode for v_cmp_u/v_cmp_o.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 8f7ceff774 aco/ir: Add v_cmp_class to get_cmp_info.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 578d0a1934 aco/ir: Add vcmpx opcode to get_cmp_info.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 369b8c031a aco/ir: Fix swapped nle.
Cc: mesa-stable

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 9c727b958e aco/ir: Add integer get_cmp_info.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Georg Lehmann 590b93ae65 aco/ir: Generalize (un)ordered_swapped.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
2022-07-27 14:52:29 +00:00
Timur Kristóf 11e51f7211 radv: Use NIR-based NGG lowering with LLVM.
Also cleanup some unused code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12792>
2022-07-27 09:06:24 +00:00
Timur Kristóf 45ed22c87e radv: Properly set LDS size for LLVM NGG shaders.
Update the esgs_ring_size after ac_nir_lower_ngg.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12792>
2022-07-27 09:06:24 +00:00
Timur Kristóf d3dcd294c0 radv/llvm: Remove incorrect hardcoded workgroup size from NGG GS.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12792>
2022-07-27 09:06:24 +00:00
Timur Kristóf 7e7d6d8c73 ac/llvm: Implement GDS atomic add NIR intrinsic.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12792>
2022-07-27 09:06:24 +00:00
Marek Olšák bc85e79bba ac/gpu_info: require amdgpu DRM 3.15.0 (kernel 4.12) from July 2017
to match the radeon requirement

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 9f6a64b1c3 gallium/radeon: require radeon DRM 2.50.0 (kernel 4.12) from July 2017
This is the latest radeon DRM version.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 8426cf9132 ac/gpu_info: remove unused has_unaligned_shader_loads
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák f3f00f77ad ac/gpu_info: remove amdgpu_gpu_info parameter from ac_query_gpu_info
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 41888505fc ac/gpu_info: use drm_amdgpu_device_info instead of amdgpu_gpu_info
These fields are identical but the latter is from libdrm.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák abd188ec1c radeonsi: remove workarounds for radeon DRM < 2.45.0
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 3657cdafd6 amd: require amdgpu DRM 3.2.0 from April 2016
This removes an early bug workaround.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák ff19666a0d ac/gpu_info: remove redundant vcn_encode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 89113c0338 ac/gpu_info: remove redundant vce_encode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 9cbbdc6583 ac/gpu_info: remove redundant uvd_encode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 2972ceccfd ac/gpu_info: remove redundant jpeg_decode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák a0d2e16c91 ac/gpu_info: remove redundant uvd_decode
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 12c5d64fae ac/gpu_info: remove vram_size and gtt_size in favor of *_kb variants
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 983223de5d ac/gpu_info: use the kernel-reported GFX IP version to set gfx_level
hopefully this won't break the world.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 6504d7172c ac/gpu_info: use hw_ip::ip_discovery_version to set IP versions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák 9552da66cc ac/gpu_info: rework and extend device info to be more informative
This is the result with AMD_DEBUG=info:

Device info:
    name = NAVI23
    marketing_name = AMD Radeon RX 6600
    num_se = 2
    num_rb = 8
    num_cu = 28
    max_gpu_freq = 2750 MHz
    max_gflops = 9856 GFLOPS
    l0_cache_size = 16 KB
    l1_cache_size = 128 KB
    l2_cache_size = 2048 KB
    l3_cache_size = 32 MB
    memory_channels = 8 (TCC blocks)
    memory_size = 8 GB (8192 MB)
    memory_freq = 14 GHz
    memory_bus_width = 128 bits
    memory_bandwidth = 224 GB/s
    clock_crystal_freq = 100000 KHz
    IP GFX     10.3 	queues:1
    IP COMP    10.3 	queues:4
    IP SDMA     5.2 	queues:2
    IP VCN_DEC  3.0 	queues:1
    IP VCN_ENC  3.0 	queues:1
    IP VCN_JPG  3.0 	queues:1

It might not be 100% correct with other chips.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák dd6b001775 ac/gpu_info: remove tabs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Marek Olšák f218c3d795 ac/gpu_info: rename info fields to num_cu, memory_bus_width, memory_freq_mhz
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17411>
2022-07-27 05:01:38 +00:00
Benjamin Cheng 1c06565026 radv: expose disjoint image support
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
2022-07-26 19:50:58 +00:00
Benjamin Cheng 27a24cb382 radv: implement disjoint memory for multiplane images
For descriptor binding, we need to allow up to three buffers to be
referenced by any image.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
2022-07-26 19:50:58 +00:00
Benjamin Cheng 6a77ecbe6f radv: consolidate descriptor set buffer counts
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
2022-07-26 19:50:57 +00:00
Benjamin Cheng 72625bea5f radv: refactor image binding into struct
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
2022-07-26 19:50:57 +00:00
Georg Lehmann 5dab077824 aco: Add a note about G16 without A16 to README-ISA.md.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16979>
2022-07-26 16:54:08 +00:00
Georg Lehmann 7fa9b25c2f radv: Fold 16bit tex sources.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16979>
2022-07-26 16:54:08 +00:00
Georg Lehmann f5f73db846 aco: Support 16bit sources for texture ops.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16979>
2022-07-26 16:54:08 +00:00
Georg Lehmann c1cf0688c9 aco: Add G16 opcodes.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16979>
2022-07-26 16:54:08 +00:00
Konstantin Seurer 2861d1ff8a radv: Fix out of bounds access in RTPSO creation
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17723>
2022-07-24 14:59:44 +00:00
Daniel Schürmann 5b196716cf radv/rt: simplify lower_rt_instructions()
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann f7c318901d radv/rt: fix nir_builder cursor in lower_rt_instructions()
Fixes: 207ce6d658 ('radv: Add helper to inline shaders into the main shader.')
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann c0945f70df radv/rt: Don't load ClosestHit SBT on every hit, but only once after traversal
Quake II RTX:
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 217592 -> 215956 (-0.75%)
Instrs: 39468 -> 39341 (-0.32%)
Latency: 761581 -> 746802 (-1.94%)
InvThroughput: 507721 -> 497870 (-1.94%)
Copies: 4621 -> 4585 (-0.78%)
Branches: 1598 -> 1584 (-0.88%)

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann c39cccec9c radv/rt: use stage ID as handle for general and closestHit shaders
This avoids some code duplication and divergence.

Quake II RTX:
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 218880 -> 217592 (-0.59%)
Instrs: 39692 -> 39468 (-0.56%)
Latency: 789091 -> 761581 (-3.49%)
InvThroughput: 526061 -> 507721 (-3.49%)
VClause: 1202 -> 1188 (-1.16%)
Copies: 4649 -> 4621 (-0.60%)
Branches: 1605 -> 1598 (-0.44%)

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann 3750663c72 radv/rt: use derefs for the traversal stack
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann 076ea8b35a radv: create RT traversal as separate shader
This will help in future to keep the main shader slim
when we have actual function calls.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Daniel Schürmann 8e056af399 radv: Only create noop-fs for graphics pipelines
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
2022-07-22 15:31:23 +00:00
Timur Kristóf 8d7ca7783b ac/nir/ngg: Remember proper bit sizes of GS output variables.
The LLVM backend keeps track of 16-bit output variables and it will
miscompile shaders when these outputs aren't the correct bitsize.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17706>
2022-07-22 08:17:39 +00:00
Timur Kristóf e60fbb4dc9 ac/nir/ngg: Copy comment about LDS layout for NGG GS.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17706>
2022-07-22 08:17:39 +00:00
Timur Kristóf b5abf4fb3d ac/llvm: Use gs_prim_id for NGG VS.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17706>
2022-07-22 08:17:39 +00:00
Timur Kristóf 1e2663b62c ac/llvm: Add LLVM bug workaround to ac_build_mbcnt_add.
LLVM always believes that this instruction's upper bound is the wave
size, regardless of ac_set_range_metadata and regardless of whether
the add source is used.

As a workaround, emit an extra add instruction.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17706>
2022-07-22 08:17:39 +00:00