Commit graph

223717 commits

Author SHA1 Message Date
Rob Clark
7bbdf0ffb7 freedreno/ds: Add a8xx derived counters
Mostly just some counter renames (slice vs unslice, etc)

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41158>
2026-06-04 08:57:56 +00:00
Rob Clark
b39cb31e66 freedreno/ds: PERFCNTR_CONFIG support
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41158>
2026-06-04 08:57:56 +00:00
Rob Clark
8f7f9c0897 freedreno/fdperf: Add PERFCNTR_CONFIG support
Add support for the new ioctl for KMD global counter collection.  This
avoids needing hacks to parse dtb and mmap the GPU's i/o space.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41158>
2026-06-04 08:57:56 +00:00
Rob Clark
bd5e3a2675 freedreno/fdperf: Prepare for partial-counter usage
With PERFCNTR_CONFIG, some other process may have already reserved some
counters, so not all will be available to fdperf.  Prepare for this by
using num_counters in counter_group.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41158>
2026-06-04 08:57:56 +00:00
Rob Clark
e601474339 freedreno/fdperf: Move where we setup counter groups
Move this earlier so we have the counter config early enough to probe
kernel support for PERFCNTR_CONFIG with a valid config.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41158>
2026-06-04 08:57:56 +00:00
Rob Clark
15669a6981 freedreno/common: Add ioctl ptr helpers
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41158>
2026-06-04 08:57:56 +00:00
Rob Clark
ac76ceafb6 drm-uapi: Sync msm_drm.h
Pull in updated UABI header with PERFCNTR_CONFIG ioctl.  Sync with:

   commit 44c460d2cc8b87c08360fe60f861660c8045ef90
   Merge: 9bb8af2770b7 9a967125427e
   Author: Dave Airlie <airlied@redhat.com>

       Merge tag 'drm-msm-next-2026-05-30' of https://gitlab.freedesktop.org/drm/msm into drm-next

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41158>
2026-06-04 08:57:56 +00:00
Lorenzo Rossi
830cd2dc47 nir/opt_algebraic: Optimize mediump fadd/fmul done in highp
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When we do f2fmp(fadd(f2f32(a), f2f32(b))) we can always optimize it to
fadd(a, b) and obtain the same result minus an intermediate rounding
step, same for fmul.

I verified this on CPU using a custom script with Berkley SoftFloat
implementation, the results there are bit-for-bit identical except for
NaN representations.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Ashley Smith <ashley.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41419>
2026-06-04 07:33:23 +00:00
Samuel Pitoiset
e07bc4dbbf ci: uprev vkd3d
It contains some fixes found with ASAN.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42000>
2026-06-04 06:49:07 +00:00
Tapani Pälli
fdb9ce6087 anv: skip writing xfb buffer if we get null information
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15582
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41930>
2026-06-04 05:30:22 +00:00
Paulo Zanoni
095e4f5f1b brw: control cache_mode through bypass_{l1,l3} variables
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This change splits the algorithm in two steps: first we have the
logical decision of which caches to bypass based on the needs of the
send operation, and then we have the code that picks the caching modes
based on which caches to bypass.

This should make it significantly easier for us to add new workarounds
without the risk of breaking existing cases.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41319>
2026-06-04 00:08:44 +00:00
Paulo Zanoni
7fec64063e brw: have a single if-ladder to pick cache_modes
Instead of having an if ladder followed by another if that overwrites
the previous result, have a single if ladder.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41319>
2026-06-04 00:08:44 +00:00
Paulo Zanoni
6b52263d84 brw: split cache mode selection into atomic, load and store modes
This is the next - but not final - step into making this function more
organized: split cache_mode into atomic, load and store versions, then
pick the version at the end.

v2: Initialize {load,store}_cache_mode (Sagar).

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41319>
2026-06-04 00:08:44 +00:00
Paulo Zanoni
2fcaa19a96 intel/brw: move cache_mode assignment to after send->sfid choice
We have code to choose cache_mode before send->sfid is assigned, but
after it we have more code to choose cache_mode that relies on
send->sfid. Move everything to after the selection of send->sfid so
the code to pick cache_mode is all together. I plan to simplify this
futher in the next commits, the goal of this patch is to make the next
diff easier to read.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41319>
2026-06-04 00:08:44 +00:00
Christian Gmeiner
75a0cd6e2c mesa: Allow GL_TEXTURE_IMMUTABLE_LEVELS query on GLES3
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
GL_TEXTURE_IMMUTABLE_LEVELS is core state in OpenGL ES 3.0 (it comes with
immutable textures / glTexStorage), queryable through glGetTexParameter. The
getter only allowed it when ARB_texture_view or OES_texture_view is present, so
a GLES3 driver without texture views returns GL_INVALID_ENUM for a valid query.
Its sibling GL_TEXTURE_IMMUTABLE_FORMAT is correctly ungated.

Allow the query on any GLES3 context, matching the spec.

Fixes 8 dEQP-GLES3.functional.state_query.texture.*_immutable_levels_* cases on
etnaviv (which exposes neither texture-view extension).

Fixes: 214fd4e40d ("mesa/main: fix texture view enum checks")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41910>
2026-06-03 21:53:19 +00:00
Ryan Zhang
072041a809 gfxstream/platform: add missing inc_include to platform_virtgpu build
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
src/gfxstream/guest/platform/VirtGpu.cpp
| In file included from ../sources/mesa-26.0.6.imx/src/util/os_misc.h:42,
|                  from ../sources/mesa-26.0.6.imx/src/gfxstream/guest/platform/VirtGpu.cpp:12:
| ../sources/mesa-26.0.6.imx/src/util/u_math.h:42:10: fatal error: c99_compat.h: No such file or directory
|    42 | #include "c99_compat.h"
|       |          ^~~~~~~~~~~~~~
| compilation terminated.

Fixes: 5826a0a ("gfxstream: meson format -i {all meson files}")

Signed-off-by: Ryan Zhang <ryan.zhang@nxp.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41978>
2026-06-03 21:35:50 +00:00
Jason Macnak
5caeb57bce gfxstream: Override VkDeviceDeviceMemoryReportCreateInfoEXT vk.xml
`VkDeviceDeviceMemoryReportCreateInfoEXT::pUserData` was updated to have
`optional` sometime between v1.4.335 and v1.4.337 which updates codegen
in a backwards incompatible way. VkDeviceDeviceMemoryReportCreateInfoEXT
should not really be sent to the host anyways (as a guest provided callback
can never be called from the host) but older existing guest images are
already sending this struct so we need to preserve compatibility.

Bug: b/519606352
Test: GfxstreamEnd2EndTests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42007>
2026-06-03 21:19:45 +00:00
Pavel Ondračka
0529608157 r300: clean up some dead draw/TGSI leftovers
Remove the unused tgsi_dump include, the stale nir_to_tgsi comment, the
redundant freshly-allocated null check, and the dead VS/FS delete branches.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41925>
2026-06-03 22:41:38 +02:00
Pavel Ondračka
d4d8273688 r300: remove dead first-time build path from r300_pick_vertex_shader
r300_create_vs_state always allocates vs->first and builds the initial shader
variant before the state can be bound, so the !vs->first path in
r300_pick_vertex_shader is unreachable.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41925>
2026-06-03 22:41:38 +02:00
Pavel Ondračka
78f49dc25b r300: convert swtcl vertex shader setup to NIR
Replace the TGSI-based r300_draw_init_vertex_shader with a NIR
implementation, removing the nir_to_tgsi call from r300_state.c.

The three transformations previously done via tgsi_transform are now
done directly on a cloned NIR shader:
- Insert missing primary color output if secondary color is present.
- Insert all missing color/bcolor outputs if any back-face color is used.
- Add a WPOS output (copy of gl_Position) in the next available generic
  slot, by duplicating each store_deref to gl_Position to the new output
  at the same point.

The ntr_fixup_varying_slots is applied to the clone before any
transforms, keeping VS outputs aligned with FS inputs.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Assisted-by: Claude Sonnet 4.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41925>
2026-06-03 22:41:38 +02:00
Pavel Ondračka
1ac1fd6dd3 r300: add NIR pass to add required color outputs
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Assisted-by: Claude Sonnet 4.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41925>
2026-06-03 22:41:37 +02:00
Pavel Ondračka
773116b273 r300: add NIR pass to append the wpos output
It just duplicates position write to a generic varying.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Assisted-by: Claude Sonnet 4.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41925>
2026-06-03 22:41:32 +02:00
Pavel Ondračka
6a29509273 r300: fix vs->first leak in swtcl delete path
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41925>
2026-06-03 22:31:28 +02:00
Faith Ekstrand
711dcde6da compiler/rust/smallvec: Hide the enum
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Even though we use an enum to implement it internally, there's no real
benefit to that enum being exposed to users.  This makes it look more
like any other container type with an opaque implementation.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:43 +00:00
Faith Ekstrand
f81a494d1d nak: Simplify our SmallVec usage
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:43 +00:00
Faith Ekstrand
cb83992970 nak/builder: Use some of the SmallVec improvements
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:43 +00:00
Faith Ekstrand
9afad0ad95 nak: Simplify BasicBlock::map_instrs()
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:43 +00:00
Faith Ekstrand
d8e586dd3b compiler/rust/smallvec: Implement From<SmallVec<T>> for Vec<T>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:42 +00:00
Faith Ekstrand
5c98f152a3 compiler/rust/smallvec: Implement IntoIterator
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:42 +00:00
Faith Ekstrand
96659a502f compiler/rust/smallvec: Implement FromIterator and From<[T; N]>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:42 +00:00
Faith Ekstrand
bb1695e172 compiler/rust/smallvec: Implement From<Vec<T>>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:41 +00:00
Faith Ekstrand
fb2c44bc51 compiler/rust/smallvec: Implement Extend<T> for SmallVec<T>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:41 +00:00
Faith Ekstrand
1a34d1ed3a compiler/rust/smallvec: Implement Deref[Mut]<Target = [T]>
We now get last_mut() for free since it's part of `&mut [T]`.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:41 +00:00
Faith Ekstrand
ab017fd8fc compiler/rust/smallvec: Add a push_mut() method
This is analagous to `Vec::push_mut()`, which was stabilied in Rust
1.95.0.  Since we can't use that rust version yet, we internally
implement it as `push()` followed by `last_mut().unwrap()`.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:41 +00:00
Faith Ekstrand
1eaee3b619 compiler/rust/smallvec: Implement Clone, Default, and new()
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41941>
2026-06-03 18:50:41 +00:00
Marek Olšák
4373a48457 radv: don't leave SPI_PS_INPUT_ENA uninitialized with NULL PS to fix a hang
Fixes: 22e40edfb9 - radv: move SPI_PS_INPUT_ENA emission into radv_emit_ps_state
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15579

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42001>
2026-06-03 18:25:19 +00:00
Ashley Smith
fea2af1b7b panfrost: Fix tiler_desc assignment
Bifrost/valhall descriptor pointers are incorrectly assigned

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Fixes: 11fcb23f74 ("pan/desc: Add a struct for valhall/bifrost to the union in pan_tiler_context")
Signed-off-by: Ashley Smith <ashley.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41126>
2026-06-03 17:42:57 +00:00
Pavel Ondračka
5b6e9374b6 r300: fix R300_VAP_TCL_BYPASS state leak
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This fixes state leakage when using the RADEON_DEBUG=notcl debug option.
This manifested as heavy desktop corruption when running GL clients with
this flag, since the R300_VAP_TCL_BYPASS state would leak into other HWTCL
users such as Xorg/glamor or Wayland compositors.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41996>
2026-06-03 17:23:11 +00:00
Job Noorman
67b3f7166a ir3: don't store shader_options in the cache
It's quite large (228B) and is only needed during compilation.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41994>
2026-06-03 16:48:37 +00:00
Job Noorman
2c5fdc16eb ir3: don't use bitfields in ir3_shader_output
Using bitfields results in nondeterministic bit patterns in the unused
bits. Since ir3_shader_output is stored in the cache, this makes it
difficult to verify cache equality between different builds.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41999>
2026-06-03 16:25:32 +00:00
Karol Herbst
aaf9e01c69 rusticl/util: fix rustc-1.95 compilation error
Somehow newer rustc complains about into(), just use to_owned() instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41998>
2026-06-03 16:06:40 +00:00
squidbus
74665ac901 kk: Support VK_EXT_primitive_topology_list_restart
Limited only to if the user explicitly requests it, to avoid unroll costs
otherwise.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41888>
2026-06-03 15:51:53 +00:00
squidbus
7051f481c0 kk: Support VK_EXT_primitive_restart_index
Requires unrolling, but only if the user explicitly requests a non-standard
restart index.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41888>
2026-06-03 15:51:53 +00:00
squidbus
685e0c9891 kk: Support VK_EXT_custom_resolve
Similar to RADV, restarts render pass with resolve attachments. Not
the most ideal for tiling, but we don't even use native resolve for
built-in modes due to Metal format limitations.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41888>
2026-06-03 15:51:52 +00:00
squidbus
2263841ced kk: Support VK_EXT_blend_operation_advanced
Already supported by blend lowering, just needs to be wired up.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41888>
2026-06-03 15:51:51 +00:00
squidbus
8a65042bee kk: Support VK_EXT_vertex_attribute_robustness
Functionality is the same as provided by maintenance9, which is enabled.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41888>
2026-06-03 15:51:51 +00:00
Caio Oliveira
52ad6f58ec intel/gen: Support symbolic print/parse of BFN function
Use the format from src/util/lut.h.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41872>
2026-06-03 15:23:20 +00:00
Caio Oliveira
b74eff31d9 util: Add runtime parser for boolean lookup tables
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41872>
2026-06-03 15:23:20 +00:00
Kenneth Graunke
0dcca5ad8c jay: Unroll loops before lowering deferred URB writes
Multiview often involves a loop over view indexes, and our output
handling assumes that everything is constant-indexed.  Unrolling
the loops takes care of this.  (brw already does this.)

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41872>
2026-06-03 15:23:20 +00:00
Kenneth Graunke
191dc6cb81 jay: Add an INTEL_JAY=all option
This enables Jay for all shader stages it currently supports.
Less typing than vs,tes,fs,cs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41872>
2026-06-03 15:23:20 +00:00