Commit graph

210747 commits

Author SHA1 Message Date
Samuel Pitoiset
ea6cb5e7bf radv: add a new dirty bit for the FSR state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:35 +00:00
Samuel Pitoiset
604296a282 radv: add a new dirty bit for the ngg culling state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:34 +00:00
Samuel Pitoiset
d9d9052c56 radv: validate dynamic states for the db shader control state earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:34 +00:00
Samuel Pitoiset
02ecb70e7f radv: validate dynamic states for the occlusion query state earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:33 +00:00
Samuel Pitoiset
81af123ab1 radv: optimize re-emitting the occlusion query state on GFX12
The number of samples is only needed on older generations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:33 +00:00
Samuel Pitoiset
5db8a16053 radv: add a new dirty bit for the binning state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:32 +00:00
Samuel Pitoiset
c4c44187f9 radv: only re-emit needed states when PS inner coverage changes
It's emitted as part of the MSAA state but re-emitting the NGG culling
state isn't necessary because ps.reads_fully_covered isn't used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:32 +00:00
Samuel Pitoiset
fae90ba171 radv: do not emit few RADV_CMD_DIRTY_xxx based on dynamic states
Like RADV_CMD_DIRTY_CB_RENDER_STATE is dirty when the custom blend mode
is updated. Shouldn't fix anything in practice because dynamic_states
is unlikely 0 but better that way.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:31 +00:00
Zan Dobersek
1f61867b48 tu: prevent tu_bo unmapping during destruction while being dumped
A tu_bo object can be in the process of being dumped during queue submit
while also being destroyed on a separate thread. During destruction, tu_bo
should be removed from the device's dump_bo_list before unmapping, this
way the mapping of any given tu_bo won't disappear while it's being dumped.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Reviewed-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36904>
2025-08-21 18:16:59 +00:00
Martin Roukala (né Peres)
d1839f09b1 ci: disable the valve-kws farm
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
There will be a ~30 minutes downtime today, while we plug new hardware
to our CI gateway in preparation for plugging more a750 DUTs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36902>
2025-08-21 18:15:05 +00:00
Caio Oliveira
74a4e7dd4b brw: Fix folding case for MAD instruction with all immediates
Fixes: b605f76b2a ("brw/algebraic: Constant fold multiplicands of MAD")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36867>
2025-08-21 17:19:18 +00:00
Caio Oliveira
eec64c865f brw: Add disabled test for MAD constant folding
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36867>
2025-08-21 17:19:18 +00:00
Gert Wollny
c903f33b36 r600/sfn: preloading sources for fp64 ops with common code path
These ops require more than three source values that could result
in readport conflicts, so check the readport configuration
before issuing alu operations and inject copy operations
when conflicts are identified.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36860>
2025-08-21 17:05:04 +00:00
Gert Wollny
a1b7b524f8 r600/sfn: factor out common code for readport validation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36860>
2025-08-21 17:05:04 +00:00
Gert Wollny
c4a3e8981d r600/sfn: rework testing readport config for more than one source
When checking the readport config for a number of sources that
would be used in a multi-slot instruction, then return the index
of the source for which readport allocation fails.
With that we can later add a mov instruction to change the source
channels configuration.

In addition pass a std::array instead of a C-array to make the interface
more c++-like and prepare for the next patch.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36860>
2025-08-21 17:05:04 +00:00
Gert Wollny
4c94467e5f r600/sfn: add an unreachable if the creation of a fp64 group fails
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36860>
2025-08-21 17:05:04 +00:00
Gert Wollny
ff6802687a r600/sfn: remove some useless boolean parameters
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36860>
2025-08-21 17:05:04 +00:00
Gert Wollny
273d50fb84 r600/sfn: stop early when looking for ALU vec ready ops
No need to continue the loop if we already know that we will skip

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36860>
2025-08-21 17:05:04 +00:00
Gert Wollny
36c3eb5bce R600/sfn: split one-dest multi-slot ops late when scheduling
This makes it possible to switch the dest channel late and
schedule more than one of these ops into a group.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36860>
2025-08-21 17:05:04 +00:00
Gert Wollny
ebe5765d0a r600/sfn: pass group into AluInstr::split instead of creating it
This is in preparation of splitting multi-slot ops late, when scheduling.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36860>
2025-08-21 17:05:03 +00:00
Connor Abbott
2797069e9a tu: Enable LRZ with FDM
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36475>
2025-08-21 16:42:19 +00:00
Connor Abbott
b34b089ca1 tu: Use GRAS bin offset registers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36475>
2025-08-21 16:42:19 +00:00
Connor Abbott
10e7f63734 tu: Add documentation for VK_EXT_fragment_density_map
This has gotten complicated enough that we need somewhere outside of the
driver itself to give an overall flow of how the feature is implemented.

This includes a few things that are enabled in the subsequent commits,
specifically the LRZ parts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36475>
2025-08-21 16:42:18 +00:00
Connor Abbott
cf7a52d2a6 freedreno: Add HW bin scaling feature
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36475>
2025-08-21 16:42:18 +00:00
Connor Abbott
09a80e04d6 freedreno: Document GRAS_SC_BIN_CNTL::FORCE_LRZ_DIS
This will be necessary for disabling LRZ in cases we can't handle it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36475>
2025-08-21 16:42:17 +00:00
Connor Abbott
bfb6d09e95 freedreno: Add bin scaling registers
These let us avoid manually patching the viewport as we had to do on
a6xx. However they do not affect blits, so we still have to manually
scale there. They exist from a740.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36475>
2025-08-21 16:42:17 +00:00
Lionel Landwerlin
1bab95551a anv: fix uninitialized return value
We don't go through the loop when there are no queues.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 884df891d7 ("anv: allow device creation with no queue")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36910>
2025-08-21 16:07:56 +00:00
Samuel Pitoiset
d40e841cc4 radv: dirty some states from graphics pipeline earlier
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This might actually fixes a couple of things because needed dynamic
states are computed before radv_emit_graphics_pipeline(), so dirtying
them too late doesn't make much sense.

This doesn't fix anything known.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36900>
2025-08-21 15:45:48 +00:00
David Rosca
a67a66508e subprojects: Remove libdisplay-info wrap file
When building as subproject, this will include libdisplay-info tests
when running `meson test` and they incorrectly detect edid-decode
binary being available causing the tests to fail. There are also
issues with 32bit build.
Updating to latest libdisplay-info doesn't seem like a good solution
as that pulls in additional build dependencies.

Since this is an optional dependency, drop the wrap file.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13657
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36897>
2025-08-21 14:42:07 +00:00
Yiwei Zhang
f0c52fee25 venus: misc sync2 emulation fixes
Venus renderer side has strict entry points sanitization based on the
app requested app api version + physical device api version. So on the
driver, we should follow the same for legacy client apps.

Meanwhile, VK_PIPELINE_STAGE_NONE can't be used when we hit the sync2
emulation path, so we swap it with VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT
placeholder for the 2nd sync scope there.

Fixes: 07cee75c39 ("venus: layer vkQueueSubmit2 over vkQueueSubmit w/o sync2")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36830>
2025-08-21 14:25:22 +00:00
Eric Engestrom
8ee7b41841 meson: fixup b_sanitize checks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36905>
2025-08-21 14:54:19 +02:00
Juan A. Suarez Romero
ca989ecdec glsl: disable UBSan vptr check for ir_instruction
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With UBSan enabled, we get the following issue:

```
../src/compiler/glsl/ir.h:116:4: runtime error: member access within address 0x555637c62c10 which does not point to an object of type 'ir_instruction'
0x555637c62c10: note: object has invalid vptr
 5f 76 61 6c  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
```

This only happens the first time a ir_variable (which derives from
ir_instruction) is created; next calls don't show the issue any more.

The problem is with the following call in the `new()` operator:

```
((ir_instruction*)((uintptr_t)p))->node_linalloc = ctx;
```

In this case, the ir_instruction structure is not fully constructed and
thus UBSan complains about it. In the next calls, as the structure is
now fully constructed it doesn't complain any more.

The right approach would be fully creating the structure, and afterwards
doing the context assignment. But this would require quite a lot of
changes, passing the context through the constructors to assign it.

A simpler solution is just disabling this check for this case, as we
know what is happening.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36884>
2025-08-21 12:09:04 +00:00
Juan A. Suarez Romero
fa25e2de48 util: add DECLARE_LINEAR_ZALLOC with no sanitize
This specific macro allow to create a new() operator version with a
sanitizer flag disabled.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36884>
2025-08-21 12:09:04 +00:00
Juan A. Suarez Romero
1c2aa6f5c3 meson: check for no_sanitize function attributes
Meson doesn't support for checking no_sanitize attributes, so we do it
manually through testing.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36884>
2025-08-21 12:09:04 +00:00
Georg Lehmann
e24db36f20 nir/uub: handle bit_count
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36874>
2025-08-21 10:36:09 +00:00
Georg Lehmann
aff391bc77 nir/uub: handle more reduction ops
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36874>
2025-08-21 10:36:09 +00:00
Georg Lehmann
773ee60e48 nir/uub: decrease default max subgroup size to 128
128 is the maximum all apis allow.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36874>
2025-08-21 10:36:09 +00:00
Georg Lehmann
a2e48d2ede nir/uub: fix exclusive scans
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36874>
2025-08-21 10:36:09 +00:00
Calder Young
c7e48f79b7 brw,anv: Reduce UBO robustness size alignment to 16 bytes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Instead of being encoded as a contiguous 64-bit mask of individual registers,
the robustness information is now encoded as a vector of up to 4 bytes that
represent the limits of each of the pushed UBO ranges in 16 byte units.
Some buggy Direct3D workloads are known to depend on a robustness alignment
as low as 16 bytes to work properly.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36455>
2025-08-21 09:04:55 +00:00
Calder Young
a3ecdf33a3 nir/builder: Add helper for building uvec8 immediates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36455>
2025-08-21 09:04:54 +00:00
Lionel Landwerlin
2281e88381 brw: make assign_curb_setup visible in optimizer debug
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36455>
2025-08-21 09:04:54 +00:00
Lionel Landwerlin
df37c7ca74 brw: fix analysis dirtying with pulled constants
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 5c17299084 ("brw: enable A64 pulling of push constants")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36455>
2025-08-21 09:04:53 +00:00
Erik Faye-Lund
e098bf399a pan/va: check branch_offset for overflow
The branch offset needs to fit in 8 bits, and with the shr(3) modifier,
this means the max legal value is 2040. Let's verify that while packing.

CID: 1503283
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
2025-08-21 08:45:33 +00:00
Erik Faye-Lund
f80506277d pan/midgard: fix check for negative texture offset
We need to sign-extend texture-offset before checking for negative
values, otherwise we'll never see them.

CID: 1457497
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
2025-08-21 08:45:33 +00:00
Erik Faye-Lund
49183bfb79 pan/bi: use os_read_file-helper
We already have a more robust helper for this, so let's use it rather
than open-coding the same.

While we're at it, return early on error for readability here. There's
no need to continue the logic in those cases.

CID: 1444074
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
2025-08-21 08:45:33 +00:00
Erik Faye-Lund
046710ce95 pan/clc: handle seek-error
lseek can return a negative value on error here. While it's not likely
to happen, let's add some error-checking here to prevent bad behavior if
we're unlucky.

CID: 1648299
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
2025-08-21 08:45:33 +00:00
Erik Faye-Lund
f886e08f36 pan/decode: detect error on fseek
We do this for other calls to fseek here, so let's be consistent.

CID: 1659325
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
2025-08-21 08:45:33 +00:00
Erik Faye-Lund
bf3605a189 pan/midgard: initialize last_next_tag to TAG_BREAK
If the shader contains zero words, we would try to use -1 as an index
into an array at the end of this function, which would be bad. But
shaders without any words are, uh, no point in disassembling in the
first place, so this seems like a theoretical bug in the first place.

However, since the only thing we *really* care about last_next_tag is if
is TAG_BREAK or not, let's initialize it to TAG_BREAK instead. This
means we'll avoid a bogus print at the end here, even if we ended up
calling this on an empty shader.

CID: 1458835
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
2025-08-21 08:45:33 +00:00
Erik Faye-Lund
979382ffaa pan/midgard: r1w should be set
r1.w should be written, so let's add an assert here instead of making
lcra_add_node_interference() overrun a buffer here.

CID: 1510007
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
2025-08-21 08:45:32 +00:00
Erik Faye-Lund
22ebe3e9e8 pan/bi: use ralloc
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36724>
2025-08-21 08:45:32 +00:00