Commit graph

8169 commits

Author SHA1 Message Date
Joshua Ashton
907fe6ea62 radv: Add radv_get_tdr_timeout_for_ip helper
Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27091>
2024-01-19 07:52:01 +00:00
Joshua Ashton
ed4ef4dc65 radv/amdgpu: Remove ctx_query_reset_status
We don't use this anymore, it is all dead code.

Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27091>
2024-01-19 07:52:01 +00:00
Joshua Ashton
f62bdde703 radv: Remove check_status
Following discussion on kernel mailing list[1], we are not gaining
anything from this right now, and it does not handle soft recovery.

We will hear about the context loss and rationale when we vkQueueSubmit
next.

We can come back to this if there is ever a Vulkan extension for
figuring out innocent vs guilty like GL_EXT_robustness.

This does mean however that we return VK_SUCCESS for cancelled semaphore
and fence waits, but this is legal per the Vulkan spec:

"Commands that wait indefinitely for device execution (namely
vkDeviceWaitIdle, vkQueueWaitIdle, vkWaitForFences with a maximum
timeout, and vkGetQueryPoolResults with the VK_QUERY_RESULT_WAIT_BIT
bit set in flags) must return in finite time even in the case of a lost
device, and return either VK_SUCCESS or VK_ERROR_DEVICE_LOST."

"If device loss occurs (see Lost Device) before the timeout has expired,
vkWaitSemaphores must return in finite time with either VK_SUCCESS or
VK_ERROR_DEVICE_LOST."

[1]: https://lists.freedesktop.org/archives/amd-gfx/2024-January/103337.html

Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27091>
2024-01-19 07:52:01 +00:00
Joshua Ashton
b24a4b8949 radv: Mark device loss if QueueSubmit failed immediately
Otherwise we rely on check_status alone, and that's going away.

Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27091>
2024-01-19 07:52:01 +00:00
Joshua Ashton
c58cff3ce4 radv/amdgpu: Handle -ENODATA and -ETIME from cs_submit
This can be sent in the event of a soft/hard recovery.

Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27091>
2024-01-19 07:52:01 +00:00
Konstantin Seurer
e83ef27ba6 radv: Vectorize load_global_constant
Totals from 325 (0.38% of 84845) affected shaders:
Instrs: 2883767 -> 2880939 (-0.10%); split: -0.10%, +0.00%
CodeSize: 15388396 -> 15364976 (-0.15%); split: -0.16%, +0.00%
Latency: 20212583 -> 20197719 (-0.07%); split: -0.20%, +0.13%
InvThroughput: 5489738 -> 5489551 (-0.00%); split: -0.14%, +0.14%
VClause: 104225 -> 103944 (-0.27%); split: -0.30%, +0.03%
SClause: 71616 -> 71612 (-0.01%); split: -0.01%, +0.01%
Copies: 252143 -> 252284 (+0.06%); split: -0.10%, +0.15%
Branches: 117826 -> 117821 (-0.00%); split: -0.01%, +0.00%
PreVGPRs: 23502 -> 23506 (+0.02%)

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27084>
2024-01-18 21:30:39 +00:00
Hans-Kristian Arntzen
4ab6d7e753 wsi/x11: Add drirc option to ignore SUBOPTIMAL.
Talos Principle and related games on that engine fail to handle
SUBOPTIMAL properly. Adds an option to ignore SUBOPTIMAL and pretend
it's SUCCESS.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27037>
2024-01-18 17:23:32 +00:00
Dave Airlie
f33683e4da radv: don't submit empty command buffers on encoder ring.
the vcn enc/unified rings don't do nop packets, and hang with 0 sized
cmd buffers. This just stops submitting 0 sized cmd buffers to the hw.

Fixes hangs with dEQP-VK.video.decode.h264_i on navi3x

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25932>
2024-01-18 13:33:25 +10:00
Dave Airlie
d32f2ee7b6 radv/video: refactor sq start/end code to avoid decode hangs.
The extra cmd buffer layer was done wrong, need to emit the
sq start and ends around every reset/decode packet.

Fixes dEQP-VK.video.decode.h264_i on navi3x

Fixes: d8f3060bd9 ("radv/video: start adding gfx11 vcn decoder")
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25932>
2024-01-18 13:33:10 +10:00
Samuel Pitoiset
10e2dbb63b radv: delay emitting streamout enable at draw time
Since Vulkan 1.3.271, the spec allowed vkCmdBeginTransformFeedbackEXT
to be called without an active graphics pipeline bound when using
shader objects.

That means that the last VGT shader would be NULL once VKCTS is
updated accordingly. This change delays emitting streamout enable at
draw time to make sure the last VGT shader is present, regarldess if
ESO is enabled or not.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27075>
2024-01-17 17:33:17 +00:00
Friedrich Vock
a9831caa14 radv/rt: Add workaround to make leaves always active
DOOM Eternal builds acceleration structures with inactive primitives and
tries to make them active in later AS updates. This is disallowed by the
spec and triggers a GPU hang. Fix the hang by working around the bug.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27034>
2024-01-17 15:14:48 +00:00
Samuel Pitoiset
ce200669b1 radv: rename radv_pipeline_key to radv_graphics_pipeline_key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27073>
2024-01-17 12:08:24 +00:00
Samuel Pitoiset
c5a5ab46c9 radv: remove radv_generate_pipeline_key()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27073>
2024-01-17 12:08:24 +00:00
Samuel Pitoiset
72d2eb39fb radv: pass radv_graphics_state_key to radv_hash_shaders()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27073>
2024-01-17 12:08:24 +00:00
Marek Olšák
b9b00a0e7a ac,radeonsi: emulate GS primitive pipeline stat on gfx11 because of culling
GS culls too, so the pipeline stat is incorrect. This can be exposed by
forcing monolithic shader use, which makes culling shaders immediately
available for tests to use.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26917>
2024-01-17 09:05:55 +00:00
Marek Olšák
0d74123633 ac/nir: rename clipdist_enable_mask -> clip_cull_dist_mask
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26917>
2024-01-17 09:05:54 +00:00
Marek Olšák
4880c1e12e amd: unify NIR options between RADV and radeonsi
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26917>
2024-01-17 09:05:54 +00:00
Samuel Pitoiset
e19ecf49ea radv: remove an extra new line in radv_shader.h
To make clang-format CI job happy again.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
ee96de53e4 radv: remove the pipeline key for ray tracing pipelines
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
e799907071 radv: remove the pipeline key for compute pipelines
Eveyerthing needed is already in radv_shader_stage_key.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
e017eb3b58 radv: stop hashing radv_pipeline_key for compute/rt pipelines
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
739c8eb681 radv: hash radv_shader_stage_key
This will allow us to remove the pipeline key completely for compute/rt
pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
853298edb1 radv/rt: cleanup radv_parse_rt_stage()
To avoid calling radv_pipeline_stage_init() twice.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
ffe997d71d radv: add radv_pipeline_get_shader_key()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
844004c335 radv: cleanup radv_generate_pipeline_key()
Move everything in the same loop to prepare for a new helper.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
3615bcdde3 radv: make sure to retain shaders key for imported shaders with GPL
Now that everything is moved to the per-stage key, this information
needs to be retained/loaded with GPL, otherwise some flags might be
missing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
082c524f86 radv: pass radv_shader_stage_key to radv_pipeline_stage_init()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
08b8356111 radv: add shader_version to radv_shader_stage_key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Samuel Pitoiset
20fdbc7a44 radv: add keep_statistic_info to radv_shader_stage_key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
2024-01-17 07:25:49 +00:00
Dave Airlie
b72b4d8a0e vulkan/video: rename some of the parameter tracking structs.
This will make it easier to add deep copy support.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27066>
2024-01-16 00:54:35 +00:00
Tatsuyuki Ishi
43fb43ba2c radv: never set DISABLE_WR_CONFIRM for CP DMA clears and copies
This mirrors the changes in 69ff9c16bb ("radeonsi: never set
DISABLE_WR_CONFIRM for CP DMA clears and copies").

Cc: mesa-stable
Suggested-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27053>
2024-01-15 12:09:01 +00:00
Samuel Pitoiset
b555f9451c radv: introduce radv_graphics_state_key
This struct only contains graphics related state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
b888677dcf radv: add vertex_robustness1 to radv_shader_stage_key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
f2f87d0872 radv: re-organize radv_pipeline_key
Rename and regroup fields per PSO basically.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
fb80421a62 radv: stop passing the pipeline key when compiling compute/rt shaders
The pipeline key now essentially contains graphics state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
6e7018e74d radv: remove unused lower_rt_instruction_monolithic_state::key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
ea89328fb4 radv: remove unecessary radv_nir_compiler_options::key
This is no longer useful.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
6e1a73a53d radv: add optimisations_disabled to radv_shader_stage_key
At some point, we will probably have a VK_SHADER_CREATE_xxx flag
matching the pipeline one. So, I think it's more like a per-shader
field. It can also be useful to disable optimisations per stage when
debugging.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
3a776f036f radv: use radv_shader_stage_key directly with pre-existing fields
More fields will be moved to radv_shader_stage_key but start using it
with pre-existing fields.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
28e330c245 radv: add radv_shader_stage_key to radv_shader_stage
For storing the per-stage key information like robustness etc. This
will fit well with ESO as well.

For pipelines, they are copied from radv_pipeline_key, similarly to
the radv_pipeline_layout/radv_shader_layout pair.

This will also allow us to kill radv_pipeline_key for compute/rt
pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
cff2a3aafc radv: move radv_pipeline_key::mesh_fast_launch_2 to the per-device cache key
This is a global thing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
d74150fc66 radv: remove one unused parameter in radv_fill_shader_info_ngg()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
138ce72860 radv/nir: remove useless struct for nir_shader typedef
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
18349692d0 radv/nir: pass radv_shader_stage to some radv_nir_xxx() functions
Instead of passing separate parameters for args, layout, info etc.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27007>
2024-01-15 11:49:04 +00:00
Samuel Pitoiset
6febec12e4 radv: correctly return VK_ERROR_OUT_OF_DEVICE_MEMORY when mapping a BO fails
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27039>
2024-01-15 09:41:55 +00:00
Samuel Pitoiset
4fe5f06d40 radv/rt: re-use radv_ray_tracing_stage::sha1 for hashing RT pipelines
radv_ray_tracing_stage::sha1 is radv_pipeline_key+shader_sha1 which
should be similar to what the code was doing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27030>
2024-01-15 08:58:37 +00:00
Samuel Pitoiset
bb86fc0359 radv: constify stages in radv_rt_fill_group_info()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27030>
2024-01-15 08:58:37 +00:00
Tatsuyuki Ishi
63827751e1 radv: Recompute max_waves after postprocessing RT config
The max waves for RT prolog need to be recalculated after merging the
resource usage of all shaders invoked from it.

Note that there is no need to panic, as the info was only used to
calculate maximum scratch size and with the RT prolog being low
footprint, this likely only caused overestimation rather than
underestimation.

Fixes: 533ec9843e ("radv: Precompute shader max_waves.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26998>
2024-01-12 02:39:32 +00:00
Timur Kristóf
436b89e838 radv: Correctly select SDMA support for PRIME blit.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10317
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27015>
2024-01-11 21:38:10 +00:00
Samuel Pitoiset
6f6905fc94 radv: move all per-device keys from radv_pipeline_key to radv_device_cache_key
radv_device_cache_key contains everything per-device, while
radv_pipeline_key is more like per-pipeline keys.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26948>
2024-01-11 08:37:36 +00:00