If the kernel supports PERFCNTR_CONFIG for counter reservation, we can
expose perfcntrs by default.
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Add a helper to allocate a counter for a requested countable, and (if
supported by KMD) do the PERFCNTR_CONFIG ioctl to reserve the counter
for UMD local (inline) usage.
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
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>
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>
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>
This will simplify things for PERFCNTR_CONFIG, where we will be getting
GPU timestamps along with the sampled counter values.
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41315>
is_access_out_of_bounds() decides whether the residual loop (created
by partial_unroll) will access arrays out of bounds by checking whether
array_length is less than or equal to trip_count. That assumes the
induction variable starts at 0. For example glamor gradient shader
shader-db/shaders/glamor/4.shader_test:
uniform float stops[18];
for (i = 1; i < n_stop; i++)
if (stop_len < stops[i]) break;
trip_count is guessed as 17 from the array indexing, so the residual
loop's index begins at 18, out of bounds for the 18-element array, yet
18 <= 17 is false, so the OOB removal is skipped and the residual loop
is not eliminated.
Correctly consider the start value for the OOB check. This lets glamor
gradient shaders with loops starting at i=1 unroll the same way as i=0
loops.
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41203>
Mesa already sets `with_dri_platform = 'apple'` when the host system is
darwin (line 412), but the gating on `with_dri` itself only enables DRI
when `system_has_kms_drm` is true (or for the kgsl/Zink combo). Darwin
has no KMS/DRM, so DRI ends up disabled and Zink targeting EGL surfaceless
cannot be built.
Extend the existing `kgsl + zink` exception to also cover darwin: enable
DRI on darwin only when zink is the gallium driver in use. This factors
the exception under the `with_gallium_zink` umbrella, which leaves the
old appledri X11 / GLX path completely untouched on darwin builds that
do not enable zink.
Validated on macOS 15.2 / Apple Silicon with Mesa 26.x targeting Zink
over the KosmicKrisp Vulkan ICD: OpenGL 4.6 surfaceless contexts work
end to end.
Suggested-by: QwertyChouskie
Signed-off-by: Louis Montagne <louis@askem.eu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41359>
sed -i "s/nir_src_parent_instr/nir_src_use_instr/" `find ./ -type f`
sed -i "s/nir_src_parent_if/nir_src_use_if/" `find ./ -type f`
sed -i "s/nir_src_set_parent/nir_src_set_use/" `find ./ -type f`
There are two kinds of "parent" in relation to a src/def:
- the instruction where the def or src's def is defined
- the instruction which the src is a part of and where the def is used
Clarify that the parent here is where the src's def is used, not where
it's defined.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41344>
This contains more tests for the SMEM PRT workaround that we implemented
on RADV. VKCTS already has some coverage but it doesn't hurt to have
more.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41356>
CtsDeqpTestCases was originally added to run WSI tests on Android.
This is now covered by the command-line dEQP executable, which produces
comparable results and is much, much faster thanks to multithreading via
deqp-runner.
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
We can now run dEQP-VK.wsi.android.* and more EGL tests with ANGLE in the
deqp-runner suite.
The regular VKCTS test set had to be reduced to fit within the time
limit.
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
We can now run dEQP-VK.wsi.android.* and more EGL tests with ANGLE in the
deqp-runner suite.
The regular VKCTS test set had to be reduced to fit within the time
limit.
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
We can now run dEQP-VK.wsi.android.* and more EGL tests with ANGLE in the
deqp-runner suite.
This shows a Lavapipe bug.
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
This is implement with a headless WSI fallback using AImageReader, which
allows running EGL and Vulkan WSI tests from the command-line executable
(DEQP_ANDROID_EXE) on Android.
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
- gralloc0: fix the FRONT_RENDERING_BIT private query in minigbm
- Fixes enabling VK_KHR_shared_presentable_image
- Update Mesa to latest main, 117f3cb1fc ("gfxstream: allow
VK_KHR_maintenance extensions")
- Fixes a Turnip crash before the driver is replaced in the CI pipeline
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
The combined $ADB wait-for-device root command can be flaky with
Cuttlefish, sometimes failing with:
"adb: unable to connect for root: closed"
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
On LINEAR_PE GPUs, shared linear resources are render-compatible so
no render shadow exists - the PE renders directly into the shared
buffer. Rather than adding a dedicated flush-time blit to swap R/B
(which would introduce bandwidth that doesn't exist today), use the
frag_rb_swap shader key to swap channels at render time.
In etna_draw_vbo, detect LINEAR_PE + shared + linear + RB_SWAP format
and set the per-RT frag_rb_swap bits. Track shared_native_order so
etna_flush_resource can skip the dedicated blit when the shader
already produced correct byte order.
Fixes: a5766e75e48 ("etnaviv: Use BGRA-internal texture format with BLT/RS R/B swizzle")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40029>
Add a per-RT bitmask to the shader key that triggers R/B channel
swapping in the fragment shader output. Handles scalar through vec4
outputs by widening to vec4 first, then swapping channels 0 and 2
with adjusted writemask.
Preparation for LINEAR_PE GPUs where shared linear resources have no
render shadow, so the shader must produce correct byte order directly.
No functional change - nothing sets frag_rb_swap yet.
Fixes: a5766e75e48 ("etnaviv: Use BGRA-internal texture format with BLT/RS R/B swizzle")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40029>