Adds function to get the list of page faults, returns NULL if the KMD
is too old or if there was an error retrieving the data.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41318>
Adds some data types and functions for getting the list of page faults
from the KMD using the intel common library.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41318>
The KMDs don't give us a way to query most failure types, we have to track
the error code that was returned by the failing IOCTL to figure out when we
have a PXP invalidation or if the device got disconnected.
These hooks will also give us a place to make the driver to automatically
dump some details about a lost device to the console (such as page fault
addresses) for more visibility to developers.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41318>
v2 (Sid): Handle image and ssbo atomics having only one component in
ir3, glsl, pco, and zink
Co-authored-by: Sid Pranjale <sidpranjale127@protonmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37888>
VK_IMAGE_USAGE_TRANSFER_DST_BIT is needed to recognize a surface as a
destination in get_blorp_surf_for_anv_image(). Set this image usage for
HiZ operations to correct the MOCS programming on gfx12.0.
Fixes: 08e82b28e8 ("anv: use the correct MOCS for depth destinations")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42122>
Xe3P will allow us to reduce the number of anv_state_pool in use, this will
improve performance as it will result in less uAPI calls to allocate memory
and less memory waste in anv_state_pool with not much use.
As this will be a run-time decision, here I'm adding a function to get each
anv_state_pool, then we can just change the function and all the callers will
use the correct anv_state_pool.
Next patches will replace directly access to each anv_state_pool by
a function call in the next patches.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42133>
If a GLXPixmap is created without GLX_TEXTURE_TARGET_EXT,
textureTarget remains 0. Calling glXBindTexImageEXT on such a
drawable would pass 0 to _mesa_get_current_tex_object(), triggering
an internal implementation error and a null-pointer segfault.
Return early when textureTarget is 0 - the drawable was never set
up for texturing, so bind is a no-op.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Assisted-by: DeepSeek V4 Flash
Closes: #58
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42093>
VCN supports one tile only, but with multiple slice segments.
Cc: mesa-stable
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42136>
The spec requires us to follow the constantQp/base_q_idx from the app,
which is constrained by the caps. Report the more accurate caps.
Cc: mesa-stable
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42136>
vtn lowers OpFmaKHR to nir_op_ffma and every Mali has a native fused
multiply-add, so there is nothing to do in the backend.
fp16 is gated on shaderFloat16. A 16-bit OpFmaKHR also needs the Float16
capability and only shaderFloat16 turns that on, so without it the bit
would not be usable. Mali has no fp64, so that one stays off.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42075>
Emulates SSBOS via global memory, real SSBO size and global base address
are stored in the descriptor. The size can be accessed using resbase,
the base address is parsed manualy from the descriptor by passing the
bindless base address into the shader via a driver UBO or const file.
nir_lower_ssbo is used to lower SSBO accesses to global memory when the
buffer size exceeds the limit. We also use it to insert bounds checks on
global memory. The final code for SSBO accesses looks like this:
if (@get_ssbo_size >= max_storage_buffer_range_bytes) {
if (offset < @get_ssbo_size) {
// global memory access using base (from resbase) + offset
} else {
// do nothing (stores) or return 0 (loads)
}
} else {
// original SSBO access
}
A new pass is added to lower @load_ssbo_address generated by
nir_lower_ssbo. We set native_offset=true for nir_lower_ssbo to make
sure it doesn't generate 64 bit address math. The new pass then
transforms @load/store_global into @load/store_global_ir3 passing the 32
bit offset from @load_ssbo_address.
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Co-authored-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41477>
Emulates texel buffers via 3D image access, real texel buffer
size and start offset (due to image aligment requirements) are
stored in the descriptor and accessed via resbase.
- Read-only access: isam.a.1d to read as 3d image.
- RW access: stib.b.typed.3d/ldib.b.typed.3d to read as 3d image.
Verified that proprietary D3D12 driver uses the same workaround,
the only difference is that proprietary driver uses arrayed 2d load
for read-only access instead of 3d load, but benefits are not verified.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41477>
From tests A8XX seem to fix incompatible with D3D12 limits.
However, proprietary driver exposes old texel buffer element limit.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41477>
This is mostly useful in combination with `min_ssbo_size` when the
native SSBO access instructions do the bounds check in HW so we don't
want to add bounds checks for all SSBO accesses.
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41477>
Some HW may have native SSBO instructions that only support a limited
buffer size. It may be beneficial to use those instructions for small
SSBOs and only fall back to global memory accesses for large ones.
This commit adds an option (min_ssbo_size) that, if non-zero, will cause
code like this to be emitted:
if (@get_ssbo_size >= min_ssbo_size) {
// global memory access
} else {
// original SSBO access
}
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41477>