aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_radeon_winsys.h
Commit message (Collapse)AuthorAgeFilesLines
* radv: return better Vulkan error codes when VkQueueSubmit() failsSamuel Pitoiset2020-07-171-10/+10
| | | | | | | | The driver shouldn't abort when a CS submission fails. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5876>
* radv: optimize creating signaled syncobj with amdgpu_cs_create_syncobj2()Samuel Pitoiset2020-07-161-1/+2
| | | | | | | | | This creates a syncobj and sets it as signaled with one ioctl instead of two. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5921>
* radv/winsys: Distinguish device/host memory errors.Bas Nieuwenhuizen2020-06-241-1/+1
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5578>
* radv: Provide a better error for permission issues with priorities.Bas Nieuwenhuizen2020-05-151-2/+5
| | | | | | Cc: <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4816>
* radv/winsys: do not count visible VRAM buffers twice in the budgetSamuel Pitoiset2020-05-061-1/+1
| | | | | | | | | | | | | | | | | The VRAM size returned to apps is computed as follows: vram_size = real_hw_vram_size - visible_vram_size. Visible VRAM buffers should be counted only in the visible VRAM counter and not twice. Buffers with the NO_CPU_ACCESS flag are known to not be mappable, so they are counted in the VRAM counter. Other buffers, with the CPU_ACCESS flag, or without any of both (imported buffers) are counted in the visible VRAM counter because they are mappable. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4834>
* radv/winsys: Add function to get domains/flags from fd.Bas Nieuwenhuizen2020-04-281-0/+4
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4751>
* radv: stop including files from mesa/mainMarek Olšák2020-03-271-3/+3
| | | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected] Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
* radv/winsys: add a new flag that requests zerovram allocationsSamuel Pitoiset2020-02-201-0/+1
| | | | | | | | This introduces RADON_FLAG_ZERO_VRAM. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3888>
* radv: Remove syncobj_handle variable in header.Bas Nieuwenhuizen2020-01-211-1/+0
| | | | | | | | | | | | I strongly suspect it was supposed to be a typedef. However, used nowhere, we should remove it. Fixes: eaa56eab6da "radv: initial support for shared semaphores (v2)" Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2385 Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3479> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3479>
* radv: Use new scanout gfx9 metadata flag.Bas Nieuwenhuizen2020-01-121-0/+1
| | | | | | | | This updates for the new metadata ABI in radeonsi. Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3244> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3244>
* ac: add radeon_info::num_rings and move ring_type to amd_family.hMarek Olšák2019-11-191-9/+0
| | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* radv: Check the size of the imported buffer.Bas Nieuwenhuizen2019-10-101-1/+2
| | | | | | | This is a security feature to disallow malicious apps from passing a buffer that is too small. Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Cleanup buffer_from_fd.Bas Nieuwenhuizen2019-10-101-2/+1
| | | | | | Unused stride/offset args. Reviewed-by: Samuel Pitoiset <[email protected]>
* radv/winsys: add support for GS and OA domainsSamuel Pitoiset2019-09-161-1/+3
| | | | | | | For NGG streamout which uses GDS. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Clean up signalled and submitted fields from winsys fences.Bas Nieuwenhuizen2019-05-131-0/+3
| | | | | | | | | Other types like syncobj do not need it, so lets make things a bit more uniform. Also reduce confusion what the signalled/submitted referred to (especially with imported fences) Reviewed-by: Dave Airlie <[email protected]>
* radv: Use local buffers for the global bo list.Bas Nieuwenhuizen2019-04-151-0/+1
| | | | | | | | | | | | | | Even if we don't use local buffers in general. Turns out that even though the performance is not the best the kernel still does it better than our own list. We still have to keep the radv bo list for buffers that are shared externally. This improves Talos on lowest quality setting (so as CPU bound as possible) by ~10% if the global bo list is enabled. Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Enable VK_EXT_memory_priority.Bas Nieuwenhuizen2019-01-291-2/+0
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* radv/winsys: Set winsys bo priority on creation.Bas Nieuwenhuizen2019-01-291-2/+28
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: add support for VK_EXT_memory_budgetSamuel Pitoiset2019-01-151-0/+4
| | | | | | | | | | | | A simple Vulkan extension that allows apps to query size and usage of all exposed memory heaps. The different usage values are not really accurate because they are per drm-fd, but they should be close enough. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Alex Smith <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/android: Use buffer metadata to determine scanout compat.Bas Nieuwenhuizen2018-12-041-0/+2
| | | | | | | | These days we don't always allocate scanout compatible textures anymore. That does mean we have to fix the radv android WSI though. Fixes: b1444c9ccb0 "radv: Implement VK_ANDROID_native_buffer." Acked-by: Samuel Pitoiset <[email protected]>
* radv/winsys: remove unused surface_best()Samuel Pitoiset2018-10-311-3/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: get rid of buffer object prioritiesSamuel Pitoiset2018-07-121-5/+3
| | | | | | | | | We mostly use the same priority for all buffer objects, so I don't think that matter much. This should reduce CPU overhead a little bit. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* amd,radeonsi: rename radeon_winsys_cs -> radeon_cmdbufMarek Olšák2018-06-191-16/+16
| | | | Acked-by: Bas Nieuwenhuizen <[email protected]>
* radv/winsys: allow to allocate BOs in the 32-bit addr spaceSamuel Pitoiset2018-05-221-0/+1
| | | | | | | This introduces a new flag called RADEON_FLAG_32BIT. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Keep a global BO list for VkMemory.Bas Nieuwenhuizen2018-04-181-0/+6
| | | | | | | | | | | | | | With update after bind we can't attach bo's to the command buffer from the descriptor set anymore, so we have to have a global BO list. I am somewhat surprised this works really well even though we have implicit synchronization in the WSI based on the bo list associations and with the new behavior every command buffer is associated with every swapchain image. But I could not find slowdowns in games because of it. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: include mtypes.h lessMarek Olšák2018-04-121-0/+1
| | | | | | | | | | - remove mtypes.h from most header files - add main/menums.h for often used definitions - remove main/core.h v2: fix radv build Reviewed-by: Brian Paul <[email protected]>
* radv: Use the syncobj wait ioctl to wait on fences if possible.Bas Nieuwenhuizen2018-03-011-1/+2
| | | | | | Handles the !waitAll and signal after the start of the wait cases correctly. Reviewed-by: Dave Airlie <[email protected]>
* radv: Implement more efficient !waitAll fence waiting.Bas Nieuwenhuizen2018-03-011-0/+5
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv: implement VK_EXT_external_memory_hostFredrik Höglund2018-02-081-0/+4
| | | | | | | Ported from the radeonsi GL_AMD_pinned_memory implementation. Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/winsys: add RADEON_FLAG_READ_ONLYSamuel Pitoiset2018-01-081-0/+1
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/amdgpu: wrap sync fd import/export.Bas Nieuwenhuizen2017-12-181-0/+5
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv: Add syncobj signal/reset/wait to winsys.Bas Nieuwenhuizen2017-12-181-0/+4
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv/winsys: implement query_value()Samuel Pitoiset2017-12-081-0/+16
| | | | | | | | | Might be useful to know the VRAM/GTT usage, the number of VRAM CPU page faults, etc. Nothing is currently using that new interface, but it's a first step. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: move is_local up to the winsys level.Dave Airlie2017-11-061-0/+4
| | | | | | | | We can avoid adding the buffer in the non-local case, this will avoid all the overhead of the indirect call. Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: wrap cs_add_buffer in an inline. (v2)Dave Airlie2017-11-061-0/+8
| | | | | | | | | The next patch will try and avoid calling the indirect function. v2: add a missing conversion. Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add support for local bos. (v3)Dave Airlie2017-10-261-0/+1
| | | | | | | | | | | | This uses the new kernel interfaces for reduced cs overhead, We only set the local flag for memory allocations that don't have a dedicated allocation and ones that aren't imports. v2: add to all the internal buffer creation paths. v3: missed some command submission paths, handle 0/empty bo lists. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: disable implicit sync for radv allocated bos v3Andres Rodriguez2017-10-211-0/+1
| | | | | | | | | | | | | | | | | Implicit sync kicks in when a buffer is used by two different amdgpu contexts simultaneously. Jobs that use explicit synchronization mechanisms end up needlessly waiting to be scheduled for long periods of time in order to achieve serialized execution. This patch disables implicit synchronization for all radv allocations except for wsi bos. The only systems that require implicit synchronization are DRI2/3 and PRIME. v2: mark wsi bos as RADV_MEM_IMPLICIT_SYNC v3: Add drm version check (Bas) Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Implement VK_EXT_global_priorityAndres Rodriguez2017-10-211-1/+10
| | | | | | | | | This extension allows the caller to change a queue's system wide priority. This is useful for applications with specific latency constraints. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Don't use a virtual function for getting the buffer virtual address.Bas Nieuwenhuizen2017-09-201-3/+8
| | | | | | | | | | | We are really not going to use a winsys which does not need to store the va, so might as well store it in a standard field. Not sure this helps perf much though, as most of the cost is in the cache miss accessing the bo anyway, which we stil need to do. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: add get_chip_name() callbackSamuel Pitoiset2017-09-151-0/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/winsys: add a read_registers() callbackSamuel Pitoiset2017-09-141-0/+3
| | | | | | | To dump some status MMIO registers when a hang is detected. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/gfx9: allocate events from uncached VA spaceDave Airlie2017-09-071-1/+2
| | | | | | | | | | | | This copies what amdgpu-pro does, and allocates the memory for an event with an uncached mtype. This fixes hangs with: dEQP-VK.api.command_buffers.record_simul_use_primary Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "17.2" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Add trace ids for secondary buffers.Bas Nieuwenhuizen2017-08-291-1/+1
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: initial support for shared semaphores (v2)Dave Airlie2017-07-211-5/+16
| | | | | | | | | | | | | | | | | | | This adds support for sharing semaphores using kernel syncobjects. Syncobj backed semaphores are used for any semaphore which is created with external flags, and when a semaphore is imported, otherwise we use the current non-kernel semaphores. Temporary imports from syncobj fd are also available, these just override the current user until the next wait, when the temp syncobj is dropped. v2: allocate more chunks upfront, fix off by one after previous refactor of syncobj setup, remove unnecessary null check. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/winsys: add syncobj hooksDave Airlie2017-07-211-0/+8
| | | | | | | | This just adds syncobj create/destroy/export/import paths into the winsys interface. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: split metadata struct into legacy/gfx9 parts.Dave Airlie2017-06-061-10/+19
| | | | | | | This is just ported from radeonsi. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: use ac_gpu_infoNicolai Hähnle2017-06-051-54/+1
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv: remove radeon_info::nameNicolai Hähnle2017-06-051-1/+0
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv: use ac_surface data structuresNicolai Hähnle2017-06-051-83/+4
| | | | | | | | | This is mostly mechanical changes of renaming types and introducing "legacy" everywhere. It doesn't use the ac_surface computation functions yet. Reviewed-by: Dave Airlie <[email protected]>
* radv: rename radeon_surf::bo_{size,alignment} to surf_{size,alignment}Nicolai Hähnle2017-06-051-2/+3
| | | | | | To match radeonsi / ac_surface. Reviewed-by: Dave Airlie <[email protected]>