Commit Graph

164717 Commits

Author SHA1 Message Date
Qiang Yu a8350dcd25 ac/llvm: remove implicite ms texture fmask handling
It has been lowered to fragment_mask_load_amd in nir.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:35 +08:00
Qiang Yu 523e7e094d ac/llvm: remove image/texture descriptor_amd nir to llvm code
They have been lowered in nir.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:31 +08:00
Qiang Yu d4fdeaa820 radeonsi: replace llvm resource code with nir lower
Port from ac_nir_to_llvm.c and si_shader_llvm_resource.c.

Due to need waterfall of llvm backend, we can't get bind-texture
descriptor directly in nir. So we keep load_sampler_desc abi only
for bind-texture index to desc.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:27 +08:00
Qiang Yu e85c5d8779 nir/divergence_analysis: add missing intrinsics
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Singed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:24 +08:00
Qiang Yu adecf52a3b ac/llvm: add disable_aniso_single_level abi
RADV use dri option to enabled this for some apps, but it's
done in nir lower currently. I'm afraid it still needs this
option to handle the non-uniform case as desc is loaded in
llvm.

radeonsi always enable this for bind-textures.

radeonsi will lower all bind-textures to bindless-textures,
and only bind-textures use desc index, so add this abi for
bindless desc index path.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:19 +08:00
Qiang Yu 194add2c23 nir: lower image add lower_to_fragment_mask_load_amd option
Like lower_to_fragment_fetch_amd option in lower tex,
this is for radeonsi to lower MS image ops.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:16 +08:00
Qiang Yu 1461b5f61b nir: add image fragment mask load intrinsic
Like nir_texop_fragment_mask_fetch_amd, this is used to load multi
sample image fmask data for AMD GPU.

We will lower multi sample image load and samples_identical intrinsics
to use it latter for radeonsi. RADV does not need this because it
always expand fmask images before dispatch compute shader.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:11 +08:00
Qiang Yu 88f6ca39a7 radeonsi: replace llvm load_ssbo abi with nir lower
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:08 +08:00
Qiang Yu d57a22d068 ac/llvm: check load_ssbo present before call it
radeonsi will remove it later.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:22:04 +08:00
Qiang Yu 5bc5cae571 radeonsi: add si_nir_lower_resource pass
Replace the load_ubo abi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666>
2022-12-19 09:20:50 +08:00
Friedrich Vock f0f5d5c5e5 radv/rt: Refactor exiting PLOC
The previous approach was susceptible to sync hazards, causing hangs in Doom Eternal.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7897
Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
2022-12-18 21:24:45 +00:00
Friedrich Vock 54ca0665c8 radv/rt: Execute memory barrier before updating the phase end count
We want to be sure that the values were updated before letting other invocations continue.

Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
2022-12-18 21:24:45 +00:00
Friedrich Vock 0e0f42723e radv/rt: PLOC fixes for active_leaf_count
Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
2022-12-18 21:24:45 +00:00
Marek Olšák b0f6de4ea6 util/tools: add the tool that generates perfect hash functions for GLenums
The big comment explains it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák b5c0706d47 mesa: optimize _mesa_bytes_per_vertex_attrib using a hash-based translation
This reduces time spent in gl*Pointer for viewperf.

Generated by find_hash_func.c.

Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák 8e89f07fc8 mesa: compute _PipeFormat and _ElementSize after checking if the format changed
Split _mesa_set_vertex_format into 2 functions and set the derived fields
after we know that the format is different.

This skips _PipeFormat and _ElementSize recomputation every time we get
gl*Pointer with the same format.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák 6a8c1d5043 mesa: move user-specified vertex format fields into gl_vertex_format_user
to be used in the next commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák 13160c0d14 mesa: change gl_vertex_format::Format to bool Bgra to free bits
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák 124d2762db st/mesa: simplify prepare_indexed_draw
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák 8bcdcc8b23 st/mesa: optimize index buffer reference counting in st_indirect_draw_vbo
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák 819627041e mesa: set pipe_draw_info::index::resource directly and remove gl_bo
The motivation is to remove branching from prepare_indexed_draw
and remove the unsafe hack in vbo_save_playback_vertex_list.

There is some duplication that is not identical in all 3 cases.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:23:22 -05:00
Marek Olšák ea11f48a53 st/mesa: fold GLThread.enabled into pin_thread_counter to skip that checking
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:22:45 -05:00
Marek Olšák 23f9f6787a st/mesa: use u_bit_scan64 only for 64-bit CPUs in st_validate_state
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:22:45 -05:00
Yiwei Zhang 47feb2b013 docs: update to latest venus driver support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20310>
2022-12-17 21:34:47 -08:00
Yiwei Zhang 553c0a3067 venus: fix VK_EXT_pci_bus_info support
Natively support it for virtgpu while passthrough renderer support for
vtest. This is a must support to avoid prime blit in common wsi.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20310>
2022-12-17 21:34:47 -08:00
Yiwei Zhang 63cb570ef3 venus: sync protocol fixes and support for VK_EXT_pci_bus_info
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20310>
2022-12-17 21:34:47 -08:00
Marek Vasut 18f4dc6b75 etnaviv: Do expose 2D texture support on pre-halti GPUs
Commit d08bd9a8d8 ("etnaviv: don't expose array and 3D texture support on pre-halti GPUs")
started returning 0 from PIPE_CAP_MAX_TEXTURE_2D_SIZE as well due to switch
case fallthrough. Reinstate the behavior of PIPE_CAP_MAX_TEXTURE_2D_SIZE,
while at the same time, retain the new behavior introduced by commit
d08bd9a8d8 , Otherwise not even kmscube displays the spinning cube,
weston does not display desktop and so on.

Triggered on "Vivante GC600 rev 4653" , i.MX8M Mini .

Fixes: d08bd9a8d8 ("etnaviv: don't expose array and 3D texture support on pre-halti GPUs")
Closes: #7898
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20373>
2022-12-17 22:54:11 +01:00
Alyssa Rosenzweig 486c341769 panfrost: Add architecture description XML for v10
Add the GenXML hardware description for Mali architecture v10, as implemented in
Mali-G610. This is not 100% complete but it should be good enough for parity
with v9.

The XML itself is forked off of v9, with all Job Managerisms replaced with
CSFisms. This notably includes a large number of new structures defining the
instructions that run on the Command Execution Unit (CEU).

This is the first step towards supporting Mali-G610 (i.e. RK3588) upstream. Next
up will be pandecode support.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20360>
2022-12-17 20:33:39 +00:00
Rob Clark a9cdbed5a2 freedreno/drm: Short-circuit kernel for timeout=0 waits
We already know from the userspace fence whether the fence has signaled
or not.  No need to do a syscall if we aren't going to wait.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 90b9b1330d freedreno/drm/virtio: Guest side fence waits
Now that fd_fence and fd_submit_fence are unified, we can wait on the
fence fd rather than needing to poll the host.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 995c64ddcb freedreno/drm/virtio: More tracepoints
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark be6d21ed56 freedreno: Limit cached staging BOs to PIPE_MAP_READ
WC is fine for staging upload buffers, and will let us hit the default
heap.  Probably introducing a separate cached-coherent heap is overkill,
and given that staging uploads are common (but downloads uncommon, out-
side of dEQP/piglit), it is better to just ask for WC.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 4be235af7c freedreno/drm/virtio: Remove prealloc_list
Now that we are allocating cmdstream from the heap, we shouldn't need
this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 4861067689 freedreno/drm: Add sub-allocator
Add a heap that we can use for allocations of small mappable buffers.
This avoids the churn of mmap/unmap, which is especially expensive in
a VM.  It also allows packing more smaller allocations together in a
page, which is useful for PIPE_BUFFERs (which are also mappable).

This avoid jank caused by the overhead of setting up or tearing down
guest mappings when running in a VM.  And also significantly reduces
the # of BOs referenced on a submit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 7d0d82f25f util/vma: Add "nospan"
Add a way to request that allocations do not span a specified PoT
boundary.  This can be used, for ex, to ensure that allocations do
not span 4GB boundaries to work around hw/fw bugs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 793741c936 freedreno/drm: Merge in_fence_fd's
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 137cd3b0fa freedreno/drm: Move no_implicit_sync accounting
No need to duplicate this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 7b02bc6139 freedreno/drm: Drop fd_bo_fence
Remove the last fence-like-struct that isn't fd_fence.  Now that
fences are refcnt'd we can just attach them directly to BOs.  This
will simplify busy-ness tracking for suballoc BOs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 434a8412e8 freedreno/drm: Re-enable submit fence merging
Now that we (a) create the fence ourselves, returning a reference from
fd_submit_flush(), and (b) refcnt the fences, we can now merge submits
with on out-fence by just attaching the same fence to all the submits.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 932ce591ac freedreno/drm: Simplify deferred submit flushing
Once we are sharing an out-fence for multiple deferred/merged submits
the complicated logic in fd_pipe_sp_flush() no longer works (or makes
sense), so just simplify all the paths into a single helper.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 48b5164356 freedreno/drm: Return fence from submit flush
This moves away from embedding the submit fence inside the pipe fence,
which lets us start refcnt'ing the fence.  This will enable several
cleanups and improvements:

1. Get rid of fd_bo_fence, and just have fd_bo hold pending fd_fence
   refs instead, which will be needed for cpu_prep implementation of
   sub-allocated buffers.
2. For merged submits, we can just return a new reference to an
   existing fence.

Note that this temporarily defeats submit-merging, which will be
fixed (and improved) in a following commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 7469574814 freedreno: Rename fd_fence -> fd_pipe_fence
So we don't have namespace clashes in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark c1a621813b freedreno/drm: Combine fd_fence and fd_submit_fence
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 803df07d9e freedreno/drm: Replace shared/nosync fields
These are redundent with the alloc_flags.  A following commit will map
alloc_flags directly to bo heap that should be used, and adding the
FD_BO_SHARED bit when a BO is exported neatly avoids returning it to
the pool to be potentially erroneously reused.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark e6b364f924 freedreno/drm: Reorg BO alloc flags
And drop the unneeded _FD_BO_RING flag.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark fd20df8f09 freedreno/drm: Invert BO destruction
Sub-alloc'd heap BOs will need to do something a bit more special, ie.
not immediately cleanup fences (because those will be needed to know
when the BO is actually idle and vma node can be released), not tear
down the mmap (because the BO doesn't own it), and not close the handle
(also because the BO doesn't own it).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 84f44137ff freedreno/drm: Shuffle around BO init
Suballocated heap BOs will bypass the rest of bo_new() (as they skip the
BO cache, don't get an entry in the handle table, etc).  So move more of
the initialization into fd_bo_init_common().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark db0f273cfb freedreno/drm: Drop pipe ref to device
The context and screen already holds refs to the device.  But since
fd_bo_fence holds a ref to the pipe, anyone anywhere leaking a single
bo with unwaited fences could cause the device to leak indirectly.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark c196e13e1f freedreno/drm: Get rid of fd_bo_del_locked()
This moves the table_lock into a small critical section in the BO delete
path when we are actually removing the entries from the handle/name
tables, so finally table_lock isn't the big-bo-lock!

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark 5136f25667 freedreno/drm: Rework batch BO delete
Get rid of the per-device table of deferred handles, and instead keep
this on the stack so that no additional locking is needed.  This will
simplify getting rid of table_lock in the bo delete path.  For the BO
cache, add fd_bo_del_list_nocache() which works like fd_bo_del_array()
except that it bypasses returning BOs to the cache.  This gets rid of
the BO cache calls to private fd_bo fxns (which is useful now that the
bo_del/close_handles() dance has become a bit more complicated).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00