Commit graph

205599 commits

Author SHA1 Message Date
Shih, Jude
7b68174bf0 amd/vpelib: Alpha Fill add mode
Add destination and source stream mode

[WHY]
In the new version, we add the two alpha fill mode

[HOW]
Add the two enum first

Reviewed-by: Brendan Steve Leder <BrendanSteve.Leder@amd.com>
Reviewed-by: Tomson Chang <Tomson.Chang@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Jude Shih <shenshih@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Shih, Jude
cb0b8d58a0 amd/vpelib: remove sensitive keywords
[WHY]
    The KWS hit the words in the vpelib as forbidden

[HOW]
    replace it with proper ones

Reviewed-by: Tomson Chang <Tomson.Chang@amd.com>
Reviewed-by: Tiberiu Visan <Tiberiu.Visan@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Jude Shih <shenshih@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Shih, Jude
c40ac921aa amd/vpelib: VPE descriptor added
[WHY]
- Need to implement code for new version
- There are some format changes in new version

[HOW]
- Add plane descriptor
- Add plane descriptor patch
- Add command builder
- Restructure the code base to apply for multiple version

Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Reviewed-by: Tomson Chang <Tomson.Chang@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Jude Shih <shenshih@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Agate, Jesse
f80a69d756 amd/vpelib: Add macro to perform ceil division
Add macro to perform ceil division

Reviewed-by: Brendan Steve Leder <BrendanSteve.Leder@amd.com>
Reviewed-by: Navid Assadian <Navid.Assadian@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Agate, Jesse <Jesse.Agate@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Zhao, Jiali
7b8c912c22 amd/vpelib: G2084 STUDIO output gamma fix
Made output gamma a hook function

Reviewed-by: Jesse Agate <Jesse.Agate@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Zhao, Jiali <Jiali.Zhao@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Kovac, Krunoslav
fc5973429f amd/vpelib: Update comment and fix some code alignment issues.
Update comment and fix some code alignment issues.

Reviewed-by: Tomson Chang <Tomson.Chang@amd.com>
Reviewed-by: Evan Damphousse <Evan.Damphousse@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Visan, Tiberiu
96b7e52b57 amd/vpelib: feature augment
[WHY]
support future feature augment

Co-authored-by: Chan, Roy <Roy.Chan@amd.com>
Reviewed-by: Navid Assadian <Navid.Assadian@amd.com>
Reviewed-by: Jesse Agate <Jesse.Agate@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Visan, Tiberiu <Tiberiu.Visan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Krunoslav Kovac
f6144116c9 amd/vpelib: Remove RGBE_ALPHA
No such DXGI_FORMAT, nor is there space to squeeze in alpha.

Reviewed-by: Navid Assadian <Navid.Assadian@amd.com>
Reviewed-by: Jesse Agate <Jesse.Agate@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Chen, Phoebe
f2e65c02e6 amd/vpelib: Fix memory leak from segment ctx
[WHY]
There is potential memory leak from vpe_alloc_segment_ctx.
This memory leak occurs only in multi-frame VPE tests where
between vpe_create and vpe_destroy, multiple calls are made
to vpe_check_support that allocates new segment context without
releasing the old one.

[HOW]
Allocate segment_ctx only when it is not already allocated. If it is
already allocated, check whether re-allocation is needed. If not, skip
the allocation.

Signed-off-by: Phoebe Chen <phoebe.chen@amd.com>
Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Reviewed-by: Jesse Agate <Jesse.Agate@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Leder, Brendan Steve
c1a3d021f3 amd/vpelib: Make BG gen stream idx adjustable
Update BKGR API

Change bg generation code so bg gen isn't hard-coded to stream 0, as
certain cases result in bg being generated at different stream.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Reviewed-by: Evan Damphousse <Evan.Damphousse@amd.com>
Acked-by: ChuanYu Tseng <ChuanYu.Tseng@amd.com>
Signed-off-by: Leder, Brendan Steve <BrendanSteve.Leder@amd.co>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35012>
2025-05-16 11:33:08 +08:00
Faith Ekstrand
5b34895e81 nak/dce: Use BitSet for live phis and SSA values
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:28:31 -04:00
Faith Ekstrand
52dcb1c9c1 nak: Add a Phi struct type
Instead of passing raw u32's arround, this adds a new Phi wrapper struct
which is treated as opaque by most of the rest of the compiler.  This is
similar to what we're already doing with Label and SSAValue.  This also
gives us the opportunity to properly document NAK's phi model.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:28:31 -04:00
Faith Ekstrand
531070cf91 nak: Use op instead of phi when referring to OpPhiSrcs or OpPhiDsts
This will reduce name conflicts in the next patch

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:28:31 -04:00
Faith Ekstrand
5f5ce00410 nak/repair_ssa: Rename Phi to PhiTracker
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:28:31 -04:00
Faith Ekstrand
fc54e6e1d2 nak/liveness: Use typed bitsets
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:28:31 -04:00
Faith Ekstrand
afb11a5a9e nak/liveness: Use an SSA value as the last_use HashMap key
We're not saving ourselves anything by using just the index.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:28:31 -04:00
Faith Ekstrand
56f06a072c compiler/rust/bitset: Make BitSet a generic container type
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:28:31 -04:00
Faith Ekstrand
323769d3bb compiler/rust,nak: Rename BitSet::get() to contains()
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:14:12 -04:00
Faith Ekstrand
20d247d754 nak: Use Default::default() for BitSet constructors
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
2025-05-15 22:14:12 -04:00
Mel Henning
ed658a2d3a compiler/rust/cfg: Add a hash func type parameter
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
and switch nak over to rustc-hash for CFGBuilder

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34865>
2025-05-16 01:40:05 +00:00
Mel Henning
f5231e0677 nak: Also use rustc-hash for UnionFind
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34865>
2025-05-16 01:40:04 +00:00
Mel Henning
43c3f5a8db nak: Switch most Hash{Set,Map} uses to rustc-hash
We shouldn't need to worry about HashDoS attacks because:
 1. All of these keys are compiler-assigned IDs which makes it very
    difficult to force collitions, and
 2. Anyone who can hit the NAK compiler backend can already use CPU
    power by spamming shader compiles or using O(n^2) behavior in
    shader opt loops
As a result, we can afford to use a weaker hash function without
randomization.

This decreases total compile times by around 12% on shaderdb
(from 8113.74 user to 7115.47 user) on my machine.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34865>
2025-05-16 01:40:04 +00:00
Mel Henning
c1f979d84a nak: Add a dependency on rustc-hash
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34865>
2025-05-16 01:40:04 +00:00
Mel Henning
b4b557c9ef nak: s/HashSet::new()/Default::default()/
wherever this doesn't result in type inference failing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34865>
2025-05-16 01:40:04 +00:00
Mel Henning
7a47f29d6d nak: s/HashMap::new()/Default::default()/
wherever this doesn't result in type inference failing.
Using default() makes it easier to swap out the underlying type.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34865>
2025-05-16 01:40:04 +00:00
Mel Henning
bb62044836 nak: rustfmt ir_proc.rs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34865>
2025-05-16 01:40:04 +00:00
Mel Henning
bfe8340296 nouveau/headers: Ignore PermissionError in rustfmt
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13172
Fixes: 591b5da4 ("nouveau/headers: Run rustfmt on generated files")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35008>
2025-05-16 01:08:07 +00:00
Mel Henning
da22094593 nouveau/headers: Run rustfmt after file is closed
If we run a subprocess while the file is still open, we may not have
flushed the file contents to disk.

Fixes: 591b5da4 ("nouveau/headers: Run rustfmt on generated files")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35008>
2025-05-16 01:08:07 +00:00
Kenneth Graunke
20222cd956 anv: Use the new nir_opt_acquire_release_barriers pass
Improves performance of Phasmophobia with the "Eye Adaptation" video
setting enabled on Arc B570 by about 9.5%.

fossil-db results on Battlemage:

   Totals:
   Instrs: 148797922 -> 148797865 (-0.00%)
   Send messages: 7066341 -> 7066317 (-0.00%)
   Cycle count: 21459978352 -> 21459975048 (-0.00%)

   Totals from 8 (0.00% of 574410) affected shaders:
   Instrs: 4633 -> 4576 (-1.23%)
   Send messages: 479 -> 455 (-5.01%)
   Cycle count: 611886 -> 608582 (-0.54%)

Observed to cut 15% of sends in a Phasmophobia shader, 8.3% in a Far Cry
New Dawn shader, 7% in a Borderlands 3 DX11 shader, and 3.4-3.7% of
sends in a few Witcher 3 and Dark Souls 3 shaders.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33504>
2025-05-16 00:29:13 +00:00
Kenneth Graunke
deb1d47155 nir: Add a new optimization for acquire/release atomics & barriers
Some shaders contain back-to-back atomic accesses in SPIR-V with
AcquireRelease semantics.  In NIR, we translate these to a release
memory barrier, the atomic, then an acquire memory barrier.

This results in a lot of unnecessary memory barriers in the middle
of the sequence of atomics:

   0. Release barrier
   1. Atomic
   2. Acquire barrier
   3. Release barrier
   4. Atomic
   5. Acquire barrier
   6. Release barrier
   7. Atomic
   8. Acquire barrier

In the absence of loads/stores, and when the atomic destinations are
unused, these barriers in-between atomics shouldn't be required.

This optimization pass would drop them (lines 2-3 and 5-6 above) while
leaving the first and last barriers (0 and 8), so the sequence remains
synchronized against other access elsewhere in the program.

One common example where this occurs is a sequence of min and max
atomics to clamp a certain memory location's value within a range.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33504>
2025-05-16 00:29:13 +00:00
Rob Clark
65e18a8494 freedreno: Fix shader-clock when kernel exposes UCHE_TRAP_BASE
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: 4b1b4ee10c ("freedreno,tu: Read and pass to compiler uche_trap_base)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35010>
2025-05-15 22:27:17 +00:00
Yinjie Yao
089e2cb6f9 radeonsi: Disable av1 cdef_channel_strength for VCN4
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
VCN4 hardware doesn't support this feature, it can only be supported in VCN5.

Signed-off-by: Yinjie Yao <yinjie.yao@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35004>
2025-05-15 18:52:08 +00:00
Seán de Búrca
10fad5081d nouveau: implement Default for Push
By convention, a struct with a `new()` method which has no parameters
should have a `Default` impl which calls `new()`.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
f4f4b25d25 nak,nil: style cleanup
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
adecea4af9 nak,nouveau: adjust function/method signatures to better match convention
v2: restore `to_cssa()` naming

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
e559c63fd8 nak,nil: elide lifetimes where possible
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
e4f045df58 nak,nil: avoid explicit returns at the end of functions
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
e32c82d0f5 nak: use standard methods and macros to improve readability
v2: Leave `Op::is_branch()` and `Op::no_scoreboard()` matches alone
v3: Revert additional changes with unclear readability

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
ba2b9345e8 nak: use Option propagation instead of explicit let-else clauses
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
f2cc77dca8 nak: collapse extraneous conditional branches
v2: Revert collapsing of branches per review

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
451b37820d nak: remove unnecessary casts and conversions
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
2025-05-15 17:52:32 +00:00
Seán de Búrca
e4d895f0e1 rusticl: fix build with clippy driver
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35002>
2025-05-15 09:35:17 -07:00
Seán de Búrca
35af55a2a7 rusticl: replace map_or(false, f) with is_some_and(f)
A new clippy lint fails on this pattern, causing build errors on
versions >= 1.84.0. `is_some_and()` is stable from 1.70.0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35002>
2025-05-15 09:35:08 -07:00
José Roberto de Souza
cb6f96a1e8 anv: Remove a '#if GFX_VER >= 30' block inside of a else of '#if GFX_VERx10 >= 125'
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Removing deadcode.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34988>
2025-05-15 15:25:12 +00:00
José Roberto de Souza
37b42ef648 anv: Drop '#if GFX_VERx10 >= 125' inside of '#if GFX_VERx10 >= 125'
This is just redundant.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34988>
2025-05-15 15:25:12 +00:00
José Roberto de Souza
bca12800aa iris: Restrict platforms that needs Wa_1604061319
It was being applied even to platforms that don't require it.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34988>
2025-05-15 15:25:12 +00:00
José Roberto de Souza
3cd972a2d3 anv: Enable preemption due 3DPRIMITIVE in GFX 12
The issues preventing it to be enabled were fixed so now we can enable
it but we need also to enable workaround 16013994831 back again.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34988>
2025-05-15 15:25:12 +00:00
José Roberto de Souza
2432d6677e anv: Implement missing part of Wa_1604061319
Description of this workaround are not clear but looking at Iris
implementation we need to emit all 3DSTATE_PUSH_CONSTANT_ALLOC_XS if
any 3DSTATE_PUSH_CONSTANT_ALLOC_XS is emitted.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34988>
2025-05-15 15:25:12 +00:00
Ashley Smith
a1376449c8 panvk: Expose support for multiview on v7
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34832>
2025-05-15 14:04:29 +00:00
Ashley Smith
4171917210 panvk: Add support for VK_KHR_multiview on v7
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34832>
2025-05-15 14:04:29 +00:00