Commit Graph

153377 Commits

Author SHA1 Message Date
Marek Olšák 0cd59c7cb0 ac/llvm: set the correct cache policy for sparse buffer loads
The DLC bit was missing on gfx10.

Fixes: 6d5e26752c "ac/nir: implement sparse image/texture loads"
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Marek Olšák c7ec284024 ac: remove really_needs_scratch, parameter from ac_parse_shader_binary_config
it's always true

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Marek Olšák 4b93dd215f ac/gpu_info: rework how num_se is derived
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
2022-05-03 11:11:08 -04:00
Alyssa Rosenzweig 575068a165 panfrost: Unit test "from legacy" helper
So we don't regress the UABI. This doesn't get much CI coverage otherwise.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig 6d0505701d panfrost: Unit test stride calculations
These have reasonable interpretations now, and the three row strides have been
deduplicated. So add stride expectations to our ASTC unit tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig 579fd30209 panfrost: Unify row stride and AFBC row stride
Row stride is defined in terms of header blocks for AFBC. Usually,
afbc.row_stride is used for AFBC images and row_stride for non-AFBC images;
however, the nonsense non-AFBC stride leaked into the UABI. So handle that in
the legacy conversion path and use a unified row stride (equal to
afbc.row_stride for AFBC images and row_stride otherwise).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig 1842e14a73 panfrost: Remove line_stride
There are no more users. This eliminates a class of issues.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig 61100e7011 lima,panfrost: Use row stride for tiling routines
This makes more sense.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig c4241a831f panfrost: Use row_stride even for linear resources
In that case, they match up.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig c11df56cff panfrost: Adapt get_param for row strides
Let's preserve the old behaviour -- this is UABI, we need to be bug for bug
compatible.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig 3a4207dde6 panfrost: Use row stride to calculate slice size
This expresses what's actually happening. Equivalent to the old calculation due
to some cancellation.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig 0b788e2ee4 panfrost: Rename away from bytes_per_pixel
This name is wrong for block-compressed formats. The code worked out anyway, but
rename it for clarity.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig 81a686a714 panfrost: Use row stride for explicit layouts
Line strides don't make sense for linear images, so use row strides instead in
the API. Then update the layout code accordingly.

Note: we need to preserve the old UABI (bug for bug compatibility), so we still
use legacy strides externally. But now we use row strides internally, which is
better than using both everywhere.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig c40ebd859c panfrost: Add helpers to work with legacy strides
Unfortunately, the botched nonlinear "line strides" have become ingrained in the
UABI. We need to be work with them. Add safe helpers to convert to/from the
legacy strides.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig a741bd5db1 panvk: Report row_stride in GetImageSubresourceLayout
...Rather than line_stride. For linear images, these are equivalent. For
nonlinear images, rowPitch is implementation-defined. So this isn't strictly a
bug fix, but it gets rid of the nonsense nonlinear line_stride.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig a7fdedd247 panvk: Remove unused layout structs
PanVK switched to the common Panfrost layout code, but these duplicate structs
stuck around. Garbage collect them to prevent confusion.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Alyssa Rosenzweig f45816181f pan/decode: Print row strides, not line strides
I.e. what's actually passed to the hardware, in case of compression or tiling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>
2022-05-03 14:20:15 +00:00
Karmjit Mahil 58d9afb80b pvr: Add compute update kernel in vkCmdDispatch().
We upload a new data section whenever a patched variant is
needed. They will be freed at command buffer destruction since
the uploads are linked.

Co-authored-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
2022-05-03 13:41:28 +00:00
Karmjit Mahil 5e9e3fe7f7 pvr: Add compute update shared kernel in vkCmdDispatch().
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
2022-05-03 13:41:28 +00:00
Karmjit Mahil 7ccf9494b6 pvr: Add initial implementation of vkCmdDispatch().
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
2022-05-03 13:41:28 +00:00
Karmjit Mahil 4b7a9bf364 pvr: Add PVR_WORKGROUP_DIMENSIONS define.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
2022-05-03 13:41:28 +00:00
Lionel Landwerlin 4efc997472 anv: fix invalid utrace memcpy l3 config on gfx < 11
device->l3_config is only valid on Gfx11+

This only fixes using GPU_TRACE=1

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 02a4d622ed ("anv: expose a couple of emit helper to build utrace buffer copies")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16291>
2022-05-03 13:18:48 +00:00
Mike Blumenkrantz 4a4adb65ce llvmpipe: disable compute statistics queries if queries are disabled
cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
2022-05-03 13:00:50 +00:00
Mike Blumenkrantz e4884c35d6 llvmpipe: remove misleading query comment
u_blitter already handles this

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
2022-05-03 13:00:50 +00:00
Mike Blumenkrantz a36c3f6f6a llvmpipe: disable statistic queries during draw if queries are disabled
cc: mesa-stable

fixes (zink):
spec@ext_transform_feedback@generatemipmap prims_generated

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
2022-05-03 13:00:50 +00:00
Pierre-Eric Pelloux-Prayer 6ee9e6ce87 radeonsi: generate unique shader name in si_get_nir_shader
This function modifies the NIR shader, so when using NIR_DEBUG=print and
nir_viewer all the variants are displayed using the original name.

With this change, we get the original shader (eg: GLSL3), and then each
variant gets its own name (GLSL3-xxxxxxxx) - and is displayed in its
own tab in nir_viewer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16247>
2022-05-03 10:39:51 +00:00
Pierre-Eric Pelloux-Prayer f1f2d407e7 radeonsi: don't always strip NIR debug infos
When using NIR_DEBUG=print, always having shader names help debugging.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16247>
2022-05-03 10:39:51 +00:00
Joshua Ashton ce7966fcb4 aco: Use movk for AddressHi bits in vertex prolog
Eliminates a useless extra dword by transforming
        s_mov_b32 s47, 0xffff8000                                   ; beaf03ff ffff8000
to
        s_movk_i32 s47, 0x8000                                      ; b02f8000

which does the same thing.

Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15415>
2022-05-03 10:15:36 +00:00
Daniel Schürmann 58bd9a379e aco/ra: fix live-range splits of phi definitions
It could happen that at the time of a live-range split,
a phi was not yet placed in the new instruction vector,
and thus, instead of renamed, a new phi was created.

Fixes: dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i8vec2
Cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16248>
2022-05-03 09:54:30 +00:00
Konstantin Seurer d639608b8b ac/nir: Do not set cursor in try_extract_additions
Fixes: 61ac5ac ("radv,ac/nir: lower global access to _amd global access intrinsics")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16270>
2022-05-03 09:23:49 +00:00
Samuel Pitoiset 3829981eb7 radv: use 3D views for 3D internal operations on GFX6-8
Instead of binding 2D images views and relying on BASE_ARRAY.
This cleanups the internal driver operations for 3D.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16272>
2022-05-03 08:10:10 +02:00
Timothy Arceri 180398f785 nir: fix sorting before assigning varying driver locations
We need to make sure we also properly sort varyings sharing a single
slot otherwise we can end up assigning earlier components to the next
slot if we have already processed later components.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6392

Fixes: 1e93b0caa1 ("mesa/st: add support for NIR as possible driver IR")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16208>
2022-05-03 00:04:30 +00:00
Emma Anholt 067023dce2 util: Add some unit tests of the half-float conversions.
Make sure that we're handling nans/infs correctly, in particular only
generating quiet nans when given a quiet nan.  This catches the previous
qNaN fix.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16233>
2022-05-02 23:36:50 +00:00
Chia-I Wu 27e33d5c96 util: Keep quiet NaNs quiet when converting to half float.
We don't want to be throwing exceptions and changing float values later by
emitting a signaling binary16 nan.

If we don't do this, then when we convert back to f32 in NIR constant
expression evaluation, the signaling NaN can end up giving NaN for
fmax(NaN, 0.0), instead of 0.0.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5933
Cc: mesa-stable
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16233>
2022-05-02 23:36:50 +00:00
Lionel Landwerlin acf6bf88c0 iris: use new kernel uAPI to compute video memory
v2: Use os_get_available_system_memory() when kernel memory region
    uAPI is not available (Lionel)

Cc: 22.1 <mesa-stable>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16210>
2022-05-02 22:57:06 +00:00
Jason Ekstrand 763744aa8b panvk: Add address/range helpers for panvk_buffer
The range helper is taken from ANV; the gpu_ptr one is original.  This
also fixes a few more bugs where we weren't adding offsets in properly.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16216>
2022-05-02 17:37:40 -05:00
Alyssa Rosenzweig 631f47e83a panvk: Only write depth when depth test enabled
Fixes dEQP-VK.pipeline.depth.format.*_test_disabled.depth_write_enabled

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
2022-05-02 20:28:48 +00:00
Alyssa Rosenzweig 46778f2b2a panvk: Lower image deref atomics
Fixes dEQP-VK.image.atomic_operations.*

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
2022-05-02 20:28:48 +00:00
Alyssa Rosenzweig 54412afadc pan/bi: Handle texture offset + index
Fixes dEQP-VK.glsl.opaque_type_indexing.sampler.uniform.vertex.sampler1d

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
2022-05-02 20:28:48 +00:00
Alyssa Rosenzweig 86d32eed38 panvk: Allocate stack for each thread
Rather than a single stack for all threads to share -- that can't work! :-) We
use the same helper that the GLES driver does. Fixes anything using scratch or
spilling, including:

dEQP-VK.glsl.indexing.varying_array.vec3_static_write_dynamic_read

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
2022-05-02 20:28:48 +00:00
Alyssa Rosenzweig 7a7403f6aa panvk: Lower global vars to local
Fixes dEQP-VK.glsl.indexing.varying_array.float_static_write_static_loop_read

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16283>
2022-05-02 20:28:48 +00:00
Yiwei Zhang 3f44bad1ce venus: log performance envs upon instance creation with debug init
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Change-Id: I8db93d6de28ac6a727c10fbaca94cffac092f8ea
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16256>
2022-05-02 20:20:43 +00:00
Yiwei Zhang 84a53de76c venus: add VN_RELAX_BASE_SLEEP_US env var for tuning cpu utils
Cap the minimum to the current base sleep us 10.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16256>
2022-05-02 20:20:43 +00:00
Rob Clark f3fb1d6632 drm-shim: Cleanup on device file close
Avoid leaking memory when the device file is closed, dropping bo
references and freeing the shim_fd.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
2022-05-02 19:50:33 +00:00
Rob Clark 409b76511c freedreno/drm-shim: Better iova handling
We actually want to use util_vma to handle this.  But fortunately core
drm-shim alredy does this for mem offset, we can just delete a bunch of
code and re-use that.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
2022-05-02 19:50:33 +00:00
Rob Clark 6c465ad6c7 drm-shim: Add error handling for bo_init()
Don't assert, return an error.  If we are fuzzing something using
drm-shim, we want to be more like the kernel and return an error
for OoM situation, rather than falling over.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
2022-05-02 19:50:33 +00:00
Rob Clark c4b5ebe1fc drm-shim: Better mmap offsets
Using the bo pointer address as the offset doesn't go over well when
someone is fuzzing you.  But we already have the mem_addr, we can simply
use that instead.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
2022-05-02 19:50:33 +00:00
Rob Clark 97f4e48717 freedreno/drm-shim: Robustify error handling
We can't be so sloppy if we are using drm-shim for fuzzing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
2022-05-02 19:50:33 +00:00
Rob Clark d06fc7bb4f freedreno/drm-shim: Update to latest uapi version
Needed for fuzzing virgl drm native context.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
2022-05-02 19:50:33 +00:00
Rob Clark a922997ffd drm-shim: Add GET_UNIQUE support
Needed by drmOpenWithType(), which is used by virgl drm native context.
(We want to use drm-shim for fuzzing.)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
2022-05-02 19:50:33 +00:00