mesa/src
Alyssa Rosenzweig e1fe4a64d3 panfrost: Require 64-byte alignment on imports
While Panfrost allocates linear images with strides that are a multiple of 64
bytes, other dma-buf producers on the system may not satisfy this requirement.
However, at least on v7 and newer, any image with a regular format must have a
stride that is a multiple of 64 bytes.

This fixes a real bug in an application that created a linear R8_UNORM image
with stride 480 bytes, imported it as an EGL_image, and then tried to texture
from it with the GPU. Previously, the driver allowed this situation but it
resulted in an imprecise fault from the GPU. This patch corrects the driver to
reject the import as invalid due to the unaligned stride, ensuring we never
attempt to texture from such a resource.

To implement, we add some new layout queries to centralize knowledge about the
stride alignment requirements, and we sprinkle in asserts to show how the
invariant is upheld throughout the lifecycle of image creation to texturing.

Cc: mesa-stable
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/19620>
(cherry picked from commit 811f8a1946)
2022-11-10 12:02:11 -08:00
..
amd radeonsi/gfx11: fix compute scratch buffer - WAVES is always per SE 2022-11-08 15:11:32 -08:00
android_stub
asahi agx: Fix float copyprop of neg(neg) case 2022-09-14 20:55:18 -07:00
broadcom broadcom/compiler: avoid using ldvary sequence to hide latency of branching 2022-11-10 12:02:09 -08:00
c11 c11: #include <threads.h> when the os/platform provide it 2022-08-19 11:32:29 -07:00
compiler glsl: fix buffer texture type 2022-11-10 12:02:10 -08:00
drm-shim drm-shim: drop gnu99 override 2022-09-26 10:13:53 -07:00
egl meson: replace manual compiler flags with meson arguments 2022-09-14 13:58:58 -07:00
etnaviv util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
freedreno freedreno/fdl: Increase alignment for UBWC images 2022-11-02 12:56:01 -07:00
gallium panfrost: Copy resources when necessary 2022-11-09 09:33:49 -08:00
gbm gbm: add GBM_FORMAT_[AX]BGR16161616 2022-07-27 07:27:10 +00:00
getopt
glx glx: Remove usage of USE_ELF_TLS 2022-07-29 23:59:12 +00:00
gtest gtest: Fix maybe-uninitialized compiler warning 2022-06-29 21:02:18 +00:00
hgl
imagination pvr: Fix cdm shared reg usage reported to fw. 2022-07-29 11:37:06 +00:00
imgui
intel intel/fs: Fix constant propagation into 32x16 integer multiplication 2022-11-08 15:11:37 -08:00
loader loader: Remove usage of USE_ELF_TLS in loader.c 2022-07-29 23:59:12 +00:00
mapi glthread: call _mesa_glthread_DeleteBuffers unconditionally 2022-08-12 09:41:33 -07:00
mesa glthread: leave dlist dispatch in place for Begin/End 2022-10-17 13:56:06 -07:00
microsoft microsoft/compiler: Fix PSV struct when numthreads is 0 2022-08-19 11:32:32 -07:00
nouveau nv50/ir/nir: ignore sampler for TXF/TXQ ops. 2022-11-02 12:56:01 -07:00
panfrost panfrost: Require 64-byte alignment on imports 2022-11-10 12:02:11 -08:00
tool meson: replace manual compiler flags with meson arguments 2022-09-14 13:58:58 -07:00
util util/radeonsi: enable zerovram workaround for Exanima 2022-10-11 13:27:16 -07:00
virtio virgl: Report CONSTANT_BUFFER_SIZE according to GL_MAX_UNIFORM_BLOCK_SIZE 2022-10-18 09:53:54 -07:00
vulkan vk/runtime: drop incorrect UNUSED annotation 2022-11-07 10:39:29 -08:00
meson.build meson: Remove usage of use_elf_tls 2022-07-29 23:59:11 +00:00