Commit graph

71677 commits

Author SHA1 Message Date
Tomeu Vizoso
9c6cab0458 teflon: Add support for Logistic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34629>
2025-07-28 14:14:31 +00:00
Tomeu Vizoso
67faa1525b etnaviv/ml: Add support for Absolute
Add a TP job that makes use of a look up table to implement a piecewise
linear approximation of the absolute function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34629>
2025-07-28 14:14:31 +00:00
Tomeu Vizoso
519a8b0f4a teflon: Add support for Absolute
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34629>
2025-07-28 14:14:31 +00:00
Tomeu Vizoso
a1bb3f3c97 etnaviv/ml: Add support for non-fused ReLU
Add a TP job that makes use of a look up table to implement a piecewise
linear approximation of the ReLU function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34629>
2025-07-28 14:14:30 +00:00
Tomeu Vizoso
1a102e05b5 teflon: Add support for non-fused Relu operations
Typically ReLU will be fused to a convolution, but that is not always
the case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34629>
2025-07-28 14:14:30 +00:00
Tomeu Vizoso
ff3162b074 etnaviv/ml: Add support for no-op Reshape operations
This operation could be implemented in the TP cores, but this operation
tends to be added by convertors that export to TFLite from frameworks
with different channel order, and end up being no-ops.

Once we move to NIR for tensor operations, we can support this operation
and then remove it when we have an explicit transpose operation that is
negated by a consequent transpose operation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34629>
2025-07-28 14:14:29 +00:00
Tomeu Vizoso
dae0af20ab teflon: Add support for Reshape operations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34629>
2025-07-28 14:14:29 +00:00
Gert Wollny
1420f57ec7 r600/sfn: remove code used for vectorized ALU ops
Alu is lowered to scalar, so no need to check for vectorized
operations.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36101>
2025-07-28 13:55:24 +00:00
Gert Wollny
c95b86cc0b r600/sfn: remove obsolete index and address register handling
This old code was needed to get the backend assembler to do the
right thing when emitting index and address registers, but sfn
is handling this now so we can drop this.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36101>
2025-07-28 13:55:24 +00:00
Gert Wollny
5d0719bf8d r600/sfn: remove some dead code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36101>
2025-07-28 13:55:23 +00:00
Gert Wollny
5697e6bb31 r600/sfn: lower ineg in nir
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36101>
2025-07-28 13:55:23 +00:00
Gert Wollny
43d877ce1a r600/sfn: lower bany/ball *(n)equal in nir
The code emitted in the backend was not better and often worse
then what we get with the lowering.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36101>
2025-07-28 13:55:22 +00:00
Patrick Lerda
cea80e1a10 dri: complete the support for ARGB4444
This change is inspired by 1021d6fe62 ("dri: deal
with ARGB1555")

This issue is now mostly fixed with
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36081
Anyway, the dri3_cpp_for_fourcc entry is still missing and should
be added.

This change is useful for instance with r600 which
can handle this format.

Note: this mode was generated at the "glx visuals" level
on r600 by default before the commit d709b42180.

This change was tested on r600 palm and cayman with X11
loaded with a version of mesa generating this very mode:
glx/glx-visuals-depth -pixmap: fail pass
glx/glx-visuals-stencil -pixmap: fail pass

Fixes: 00aa095d53 ("dri: Support 1555/4444 formats")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34294>
2025-07-28 11:17:00 +00:00
Jose Maria Casanova Crespo
5927fe5430 v3d: Reduce CLE submission of CLIP_WINDOW packets
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When the rasterizer state is updated, we only need to update
the scissoring state if the rasterizer scissor state has changed.

This avoids re-sending the same scissor state any time the rasterizer
is changed.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36352>
2025-07-28 09:53:56 +00:00
Jose Maria Casanova Crespo
591a894b94 v3d: Mark DIRTY_ZSA if disable_ez is changed from FS.
We need to update the CFG_BITS packet if the early_fragment_test status
changed vs previous draw call. But we don't need to update it every
time the FS is changed, we only need to update it when disable_ez
value is different from previous FS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36352>
2025-07-28 09:53:55 +00:00
Tomeu Vizoso
453ef73adb teflon: Link to the rocket driver
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29698>
2025-07-28 08:06:38 +02:00
Tomeu Vizoso
5ef68894bb pipe-loader: Load the rocket accel driver
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29698>
2025-07-28 08:06:38 +02:00
Tomeu Vizoso
5b829658f7 rocket: Initial commit of a driver for Rockchip's NPU
The programming model matches very closely to that of NVIDIA's NVDLA.

Enough is implemented to run SSDLite MobileDet with roughly the same
performance as the blob (when running on a single NPU core).

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29698>
2025-07-28 08:06:38 +02:00
Tomeu Vizoso
41eee4c3cc etnaviv/ml: Implement ml_operation_supported() callback
Choose what operations are supported so Teflon can forward that
information to TensorFlow Lite.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29698>
2025-07-28 08:06:38 +02:00
Tomeu Vizoso
49bffdd797 teflon: Query drivers on what operations they support
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29698>
2025-07-28 08:06:38 +02:00
Tomeu Vizoso
2c2523f0d5 teflon/tests: Increase tolerance
On Rockchip, we need a tolerance of 8 to pass all tests (especifically
the whole MobileNetV1 model).

Though all other tests pass with a tolerance of just 2, 8 is still not
that high that we would risk letting bugs slip in.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29698>
2025-07-28 08:06:37 +02:00
Tomeu Vizoso
e21d6ee723 pipe-loader: Implement loading of /dev/accel devices
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29698>
2025-07-28 08:06:37 +02:00
Tomeu Vizoso
7614122153 teflon: Reformat with clang-format
And add to .clang-format-include so it hopefully stays clean.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29698>
2025-07-28 08:06:37 +02:00
Mike Blumenkrantz
8e82bafae6 zink: drop primitiveTopologyPatchListRestart from profile
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
I thought this was required but actually it's just a broken test

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36384>
2025-07-25 15:11:18 -04:00
Rohit Athavale
1be3ee7c0c mediafoundation: Add guids for the newly added Input Delta QP & Absolute QP APIs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
While these GUIDs make their way through the SDK, add them for now
directly, to be able to perform Input QP related development.

Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36379>
2025-07-25 17:33:35 +00:00
Pohsiang (John) Hsu
d1691272b5 d3d12: Fix mediafoundation build
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36379>
2025-07-25 17:33:35 +00:00
Jesse Natalie
d3a284660e d3d12: Use NIR_PASS instead of NIR_PASS_V
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36299>
2025-07-25 08:55:14 -07:00
Jesse Natalie
f7db71949e gallium/aux: nir_lower_pstipple_fs progress and metadata
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36299>
2025-07-25 08:55:14 -07:00
Mike Blumenkrantz
a76f1cf3ee zink: create a dummy image for shaderdb runs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: 0a2c395394 ("zink: require nullDescriptor feature")

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13591
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36377>
2025-07-25 14:30:19 +00:00
Pierre-Eric Pelloux-Prayer
718fd47dde nir/lower_io: make sure range is not 0
For samplers the type_size() callback can return 0, which triggers
a NIR validation error.
In this case set range to ~0 which means the range is unknown.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36263>
2025-07-25 15:47:20 +02:00
Mike Blumenkrantz
0b82452b19 ci: disable xwm decorations in weston
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/36320>
2025-07-25 00:43:08 +00:00
Yiwei Zhang
549f6cdb17 lavapipe: fix maint4 vkGetDeviceImageMemoryRequirements
Otherwise plane aspect and dedicated alloc req are missed.

Fixes: 987e8a5a0c ("lavapipe: implement vkGetDevice*MemoryRequirements")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36335>
2025-07-24 19:19:31 +00:00
Yiwei Zhang
e309f1ad45 lavapipe: fix maint4 vkGetDeviceBufferMemoryRequirements
Otherwise dedicated alloc req is missed.

Fixes: 987e8a5a0c ("lavapipe: implement vkGetDevice*MemoryRequirements")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36335>
2025-07-24 19:19:31 +00:00
Yiwei Zhang
16e3293c31 lavapipe: fix a leak on a lvp_image_create exit path
This traces back to c688f8f8c5, but the
shape of the fix would be different if against that. So we do the
optimal for the current code flow and only port to stable.

Cc: mesa-stable
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36335>
2025-07-24 19:19:31 +00:00
Yiwei Zhang
eca43eb02e lavapipe: improve image memory binding
Add lvp_image_bind helper so that bind status is robustly handled
outside the core bind, which simplifies the exit paths. Meanwhile, the
spec doesn't require to proceed binding of image internal planes if a
prior plane binding has failed. So this change further simplifies the
non-disjoint image binding result handling.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36335>
2025-07-24 19:19:31 +00:00
Yiwei Zhang
74f53a9293 lavapipe: ensure to use zero memoryOffset for wsi image alias binding
Per spec of VkBindImageMemorySwapchainInfoKHR:

> If swapchain is not NULL, the swapchain and imageIndex are used to
  determine the memory that the image is bound to, instead of memory and
  memoryOffset.

Meanwhile, common wsi is doing dedicated allocation for swapchain image
memory, so it's required to use zero memoryOffset by the spec. Then here
we can safely set to zero memoryOffset before passing to the actual
binding call.

In practice, when the struct is initialized with proper sType and memory
being VK_NULL_HANDLE, the memoryOffset is most likely left being zero
initialized. Not a critical must fix but still a bug.

Fixes: ace49d9e52 ("lavapipe: adopt wsi_common_get_memory")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36335>
2025-07-24 19:19:30 +00:00
Marek Olšák
09e607c385 nir: add access to load_smem_amd (for ACCESS_CAN_SPECULATE)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36099>
2025-07-24 18:41:38 +00:00
Marek Olšák
688a639117 nir: add nir_tex_instr::can_speculate
Set to true everywhere except:
- spirv_to_nir used by Vulkan
- bindless handles in GLSL
- some internal shaders and driver-specific code

Acked-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36099>
2025-07-24 18:41:38 +00:00
Georg Lehmann
2fb53f01f1 lima: replace NIR_PASS_V with NIR_PASS(_, ...)
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36308>
2025-07-24 17:19:56 +00:00
Georg Lehmann
a076d3f3ac lima: fix metadata in lima_nir_split_loads
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36308>
2025-07-24 17:19:56 +00:00
Georg Lehmann
b8d48ffcac lima: rework lima_nir_duplicate_load_consts
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36308>
2025-07-24 17:19:56 +00:00
Georg Lehmann
9a56484247 lima: rework lima_nir_duplicate_intrinsic
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36308>
2025-07-24 17:19:56 +00:00
Georg Lehmann
5f48b4a053 lima: rework lima_nir_duplicate_modifiers
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36308>
2025-07-24 17:19:55 +00:00
Luc Ma
bfb855b0c8 dri: use XCB_PRESENT_EVENT_* enum instead of macros for consistency
In the dri3_handle_present_event() function, it uses an event enum
and two macros. So I suggest to change these all to use enums for
consistency.

Signed-off-by: Luc Ma <luc@sietium.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30461>
2025-07-24 16:14:19 +00:00
Roland Scheidegger
5385624c6d llvmpipe: Fix array mismatch when accessing shader images
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The compiled image function is derived from the image view, which is
supposed to match what is declared in the shader, however we did fixups
for array targets that only had one layer, since pipe_shader_image
actually doesn't have a target (derived from the resource instead).
But this is not correct at least for vulkan, since then the layer
coord is completely ignored, so we never got OOB behavior wrt the
layer coord.
Use single_layer_view field in pipe_shader_image to denote non-array
targets (the GL state tracker uses this in a similar way already,
although llvmpipe ignored it).

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Brian Paul <brian.paul@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36304>
2025-07-24 12:46:05 +00:00
Roland Scheidegger
5291eb9cd2 llvmpipe: minor cleanup
Remove duplicate assignment, better llvm module names

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Brian Paul <brian.paul@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36304>
2025-07-24 12:46:05 +00:00
Valentine Burley
b3cbaf4ee7 zink/ci: Enable more VVL on ANV
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Enable VVL on ADL, as well as GLES on TGL, and drop some old filters.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36222>
2025-07-24 11:59:44 +00:00
Jose Maria Casanova Crespo
dac5624ad4 v3d: glMemoryBarriers only flush jobs with tmu_dirty_rcl
As we are already updating tmu_dirty_rcl based on the the
shader usage of tmu writes at v3d_emit_gl_shader_state we
can avoid setting it everytime we have a SSBO or image
attached.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36343>
2025-07-24 11:29:11 +00:00
Christian Gmeiner
00d905c4b2 etnaviv: Fix negative LOD value encoding in texture descriptors
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Replace incorrect MIN2 clamping with proper 5.8 signed fixed point
encoding. The hardware expects LOD values in 5.8 format with a range
of -16.0 to +15.99609375. Clamp input values to this valid range
before conversion to handle overflow correctly.

Passes dEQP-GLES3.functional.texture.mipmap.*.max_lod.* on GC7000.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36303>
2025-07-24 09:35:06 +00:00
Pavel Ondračka
6fc78f38ae r300/ci: add one recent flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36332>
2025-07-24 09:21:05 +00:00