Commit graph

209305 commits

Author SHA1 Message Date
Job Noorman
247dfb2c9b ir3: use nir_lower_bit_size for 8-bit bit_count
8-bit bit_count cannot simply use the masked result of a 16-bit
bit_count. Make sure it is properly lowered to a 16-bit bit_count.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 8aa2cad5df ("ir3: lower relevant 8-bit ALU ops in nir_lower_bit_size")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37116>
(cherry picked from commit 603d6fe240)
2025-09-03 12:08:52 +02:00
Tapani Pälli
b44c525075 anv: change some image qualifiers as coherent for Last Of Us
This fixes graphics artifacts happening with particular shader.

This 'heuristic' hits few very similar shaders but should provide better
performance than current fix to turn off caching from all shaders.

Cc: mesa-stable
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/35929>
(cherry picked from commit 4035520ca9)
2025-09-03 12:08:52 +02:00
David Rosca
0014562463 radv/video: Fix VP9 loop filter and segmentation params
Fixes: b8ac2d47e7 ("radv/video: add KHR_video_decode_vp9 support.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13801
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37080>
(cherry picked from commit 3f317348c2)
2025-09-03 12:08:52 +02:00
Robert Mader
d203fcd1c3 nir: Fixup 10/12 bit SW decoder YCbCr formats
The highest possible values that can be represented with
16/12/10 bits are 65535/4095/1023, not 65536/4096/1024.
In order to ensure 1023 maps to 65535 in the Sx10 case
we thus need to multiply by 65535 / 1023 ~= 64.06158
instead of 64.

Fixes: a166d7609f ("gles: Add support for 10/12/16 bit SW decoder YCbCr formats")
Suggested-by: Benjamin Otte <otte@redhat.com>
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37077>
(cherry picked from commit 1772380307)
2025-09-03 12:08:52 +02:00
Job Noorman
84ba9994e9 ir3/cf: don't swap signedness of (sat) instructions
Signed and unsigned saturation give different results.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: e894e83e47 ("ir3/cf: Rewrite pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37105>
(cherry picked from commit 0c1ebc63ca)
2025-09-03 12:08:52 +02:00
Valentine Burley
b11a042c35 ci/crosvm: Retry all curl errors when downloading kernel
`--retry-connrefused` didn’t catch cases where the download started but
failed midway. `--retry-all-errors` will cover those too.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13800
Fixes: d527da301f ("ci: Don't include the kernel in test-base image")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37109>
(cherry picked from commit 3fc973f6ca)
2025-09-03 12:08:52 +02:00
Yiwei Zhang
4fa2b8b818 vulkan: handle wsi private data properly
On Android, Vulkan loader implements KHR_swapchain and owns both surface
and swapchain handles. On non-Android, common wsi implements the same and
owns the same. So for both cases, the drivers are unable to handle
vkGet/SetPrivateData call on either a surface or a swapchain.

Inspired by https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37043

Cc: mesa-stable
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Ryan Zhang <ryan.zhang@nxp.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37064>
(cherry picked from commit 6e1c2e4d83)
2025-09-03 12:08:52 +02:00
Karol Herbst
11e1e50138 rusticl/event: fix create_and_queue for deps in error states
Cc: mesa-stable
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36007>
(cherry picked from commit 5d29acf23d)
2025-09-03 12:08:52 +02:00
Sagar Ghuge
70e2427ba9 anv: Apply pipe flushes for outstanding PC bits
Apply any outstanding accumulated PC bits before we proceed on building
Acceleration Structure.

2 reasons for this :
   - some of the data accessed by the build might need to be flushed
     as a result of a previous barrier
   - the scratch buffer might get reused between builds

Cc: mesa-stable
Closes: #13711
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Tested-by: Caleb Callaway <caleb.callaway@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36951>
(cherry picked from commit 90daa80d1d)
2025-09-03 12:08:52 +02:00
Mary Guillemard
f40b9bfd7a hk: Return 0 for opaque memory capture replay
If implementation does not actually replay the VA, it must return 0
to not violate:

"If the memory object was allocated with a non-zero value of
opaqueCaptureAddress, the return value must be the same address."

Fixes RenderDoc capture replay, which asserts on the this spec rule
being followed.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 5bc8284816 ("hk: add Vulkan driver for Apple GPUs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37090>
(cherry picked from commit b7a0f0215f)
2025-09-03 12:08:52 +02:00
Aleksi Sapon
aaca1b0e1f draw: fix missing line viewport transformation
Fixes: 00627b4f ("aux/draw: add guardband clipping for lines")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36653>
(cherry picked from commit 1eef08771f)
2025-09-03 12:08:52 +02:00
Ashley Smith
910476821d mesa: Fix support for GL_EXT_shader_clock
Missing 32-bit entry point in GLSL

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 2ce20170 ("mesa: Add support for GL_EXT_shader_clock")
Signed-off-by: Ashley Smith <ashley.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36041>
(cherry picked from commit d9b388af27)
2025-09-03 12:08:52 +02:00
Lionel Landwerlin
35d5951646 Revert "brw: move texture offset packing to NIR"
This reverts commit 4346210ae6.

Fixes: 4346210ae6 ("brw: move texture offset packing to NIR")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37050>
(cherry picked from commit 23a4aef14a)
2025-09-03 12:08:51 +02:00
Lionel Landwerlin
3afca5d943 Revert "anv: enable non uniform texture offset lowering"
This reverts commit 23de5abcb5.

Fixes: 23de5abcb5 ("anv: enable non uniform texture offset lowering")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37050>
(cherry picked from commit 1f279e6a08)
2025-09-03 12:08:51 +02:00
Lionel Landwerlin
755703a7b9 anv: temporary disable KHR_maintenance8
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 47cfc77085 ("anv: expose VK_KHR_maintenance8 support")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37050>
(cherry picked from commit d0e1dffcb7)
2025-09-03 12:08:51 +02:00
Faith Ekstrand
49ec2f3d8c nak,nir: Use a simpler version of phis_to_regs_block in lower_cf
The original lower_phis_to_regs_block() is a little too clever.  It
crawls up the predecessor tree until it finds a cross edge and places
the register writes as deep as it can.  This breaks nak_nir_lower_cf().
Say you have a shader like...

    con %0 = load_uniform()
    con loop {
        if div {
        } else {
        }
        break;
    }
    con %1 = phi %0

The original lower_phis_to_regs_block() will turn it into

    con %0 = load_uniform()
    con %r = decl_reg();
    con loop {
        if div {
           reg_store(%r, %0)
        } else {
           reg_store(%r, %0)
        }
        break;
    }
    con %1 = reg_load(%r)

We then convert it into unstructured control-flow and run regs_to_ssa()
to get our phis back, which lowers each of the registers we inserted to
a phi tree.  When we try to recover divergence information on phis by
looking at their sources, this works fine if each source maps directly
to a reg_store() whic maps directly to a phi in the original IR.
However, because the reg_store() instructions are placed deeper, it may
introduce false divergence.

Switch to the simple version of nir_lower_phis_to_regs_block() which
places reg writes directly in phi predecessor blocks.  We could probably
be more conservative and just avoid placing writes to uniform regs in
divergent control-flow but it's more robust to make the load/store_reg
intrinsics match the original phis directly.

This fixes some shaders in Horizon: Zero Dawn Remastered

Fixes: b013d54e4f ("nak/lower_cf: Flag phis as convergent when possible")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36914>
(cherry picked from commit c6e831ac44)
2025-09-03 12:08:51 +02:00
Faith Ekstrand
1dfd07ed6a nir: Add an option to make lower_phis_to_regs_block() less clever
Right now it tries to place reg_write instructions as far up the
predecessor chain as possible.  This is useful for a bunch of the passes
that call it since it ensures they don't get placed in dead blocks or in
single successors and things like that.  But it screws up NAK's control
flow lowering so we need the option to turn it off and make the pass
place the reg_write instructions in the most obvious place possible.

Fixes: b013d54e4f ("nak/lower_cf: Flag phis as convergent when possible")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36914>
(cherry picked from commit 26e32417b9)
2025-09-03 12:08:51 +02:00
Faith Ekstrand
6f684657b3 lavapipe: Always use dma-buf for external memory when we can
This makes lavapipe act like other DRM drivers whenever we have udmabuf
and just make everything a dma-buf even if it doesn't strictly have to
be.  Without this we can end up in weird cases if the client asks to
allocate a memory object with multiple export types.  Before, if this
happened, we would allocate a memfd and then return that when the client
calls GetMemoryFd() even if they asked for a dma-buf.  In theory, we
could add additional plumbing to allow for using the memfd itself for
OPAQUE_FD and only wrap in a udmabuf if DMA_BUF is requested but this is
simpler and more in line with what hardware DRM drivers do.

Fixes: c1657de63c ("lavapipe: support VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13798
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37067>
(cherry picked from commit 31f0d0732e)
2025-09-03 12:08:51 +02:00
Mike Blumenkrantz
63a7145d40 zink: flag resources for layout eval in update_binds_for_samplerviews()
this ensures the used layout is in sync with the expected descriptor layout

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37066>
(cherry picked from commit 0bae67b02b)
2025-09-03 12:08:51 +02:00
Mike Blumenkrantz
ad369558e7 zink: fix some weird indentation in update_binds_for_samplerviews()
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37066>
(cherry picked from commit 57399b5b8b)
2025-09-03 12:08:51 +02:00
Hans-Kristian Arntzen
2f81ead72f nvk: Return 0 for opaque memory capture replay.
If implementation does not actually replay the VA, it must return 0
to not violate:

"If the memory object was allocated with a non-zero value of
opaqueCaptureAddress, the return value must be the same address."

Fixes RenderDoc capture replay, which asserts on the this spec rule
being followed.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: ed6d5c33 ("nvk: Implement VK_EXT/KHR_buffer_device_address")
Reviewed-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Closes #13784

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37047>
(cherry picked from commit 6fbe2be7a7)
2025-09-03 12:08:51 +02:00
Mike Blumenkrantz
139ca7191f zink: always flush clears when doing single-aspect blit to avoid data loss
if doing e.g., clear(DEPTH|STENCIL) -> blit(DEPTH), the stencil clear would
previously have been discarded

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37057>
(cherry picked from commit e83c7f2912)
2025-09-03 12:08:51 +02:00
Mike Blumenkrantz
65cf417c94 zink: also set msrtss stencil
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37057>
(cherry picked from commit 817077276a)
2025-09-03 12:08:51 +02:00
Philipp Zabel
ecd14fc344 rusticl: Fix hidden lifetime warnings
Fix the following warning, and others that are similar, as rustc
suggests:

warning: hiding a lifetime that's elided elsewhere is confusing
   --> ../src/gallium/frontends/rusticl/mesa/compiler/nir.rs:282:22
    |
282 |     pub fn variables(&mut self) -> ExecListIter<nir_variable> {
    |                      ^^^^^^^^^     -------------------------- the same lifetime is hidden here
    |                      |
    |                      the lifetime is elided here
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
282 |     pub fn variables(&mut self) -> ExecListIter<'_, nir_variable> {
    |                                                 +++

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37059>
(cherry picked from commit 0e6b24451d)
2025-09-03 12:08:51 +02:00
Rob Clark
b5e53a49d2 drirc: Work around ANGLE brokeness
ANGLE is completely broken on certain vendors, see
https://issues.angleproject.org/u/1/issues/431097618

Work around this by spoofing gl vendor.

Cc: mesa-stable
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36540>
(cherry picked from commit b82e49f644)
2025-09-03 12:08:51 +02:00
Caio Oliveira
355d9ecfb6 brw: Fix checking sources of wrong instruction in opt_address_reg_load
Fixes: 8ac7802ac8 ("brw: move final send lowering up into the IR")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37019>
(cherry picked from commit 1c933b6511)
2025-09-03 12:08:51 +02:00
Lionel Landwerlin
fbfb88a62f brw: fix broadcast opcode
The problem with the current code is that there is a disconnect between :
   - the virtual register size allocated
   - the dispatch size
   - the size_written value

Only the last 2 are in sync and this confuses the spiller that only
looks at the destination register allocation & dispatch size to figure
out how much to spill.

The solution in this change is to make BROADCAST more like
MOV_INDIRECT, so that you can do a BROADCAST(8) that actually reads a
SIMD32 register. We put the size of the register read into src2.

Now the spiller sees correct read/write sizes just looking at the
destination register & dispatch size.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 662339a2ff ("brw/build: Use SIMD8 temporaries in emit_uniformize")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13614
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36564>
(cherry picked from commit 93996c07e2)
2025-09-03 12:08:51 +02:00
Lionel Landwerlin
c4dd465e0e brw: fix INTEL_DEBUG=spill_fs
We need to dirty the instruction BRW_DEPENDENCY_INSTRUCTIONS &
BRW_DEPENDENCY_VARIABLES if anything was spilled.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a6b0783375 ("brw: Use brw_ip_ranges in scheduling / regalloc")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13233
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36925>
(cherry picked from commit e6ca709a4e)
2025-09-03 12:08:51 +02:00
Mike Blumenkrantz
6838ea2ba1 zink: unify/fix clear flushing
this ensures the blitting/queries_disabled flags are always set/unset
and the layouts are too

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37024>
(cherry picked from commit b122c3eaa9)
2025-09-03 12:08:50 +02:00
Mike Blumenkrantz
13ade98b57 zink: update resized swapchain depth buffer layout while blitting
this otherwise will not be set for the renderpass

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37024>
(cherry picked from commit c6062e8463)
2025-09-03 12:08:50 +02:00
Mike Blumenkrantz
9a65828a67 zink: fix sizing on resolve resource array
let the compiler figure it out instead of mis-sizing it

Fixes: a71b6ac41a ("tc: also inline depth resolves")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37012>
(cherry picked from commit 92f2ef5a72)
2025-09-03 12:08:50 +02:00
Mike Blumenkrantz
dedaef839d zink: trigger fb unbind barrier on resolve images too
these are likely to be used as fs textures, therefore always
pre-sync them in tiler mode

Fixes: a71b6ac41a ("tc: also inline depth resolves")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37012>
(cherry picked from commit 8c1519318f)
2025-09-03 12:08:50 +02:00
Georg Lehmann
4468a08a63 nir/lower_io: fix boolean output stores
Stores don't have a definition, we have to check the bit size of the source.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13762
Fixes: c217ee8d35 ("nir: Insert b2b1s around booleans in nir_lower_to")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36966>
(cherry picked from commit e270a7480b)
2025-09-03 12:08:50 +02:00
Georg Lehmann
f6227baf01 ac/nir: do not assume mesh cull flag is 1bit
It will no longer be 1bit after a nir/lower_io bug is fixed.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36966>
(cherry picked from commit 13a9f27432)
2025-09-03 12:08:50 +02:00
Georg Lehmann
5d8633369d aco/optimizer: don't create undef copies from p_create_vector
p_create_vector allows undef operands, p_parallelcopy doesn't.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13765
Fixes: 01d20680e2 ("aco/optimizer: generalize p_create_vector of split vector opt")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36963>
(cherry picked from commit 635ac758c9)
2025-09-03 12:08:50 +02:00
Georg Lehmann
c95d55e918 aco/optimizer: don't apply packed clamp to v_fma_mix
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13758
Fixes: 345bf8a2f2 ("aco/optimizer: remove label_vop3p")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36963>
(cherry picked from commit 8903bb4618)
2025-09-03 12:08:50 +02:00
Julia Zhang
a245b6cd72 pps: init driver in OnSetup
Initialization of driver has been moved to register_data_source() from
OnSetup() by: a739889789 ("pps: Report available counters when
gpu.counters* data source is registered")

With above change, pps will destroy driver when collecting data stops
(pps may keep running) then the driver will become nullptr when user try
to collect data again. This will cause segmentation fault in OnSetup().

So this remove driver = nullptr in OnStop() and init driver in OnSetup()
to make sure driver exists when pps-producer run more than once.

Fixes: a739889789 ("pps: Report available counters when gpu.counters*
data source is registered")

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36548>
(cherry picked from commit 20b809f1f0)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
1cfa5a474b compiler/rust: Fix the DFS loop detection algorithm
The previous algorithm just looked at the dominator's loop header.
However, if you have multiple consecutive loops like:

    function_impl {
        loop {
            // Stuff
        }
        loop {
            // Other stuff
        }
    }

then it will look like the second loop is contained in the first loop
because the first loop's header dominates the second loop.  This isn't
actually what we want.  Instead, we want a node N to be considered part
of a loop with header H if H dominates N and H is reachable from N.

Fixes: 741f7067f1 ("nak: Add loop detection to the CFG")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36524>
(cherry picked from commit a1d5e8bfdb)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
7b09f7d156 nak: NAK_MAX_QMD_SIZE_B should be 384
Also add a static assert so we don't miss this again.

Fixes: 00a845a698 ("nak/qmd: QMD versions 4.0 and 5.0 are both 384B")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37015>
(cherry picked from commit 0a14ce7f50)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
df0a1e7eac nak/qmd: QMD versions 4.0 and 5.0 are both 384B
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Backport-to: 25.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
(cherry picked from commit 00a845a698)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
55914689c5 nvk: Allow for larger QMDs
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Backport-to: 25.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
(cherry picked from commit 0e268dad00)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
5939ff09ba nak/hw_runner: Allow for variable sized QMDs
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Backport-to: 25.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
(cherry picked from commit 238534e069)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
ec112a35e2 nak: Add a nak_qmd_size_B() query
Also add a #define NAK_QMD_ALIGN_B for alignments.  The alignment is
always 256B and there's no evidence of that changing.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Backport-to: 25.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
(cherry picked from commit 02ef6a5158)
2025-09-03 12:08:50 +02:00
Eric R. Smith
bb7baeae6c panvk: revised occlusion query pointer fix
It turns out that the `occlusion_query.syncobj` is used to set
state that later code relies on, and setting it to NULL causes
some Vulkan CTS tests to fail. Instead, we should explicitly check
for the mode being `MALI_OCCLUSION_MODE_DISABLED` to avoid using
an invalid `ptr` field.

Fixes: 24c692c981 ("panvk: fix a NULL pointer dereference in occlusion queries")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36794>
(cherry picked from commit 9b4eb81162)
2025-09-03 12:08:50 +02:00
Erik Faye-Lund
b8c30ec7e0 pan/lib: clamp format size to 4
When using formats with less than 32-bits per pixel, we pad the
tile-buffer to a multiple of 32-bits so we can store additional bits
used by dithering.

Account for this when computing the max MSAA setting.

Fixes: 329568b5eb ("panfrost: add color-attachment and msaa helpers")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35755>
(cherry picked from commit 6a83193771)
2025-09-03 12:08:50 +02:00
Boris Brezillon
66fdba6e09 panvk: Fix disjoint image memory binding
Right now, we store the last VkDeviceMemory object bound to an image in
panvk_image::mem, but this doesn't work for disjoint images where the mem
object can differ on each plane.

Move panvk_image::mem to panvk_image_plane::mem and prefix the offset
field with mem_, so it's clear the offset refers to the mem object.

Note this should only fix host copy on disjoint images, since the GPU
address was already properly set at bind time.

Fixes: 1cd61ee948 ("panvk: implement VK_EXT_host_image_copy for linear color images")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36926>
(cherry picked from commit d0126f5ced)
2025-09-03 12:08:50 +02:00
Eric R. Smith
8c04110b17 mesa: fix off by one in MSRTT handling
The actual number of samples chosen is allowed to equal the number
requested, but currently we just check for sample counts greater
than the request.

Fixes: 894b37e060 ("mesa: fix sample count handling for MSRTT")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36878>
(cherry picked from commit 095d1b6bcc)
2025-09-03 12:08:49 +02:00
Lionel Landwerlin
8395d77ccb brw: remove uniform from opt_offsets
Those are for push constants, no point in doing that because :
   - there is no HW constant offsets in push constants (payload
     delivery), it's just register offset calculation
   - if we have an dynamic value it's already using MOV_INDIRECT

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e103afe7be ("brw: run the nir_opt_offsets pass and set the maximum offset size")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36958>
(cherry picked from commit 27c69acb6a)
2025-09-03 12:08:49 +02:00
Samuel Pitoiset
387a1c2c08 radv: fix hashing graphics pipeline when no stages are compiled
It's possible with GPL.

This fixes a NULL pointer dereference with updated pipeline binaries
tests in VKCTS.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36999>
(cherry picked from commit 944e26eae7)
2025-09-03 12:08:49 +02:00
Mark Collins
1da029bcdf freedreno/drm: Only initialize memory data source when Perfetto is active
FdMemoryDataSource was being registered as a Perfetto data source
unconditionally which led to anything calling fd_device_new(...)
attempting to do this even when they might not have Perfetto
initialized which is done as a part of util_perfetto_init, without
which trying to register the event causes a SEGFAULT.

Fixes: c7045e3e63 ("perfetto: unify init")

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36993>
(cherry picked from commit 098521559d)
2025-09-03 12:08:49 +02:00