mesa/src
Alyssa Rosenzweig 811f8a1946 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>
2022-11-10 14:37:18 +00:00
..
amd radv/ci: enable pre-merge testing for vkcts on navi21 2022-11-10 13:22:33 +00:00
android_stub
asahi util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
broadcom util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
c11 c11: Remove _MTX_INITIALIZER_NP for windows 2022-11-09 04:38:28 +00:00
compiler nir: make ray query load values visible in NIR prints 2022-11-10 14:40:08 +02:00
drm-shim drm-shim: drop gnu99 override 2022-09-16 02:06:38 +00:00
egl zink: Only #include <vulkan/vulkan_core.h> instead #include <vulkan/vulkan.h> in kopper_interface.h 2022-11-10 06:59:42 +00:00
etnaviv util/mesa/wide: Rename _SIMPLE_MTX_INITIALIZER_NP to SIMPLE_MTX_INITIALIZER 2022-10-14 03:27:41 +00:00
freedreno util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
gallium panfrost: Compile indirect dispatch shader on first use 2022-11-10 14:22:56 +00:00
gbm utils: Merge util/debug.* into util/u_debug.* and remove util/debug.* 2022-11-02 07:25:39 +00:00
getopt
glx zink: Only #include <vulkan/vulkan_core.h> instead #include <vulkan/vulkan.h> in kopper_interface.h 2022-11-10 06:59:42 +00:00
gtest
hgl
imagination pvr: conditionally call pvr_finishme() in pvr_csb_copy() 2022-11-10 14:11:07 +00:00
imgui
intel nir: make ray query load values visible in NIR prints 2022-11-10 14:40:08 +02:00
loader loader/dri3: Add DRI performance option to wait for next buffer on swap 2022-10-25 08:30:35 +00:00
mapi meson: Use deps_for_libmesa_util for idep_mesautil instead hand crafted list 2022-11-10 11:57:22 +08:00
mesa util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
microsoft util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
nouveau drm-shim/nouveau: fix the shim to work with nvif ioctl. 2022-11-09 21:21:22 +00:00
panfrost panfrost: Require 64-byte alignment on imports 2022-11-10 14:37:18 +00:00
tool pps: enable track_event in intel.cfg 2022-10-09 22:39:53 +03:00
util util: Use include_directories('..') instead include_directories('.') for inc_util 2022-11-10 06:27:25 +00:00
virtio utils: Merge util/debug.* into util/u_debug.* and remove util/debug.* 2022-11-02 07:25:39 +00:00
vulkan util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
meson.build