summaryrefslogtreecommitdiff
path: root/src/amd/vulkan/si_cmd_buffer.c
AgeCommit message (Collapse)AuthorFilesLines
2024-04-04radv: rename si_cmd_buffer.c to radv_cs.cSamuel Pitoiset1-613/+0
This file now mostly contain CS related functions. Also move prototypes while we are at it. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: move code related to sample positions to radv_device.cSamuel Pitoiset1-136/+0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: move radv_emit_{compute,graphics}() to radv_queue.cSamuel Pitoiset1-586/+0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: move radv_create_gfx_config() to radv_device.cSamuel Pitoiset1-40/+0
Also rename to radv_create_gfx_preamble(). Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: move radv_get_viewport_xform() to radv_pipeline_graphics.cSamuel Pitoiset1-19/+0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: merge radv_write_scissors() with radv_emit_scissor()Samuel Pitoiset1-47/+0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: merge radv_write_guardband() with radv_emit_guardband_state()Samuel Pitoiset1-54/+0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: move more cmd buffer related code to radv_cmd_buffer.cSamuel Pitoiset1-244/+0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: move CP DMA related code to radv_cp_dma.c/hSamuel Pitoiset1-338/+0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-04radv: add radv_sqtt.hSamuel Pitoiset1-0/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-03radv: move radv_prim_vertex_count to si_cmd_buffer.cSamuel Pitoiset1-0/+5
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526>
2024-04-03radv: implement VK_EXT_device_address_binding_reportSamuel Pitoiset1-2/+2
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28373>
2024-04-02radv: add radv_buffer.hSamuel Pitoiset1-0/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28510>
2024-04-01radv: remove radv_cmd_buffer::deviceSamuel Pitoiset1-13/+21
Get the logical device object using the base object. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-04-01radv: remove radv_device::physical_deviceSamuel Pitoiset1-53/+56
Get the logical device object using the base object. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-04-01radv: rename radv_physical_device::rad_info to infoSamuel Pitoiset1-102/+102
The extra rad_ prefix isn't necessary and it's longer to type. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-04-01radv: rename radeon_info variables to gpu_info everywhereSamuel Pitoiset1-18/+18
Sometimes we might have other info struct, so renaming to gpu_info removes the confusion. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-04-01radv: rename radv_physical_device variables to pdev everywhereSamuel Pitoiset1-80/+78
Shorter and more consistent. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-03-27radv: inline radv_device_fault_detection_enabledMike Blumenkrantz1-0/+1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28394>
2024-03-27radv/rmv: log allocated/destroyed BOs in radv_buffer_{create,destroy}()Samuel Pitoiset1-1/+1
This will likely log more things because a bunch of them were missing. This will also allow us to implement VK_EXT_device_address_binding_report more easily. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367>
2024-03-27radv: add radv_bo_{create,destroy}() helpersSamuel Pitoiset1-3/+3
This will allow us to easily log all BOs both for RMV and VK_EXT_device_address_binding_report. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367>
2024-03-15radv: fix programming of PA_SC_BINNER_CNTL_1.MAX_ALLOC_COUNT on GFX11Samuel Pitoiset1-2/+7
Ported from RadeonSI 7d3a414662ed4aaffd80762532a1c3c9f4cfc4f1 ("radeonsi/gfx11: fix programming of PA_SC_BINNER_CNTL_1.MAX_ALLOC_COUNT") Fixes: 25a66477d02 ("radeonsi/gfx11: register changes") Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28165>
2024-03-15radv: Only enable SEs that the device reportsFriedrich Vock1-10/+13
Matches PAL behavior. Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28195>
2024-03-01radv: Implement reserving the VA range on unmap.Bas Nieuwenhuizen1-1/+1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27689>
2024-03-01radv/winsys: Use radv_buffer_map wrapper.Bas Nieuwenhuizen1-1/+1
So we can have 1 function ptr and then have a version with default args. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27689>
2024-03-01radv: Add winsys argument to buffer map/unmap.Bas Nieuwenhuizen1-2/+2
To use later. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27689>
2024-03-01radv: add a helper to emit PKT3_COND_EXECSamuel Pitoiset1-0/+19
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27746>
2024-01-31radv: add a helper to know if device fault detection is enabledSamuel Pitoiset1-3/+3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27293>
2024-01-15radv: never set DISABLE_WR_CONFIRM for CP DMA clears and copiesTatsuyuki Ishi1-6/+0
This mirrors the changes in 69ff9c16bbb ("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-09radv/winsys: replace '<= GFX6' by '== GFX6'Samuel Pitoiset1-1/+1
GFX6 is the first AMD family supported by RADV. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26867>
2024-01-09radv: do not program COMPUTE_MAX_WAVE_ID (GDS register) on GFX6Samuel Pitoiset1-10/+0
Ported from RadeonSI c2359797. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26867>
2024-01-04radv: drop si_ prefix from all functionsSamuel Pitoiset1-73/+73
Most of these functions were copied from RadeonSI but they should be prefixed with radv_ instead. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26854>
2023-12-04radv: Enable compute dispatch tunnelingFriedrich Vock1-0/+2
Compute tunneling can considerably lower the latency of high-priority compute work. Enabling it is beneficial in cases where high-priority work is dispatched while the GPU is already busy with other work (e.g. rendering on GFX). This is the case in VR compositors that dispatch latency-sensitive compositing work to ACE while GFX is busy rendering the next frame. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26462>
2023-11-18ac: Remove CIK prefix from SDMA opcodes.Timur Kristóf1-1/+1
The vast majority of AMD GPUs (except the very first GCN) have the same SDMA packet format, so let's just call it SDMA instead of CIK_SDMA. (And leave the oldest GPUs with SI_SDMA as they are now.) Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-01radv: emit COMPUTE_PIPELINESTAT_ENABLE for CS invocations on ACESamuel Pitoiset1-8/+24
This register seems needed to enable compute shader shader invocations on GFX7. On GFX8+ it's working fine without emitting this register but I think it doesn't hurt. This fixes dEQP-VK.query_pool.statistics_query.*_cq on GFX7. Fixes: a9945216ba2 ("radv: fix COMPUTE_SHADER_INVOCATIONS query on compute queue") Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25957>
2023-10-24radv: Support SDMA in si_cs_emit_write_event_eop.Timur Kristóf1-0/+8
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25833>
2023-10-24radv: set ENABLE_PING_PONG_BIN_ORDER for GFX11.5Samuel Pitoiset1-1/+2
Ported from RadeonSI. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25304>
2023-10-19radv: Add queue family argument to some functions.Timur Kristóf1-11/+13
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/25770>
2023-10-19radv: Refactor WRITE_DATA helper function.Timur Kristóf1-1/+1
Create a version of this function that takes a CS and queue family. move it to radv_cs.h so it can be called from multiple other files. 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/25770>
2023-10-19radv: Move radv_cp_wait_mem to radv_cs.h and add queue family argument.Timur Kristóf1-16/+4
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/25770>
2023-10-12radv: disable primitive restart for non-indexed draws on GFX11Samuel Pitoiset1-0/+5
Primitive restart is also applied to non-indexed draws on AMD GPUs. On GFX11, DISABLE_FOR_AUTO_INDEX can be set but we will need a different solution for older GPUs. This fixes all line related flakes in CI (at least). Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25639>
2023-09-29radv: emit missing PA_{SC,SU}_LINE_STIPPLE_xxx regs in gfx preambleSamuel Pitoiset1-0/+9
Ported from RadeonSI and PAL. This might fix the line stipple flakes in CI. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25428>
2023-06-30radv: emit PA_SC_SCREEN_SCISSOR_BR with the actual fb extentSamuel Pitoiset1-2/+0
For some reasons, this register is needed for RGP to report actual render/depth targets size instead of 0 for both width/height. It doesn't seem to have any other effects. Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9169 Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23921>
2023-06-26radv: Remove unconditional POPS_DRAIN_PS_ON_OVERLAP settingVitaliy Triang3l Kuzmin1-4/+2
This hardware hang workaround (PAL waMiscPopsMissedOverlap) is needed only on some Vega chips, and only for 8 or more samples per pixel. It has a significant performance cost (around 1.5x-2x in nvpro-samples/vk_order_independent_transparency), so it should be precisely configured when setting up Primitive Ordered Pixel Shading. It was added in 47b780be21d917eaa6a6a6c9e30ba9fba52d9acd, when POPS was not used in Mesa, with the change being described as "this may not be needed yet, but let's set it now". Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>
2023-06-19radv: use IB for the GFX preamble on GFX6Samuel Pitoiset1-1/+1
GFX6 supports IBs without any issues. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23670>
2023-06-17amd: don't set PA_RATE_CNTL because it has no effectMarek Olšák1-1/+0
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23687>
2023-06-16radv: reformat according to its .clang-formatEric Engestrom1-270/+188
Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23253>
2023-06-13radv: Leave primitive reset index at max on GFX8+.Timur Kristóf1-0/+7
GFX8+ only compares the bits according to the index type by default (GFX9 can be changed by VGT_MULTI_PRIM_IB_RESET_EN.MATCH_ALL_BITS), so we can always leave the programmed value at the maximum. This reduces context rolls on GFX8+ when primitive restart is used. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23459>
2023-04-30radv: Add stricter space checks.Bas Nieuwenhuizen1-0/+2
The check for max_dw means that none of checks triggered reliably when we had an issue. Use a stricter reserved dw measure to increase the probability of catching issues. Adds a radeon_check_space to some places after cs_create as they previously relied on the min. cs size, but that would still trigger the checks. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20152>
2023-04-20radv: emit PIXEL_PIPE_STAT_CONTROL in the gfx preamble for GFX11Samuel Pitoiset1-0/+9
This is more optimal than emitting for every BeginOcclusionQuery(). Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22556>