Commit Graph

184185 Commits

Author SHA1 Message Date
Max R
54c52932d4 virgl: Pass cmd_buf to flush_frontbuffer
Required by gdi virgl winsys.

Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27308>
2024-02-05 08:41:23 +00:00
Max R
15c21eafc2 virgl: Allow importing resources without known templ
On windows when external resources are imported
there is no information about them. And in such cases
resource_from_hanlde templ argument is equal NULL.

To support such case on virgl, virgl winsys can now
fill in template for resource, that will be used if
templ=NULL. Additionally helper functions were
added to convert virgl encoded enums to pipe.

Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27308>
2024-02-05 08:41:23 +00:00
Max R
8b7fa26b39 virgl: Implement PIPE_QUERY_GPU_FINISHED
Implemented using fences, similarly to zink.
Requierd by d3d10umd frontend.

Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27308>
2024-02-05 08:41:23 +00:00
Max R
6427dd9056 virgl: Fix crash when no VE bound
While OpenGL requires that VE must be bound,
other mesa frontends, f.e. d3d10umd, can emit draw
without any VE bound. Which led to vctx->vertex_elements
to be null, which lead to null derefence. Add check
for ve not being null to avoid that.

Supported by virglrenderer@b8ac10db

Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27308>
2024-02-05 08:41:23 +00:00
Max R
468c750c53 virgl: Fix compilation on MSVC
* Cast to uint8_t* before doing pointer arithmetics
* Add zero to initializer list to initialize zeroed structs
* Don't include linux sepcific headers on WIN32
* Don't use build_id when it isn't available

Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27308>
2024-02-05 08:41:22 +00:00
Dave Airlie
47c725b53e radv: don't submit 0 length on UVD either.
The kernel checks for UVD msgs and if there aren't any gets upset,
so don't submit 0 length on UVD rings either to avoid that.

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186>
2024-02-05 08:14:26 +00:00
Dave Airlie
df9bc11589 radv/uvd: uvd kernel checks for full dpb allocation.
The CTS image allocation sometimes doesn't try to allocate a complete
DPB, but the amdgpu kernel module checks for this, so always make
the DPB max sized on uvd instances.

Fixes part of video decode on Fiji/Polaris

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186>
2024-02-05 08:14:26 +00:00
Dave Airlie
bba36df84d radv: init decoder ip block earlier.
This makes the queue decisions later correct.

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186>
2024-02-05 08:14:26 +00:00
Dave Airlie
6065671a7f radv: fix correct padding on uvd
Fixes: 8a29291dbe ("radv/video: add h264 support for uvd")

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186>
2024-02-05 08:14:26 +00:00
Sergi Blanch Torne
3a2e5c1b77 ci: disable Collabora's farm due to maintance
Planned downtime in the farm:
* Start: 2024-02-05 08:00 UTC
* End: 2024-02-05 14:00 UTC

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27359>
2024-02-05 08:11:50 +00:00
Samuel Pitoiset
c6286e39ec radv/sqtt: fix describing queue submits for RGP
The submit_sub_index field is used by RGP to determine the number of
submits. Previously, it was incorrectly reporting the same number of
submits than command buffers.

Fixes: 88cbe32048 ("radv: add support for RGP queue events")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27439>
2024-02-05 07:32:48 +00:00
Gert Wollny
8368a97294 r600: handle indirect access to kcache 14 and 15
r600 can't handle indirect access to kcache 14 and 15, so
if the shader has more than 14 UBOs and there is indirect UBO
access load the values from kcache 14 (and 15) directly and do
a bcsel based on the buffer id to return the right value.

v2: - replace superfluous check with an assert (Triang3l)
    - change the lowering pass to work on load_ubo

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10112

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27372>
2024-02-03 19:27:54 +00:00
Emmanuel Vadot
464e8aaff4 util: Allow kcmp on FreeBSD
FreeBSD now have kcmp(2) syscall, use it.

Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27184>
2024-02-03 17:19:31 +00:00
Sergi Blanch Torne
3a00d80c67 Revert "ci: disable Collabora's farm due to maintance"
This reverts commit fcce9cc835.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27427>
2024-02-03 17:16:30 +01:00
Sergi Blanch Torne
fcce9cc835 ci: disable Collabora's farm due to maintance
Planned downtime in the farm as follows:
* Start: 2024-02-03 13:00 UCT
* End: 2024-02-03 17:00 UTC

Signed-o-f-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27426>
2024-02-03 12:50:48 +00:00
Konstantin Seurer
b10ee44308 radv/rra: Implement ahit/isec counters
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 12:59:47 +01:00
Konstantin Seurer
82a5cc788b docs: Document RADV_RRA_TRACE_HISTORY_SIZE
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 12:59:47 +01:00
Konstantin Seurer
767f628079 radv/rra: Dump basic ray history tokens
This only dumps the begin tokens. Tokens are written to a buffer
containing a 12 byte header at the beginning.

We use an intermediate format for the ray history tokens because the RRA
format is very inefficient.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 12:59:47 +01:00
Konstantin Seurer
26939f016d radv/rra: Refactor error handling
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 11:29:58 +01:00
Konstantin Seurer
46dddb57f9 radv/rra: Remove useless variable
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 11:29:58 +01:00
Konstantin Seurer
dc813288c3 radv/rra: Use memcpy for chunk descriptions
The identifier is not null terminated. "HistoryTokensRaw" does not fit
otherwise.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 11:29:58 +01:00
Konstantin Seurer
71c363acc3 radv/rra: Rename rra_chunk_type to rra_chunk_version
Found by inspecting RRA source.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 11:29:58 +01:00
Yiwei Zhang
d32d010c24 venus: update tracepoints to align with later optimizations
We can remove redundant TPs no longer needed while updating and adding
some trivial ones helpful for next things.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27450>
2024-02-03 00:35:39 +00:00
Eric Engestrom
a81189c796 ci: build nvk in debian-vulkan job
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27442>
2024-02-02 23:36:59 +00:00
Eric Engestrom
2d21a1bf79 nouveau/tests: fix null dereference
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27442>
2024-02-02 23:36:59 +00:00
Gurchetan Singh
0525dac7f8 vk_image.c: #ifndef _WIN32 --> DETECT_OS_LINUX + DETECT_OS_BSD
DRM modifiers are a BSD/Linux phenomenon.

We can also remove a bunch of these checks too.  No Linux specific
symbol or header is **actually** used, and the DRM modifier is
just represented as uint64_t.  But kept the style of the file
as is.

Reviewed-by: Serdar Kocdemir <kocdemir@google.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27425>
2024-02-02 23:11:21 +00:00
Gert Wollny
1fa171650a zink: remove invalid scope in bo allocation loop
The braces resulted in the never demoting the heap type
which resulted in an infinite loop if this become a necessity.

Fixes:  eb394f5316
    zink: redesign the allocation try loop to test all heaps

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27446>
2024-02-02 22:43:02 +00:00
Marek Olšák
e98bbcad17 nir: add vertex divergence into nir_divergence_analysis
This is a prerequisite for the new nir_opt_varyings pass.
It reuses the same divergent field in nir_def and nir_loop.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:52 -05:00
Marek Olšák
5ffa4d879c nir: add a lower_mediump_io callback into options
This will be called by the GLSL linker before nir_opt_varyings.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:51 -05:00
Marek Olšák
ecf0fe09f0 nir: replace lower_io_variables with a GLSL NIR flag
This stops using it in nir_lower_io_passes because all callers call it
only when it's true.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:49 -05:00
Marek Olšák
c4acab77a8 nir: remove and replace underused option pack_varying_options
This will also be used by nir_opt_varyings.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:47 -05:00
Marek Olšák
c844b5dc85 nir: relax validation failure for generic TCS outputs with no_varying
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:45 -05:00
Marek Olšák
d84a616d4d nir: remove INTERP_MODE_COLOR
It's only used by radeonsi and doesn't have to be public.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26918>
2024-02-02 16:45:35 -05:00
Rob Clark
1d5dbde522 freedreno/drm: Fix teardown crash harder
We need to unref the device *after* submit cleanup, so that
fd_submit_sp_destory() can still reference the device.

Fixes: d558cb664a ("freedreno/drm: Submit should hold ref to device")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27445>
2024-02-02 20:28:58 +00:00
Job Noorman
60413e11c2 ir3: optimize subgroup operations using brcst.active
Follow the blob and optimize subgroup operation using brcst.active and
getlast when supported.

The transformation consists of two parts. First, a NIR transform
replaces subgroup operations with a sequence of new brcst_active_ir3
intrinsics followed by a new [type]_clusters_ir3 intrinsic (where type
can be reduce, inclusive_scan, or exclusive_scan).

The brcst_active_ir3 intrinsic is lowered directly to a brcst.active
instruction. The other intrinsics get lowered to a new macro
(OPC_SCAN_CLUSTERS_MACRO) which later gets emitted as a loop (using
getlast/getone) that iterates all clusters and produces the requested
scan result.

OPC_SCAN_CLUSTERS_MACRO has a number of optional arguments. First, since
the exclusive scan result is not a natural by-product of the loop but
has to be calculated explicitly, its destination is optional. This is
necessary since adding it unconditionally will produce unused
instructions that won't be DCE'd anymore at this point. Second, when
performing 32b MUL_U reductions (that expand to multiple instructions),
an extra scratch register is necessary.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6387
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26950>
2024-02-02 19:49:22 +00:00
Job Noorman
6148e38a09 ir3: fix printing of brcst.active and quad_shuffle
Make sure they aren't treated as a texture instructions. For
brcst.active, also print its cluster size.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26950>
2024-02-02 19:49:22 +00:00
Job Noorman
6fa99abac0 ir3: optimize read_first.macro to a mov
Moves to shared registers keep the value written by the lowest active
fiber. This means that read_first.macro can simply be turned into a mov
and doesn't need a getone block.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26950>
2024-02-02 19:49:22 +00:00
Job Noorman
5c41a95e48 ir3: fix setting shared flag on parallel copy arguments
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26950>
2024-02-02 19:49:22 +00:00
Eric Engestrom
5ef744c660 ci: build panvk in debian-vulkan job
With !26116, !24610, and !27437 merged, we can now enable build-testing
of panvk with these extra checks, and prevent bugs like these from
happening again.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27441>
2024-02-02 19:14:29 +00:00
Daniel Schürmann
4fa27845e5 aco/insert_exec_mask: Reduce latency when switching to WQM.
Change pattern:
s_mov_b64 s[0:1], exec         s_mov_b64 s[0:1], exec
s_wqm_b64 exec, s[0:1]   ->    s_wqm_b64 exec, exec

Totals from 16667 (21.03% of 79242) affected shaders: (GFX11)

Instrs: 11317502 -> 11307484 (-0.09%); split: -0.09%, +0.00%
CodeSize: 60194272 -> 60155088 (-0.07%); split: -0.07%, +0.00%
Latency: 94345873 -> 94338374 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 13568872 -> 13568683 (-0.00%); split: -0.00%, +0.00%
Copies: 808334 -> 808332 (-0.00%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27112>
2024-02-02 18:55:15 +00:00
Daniel Schürmann
e89977ff71 aco: always terminate quads if they have been demoted entirely
Previously, quads got only terminated in top-level control flow.
This patch makes the behavior consistent.

Totals from 7811 (9.86% of 79242) affected shaders: (GFX11)

Instrs: 7859667 -> 7850757 (-0.11%); split: -0.18%, +0.07%
CodeSize: 41642280 -> 41611836 (-0.07%); split: -0.13%, +0.06%
Latency: 73692815 -> 73707588 (+0.02%); split: -0.02%, +0.04%
InvThroughput: 10672160 -> 10672323 (+0.00%); split: -0.01%, +0.01%
VClause: 137478 -> 137469 (-0.01%); split: -0.02%, +0.02%
SClause: 314905 -> 314924 (+0.01%); split: -0.19%, +0.20%
Copies: 587014 -> 576039 (-1.87%); split: -2.10%, +0.23%
Branches: 213101 -> 213123 (+0.01%); split: -0.01%, +0.02%
PreSGPRs: 313588 -> 313355 (-0.07%); split: -0.09%, +0.01%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27112>
2024-02-02 18:55:15 +00:00
Daniel Schürmann
a42b83e3fb aco/insert_exec_mask: tiny refactor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27112>
2024-02-02 18:55:15 +00:00
Tapani Pälli
5bea69cdd6 intel/blorp: add a TODO note about stencil buffer resolve
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27355>
2024-02-02 18:28:39 +00:00
Samuel Pitoiset
9698d5f0fd radv: add a workaround for mipmaps and minLOD on GFX6-8
This is spurious and it looks like we should be able to uses non-zero
base level everytime on GFX6-8 but it doesn't always work.

This fixes the remaining CTS failures on GFX6-8.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26290>
2024-02-02 18:06:25 +00:00
Connor Abbott
dc1a3f9555 ir3: Fix comment thinko
Noticed when working on another commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:35 +00:00
Connor Abbott
c40bc48252 ir3: Calculate physical edges correctly
A block can have more than one extra physical successor, a fact that I
missed initially. Now that we've fixed up RA to handle it, we can
finally handle this correctly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:35 +00:00
Connor Abbott
9dbe511f18 ir3: Rewrite (jp) and branchstack handling
This pass will later also serve as a way to accurately insert physical
edges, which is the original motivation. However it also lets us put
branchstack handling on a more solid footing.

There was an off-by-one in the old branchstack handling because it
didn't consider that a single if-else actually has two reconvergence
points active at the same time, so it undercounted the branchstack by 1
for pretty much every shader. We change the HW formula to produce the
same result, which now makes it much more sensible.

We can also delete the physical predecessor handling in ir3_legalize,
because it was only needed to handle (jp) which is now handled earlier.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:35 +00:00
Connor Abbott
6ad0cbafe8 ir3: Set branchstack earlier
We were relying on it in RA to tell us whether we could give more
registers to the shader mostly "for free" (because occupancy is bounded
by the branchstack), but it turns out it was actually 0 so we weren't
taking advantage of it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:35 +00:00
Connor Abbott
fa22b0901a ir3/ra: Add specialized shared register RA/spilling
There are two problems with shared register allocation at the moment:

1. We weren't modelling physical edges correctly, and once we do, the
   current hack in RA for handling them won't work correctly. This means
   live-range splitting doesn't work. I've tried various strategies but
   none of them seems to fix this.
2. Spilling of shared registers to non-shared registers isn't
   implemented.

Spilling of shared regs is significantly simpler than spilling
non-shared regs, because (1) spilling and unspilling is significantly
cheaper, just a single mov, and (2) we can swap "stack slots" (actually
non-shared regs) so all the complexity of parallel copy handling isn't
necessary. This means that it's much easier to integrate RA and
spilling, while still using the tree-scan framework, so that we can
spill instead of splitting live ranges. The other issue, of phi nodes
with physical edges, we can handle by spilling those phis earlier. For
this to work, we need to accurately insert physical edges based on
divergence analysis or else every phi node would involve physical edges,
which later commits will accomplish.

This commit adds a shared register allocation pass which is a
severely-cut-down version of RA and spilling. Everything to do with live
range splitting is cut from RA, and everything to do with parallel copy
handling and for spilling we simply always spill as long as soon as we
encounter a case where it's necessary. This could be improved,
especially the spilling strategy, but for now it keeps the pass simple
and cuts down on code duplication. Unfortunately there's still some
shared boilerplate with regular RA which seems unavoidable however.

The new RA requires us to redo liveness information, which is
significantly expensive, so we keep the ability of the old RA to handle
shared registers and only use the new RA when it may be required: either
something potentially requiring live-range splitting, or a too-high
shared register limit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22072>
2024-02-02 17:39:34 +00:00
Samuel Pitoiset
f977501a7c radv: do not allow to enable VK_EXT_shader_object with LLVM
This isn't expected to work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27415>
2024-02-02 17:14:56 +00:00