Commit graph

216386 commits

Author SHA1 Message Date
Micah Shennum
240d128888 Merge branch 'fix_32bit_math' into 'main'
util: Don't force 64-bit division on 32-bit platforms

See merge request mesa/mesa!39001
2025-12-19 18:49:05 -06:00
Rob Clark
c430f394c5 freedreno/a6xx: Move assert
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The flags_regid is only present if gs is present (in which case, gs is
the last_shader).  If there is no gs, flags_regid is initialized to
zero, not INVALID_REG (r63.x).  But you have to scroll up several pages
of a long fxn to see that.

Move the assert to make things more clear.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:14 +00:00
Rob Clark
fdf90697e6 tu: Drop FD_NO_DEPRECATED_PACK
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:13 +00:00
Rob Clark
f306e119c8 tu: Convert rest of tu_pipeline deprecated reg builders
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:13 +00:00
Rob Clark
5e3f36fbb6 tu: Rework emit_vpc()
Drop the reg_config table trickery, which doesn't play nicely with
register changes across generations.  (Note, some of the registers,
like PC_HS_CNTL, are not in fact the same as other shader stages.)

While at it, convert to crb to simplify copying code from the gallium
driver.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:13 +00:00
Rob Clark
b91a614baf tu: Rework emit_xs_config()
Rework it to take all active/enabled shader stages in one shot, to
simplify things and drop the xs_configs table.

This lets us use the variant reg packers directly to better deal with
register changes across generations.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:13 +00:00
Rob Clark
dd489e2615 tu: Convert tu_shader deprecated reg builders
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:11 +00:00
Rob Clark
15a839f90c tu: Convert tu_cmd_buffer deprecated reg builders
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:11 +00:00
Rob Clark
4e20cfd797 tu: Convert tu_clear_bit deprecated reg builders
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:11 +00:00
Rob Clark
76cd06426d tu: Rework pipeline stat queries
Drop the legacy register offset macros.  And re-work how we map the vk
query to pipeline stat offset, to account for re-ordering of the
pipeline stat regs in gen8.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:10 +00:00
Rob Clark
d9f1f0e9b9 tu: Drop use of legacy reg offset macros
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:10 +00:00
Rob Clark
7ce63372bd tu: Drop tu_cs_image_*_ref
These were only used in one place.  Drop them and convert to using the
new register packers for improved cross-gen portability.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:09 +00:00
Rob Clark
31d757495e freedreno/registers: Reintroduce FD_NO_DEPRECATED_PACK
The non-variant reg packers were removed in commit fd6489c026 ("tu:
Drop emitting of deprecated packing."), along with
FD_NO_DEPRECATED_PACK.

Add support to mark the even older reg builders as deprecated, and
re-introduce FD_NO_DEPRECATED_PACK to control this.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:08 +00:00
Rob Clark
2f3d6119fc freedreno/registers: Move 'unknown' last
If the builder is passed just a raw value, like an iova in the case of
turnip, we probably don't want to assert that it is all unknown bits.

This hasn't been a problem for the gallium driver, as the bo pointer is
first.  But became a problem for turnip with commit 2d6c15ad57 ("tu:
remove magic bo reg packing (use iovas directly)").

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:07 +00:00
Rob Clark
6326ac4350 freedreno/a6xx: Drop legacy CP_EVENT_WRITE builders
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:06 +00:00
Rob Clark
32be52a457 freedreno/registers: Mark LOAD_IMMED as a5xx
This is replaced by CP_SET_LOAD_IMMEDIATE on later gens.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:06 +00:00
Rob Clark
af38b71e5b freedreno/a6xx: Set FD_BO_NO_HARDPIN from meson
Rather than setting it in each file, we can just set it globally for all
c++ files.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39029>
2025-12-20 00:23:06 +00:00
Job Noorman
2ed37033a0 ir3/legalize: fix (eq) scheduling for sam.s2en
sam.s2en uses the first src for its samp/tex while the coordinates (for
which derivatives need to be calculated) are in the second src. We used
to unconditionally track needed helpers for the first src causing (eq)
to potentially get scheduled too early for sam.s2en. Fix this by using
the second src for sam.s2en.

Fixes frame instability in Metro Exodus.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 29f8277952 ("ir3/legalize: schedule (eq) more accurately")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38992>
2025-12-19 23:49:55 +00:00
Eric Engestrom
3584bac0b2 nil: cleanup derelict allow(dead_code) annotations
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:14:46 +01:00
Eric Engestrom
6b9524f864 nak: cleanup derelict allow(dead_code) annotations
As well as one `allow(non_camel_case_types)`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:14:46 +01:00
Eric Engestrom
e2e36f352f rusticl: cleanup derelict allow(non_upper_case_globals) annotation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:14:46 +01:00
Eric Engestrom
96a48ee8db rusticl: drop collapsible_else_if annotation now that it's allowed globally
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:14:46 +01:00
Eric Engestrom
2202c2d62a util/rust: cleanup derelict allow(dead_code) annotations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:14:46 +01:00
Eric Engestrom
eef174b56b nak: use std::mem::size_of_val(data) instead of open-coding it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:20 +01:00
Eric Engestrom
de7d3cdbda nak: drop "unneeded return statement"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
41ce1939f9 nak: replace .find(x).is_some() with .contains(x)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
c52fa1ac14 nak: merge identical if branches for blackwell, ampere and ada
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
9cfb4b1fdb nak: replace .get(0) with .first()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
124fe82762 nak: drop "deref on an immutable reference"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
4fbda98cf4 nak: drop "reference which is immediately dereferenced by the compiler"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
daeed4a946 nak: allow LdCacheOp values to be named Cache*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
9454006956 nak: drop cast of u8 to u8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
ddc26666da nak: drop clone of Copy-able types (RegOrigin & SSAValue)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
340c355714 nak: use saturating_sub() instead of open-coding it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
f4c832ac15 nak: drop "reference which is immediately dereferenced by the compiler"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
5ebe62ebed rusticl: silence incorrect clippy error about re-implementing memcpy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
74aa12e5ab compiler/rust: drop "borrow of a value the compiler would automatically borrow"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
91e60e210a compiler/rust: allow CFG & BitSetStreamTrait to have a len() without also having an is_empty()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
e825eac272 compiler/rust: remove unnecessary lifetimes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
cb57b77239 compiler/rust: rewrite match into a simpler if let
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
1def70585b compiler/rust: replace !first.is_none() with first.is_some()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
49b2597854 nak: replace !foo.is_{none,some}() with their positive counterpart
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
ca319ba707 nak: drop unnecessary mutable reference
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
97a7592557 nak: drop redundant closure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
8a35fc9500 nak: remove unused lifetime
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
23ae567ae6 nak: add all identical values in one step
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
ce04b8a578 nak: use foo &= bar instead of foo = foo & bar
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
6d881284c3 nak: use assert_eq!(a, b) instead of assert!(a == b)
Tells you what's different when it fails.

Suggested-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Mel Henning
f48fcfe552 nak: impl fmt::Debug for SSAValue
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
9f830f622f nak: drop unnecessary reference on both sides of ==
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00