mesa/src
Alyssa Rosenzweig 57e8d21fff 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-17 14:05:02 +00:00
..
amd ac/nir: do not convert GS outputs to the expected variable size on GFX11 2022-11-17 14:05:02 +00:00
android_stub
asahi
broadcom broadcom/compiler: avoid using ldvary sequence to hide latency of branching 2022-11-09 21:22:06 +00:00
c11
compiler glsl: fix buffer texture type 2022-11-17 14:05:02 +00:00
drm-shim
egl egl/wgl: Implement interop methods 2022-11-02 18:11:41 +00:00
etnaviv
freedreno tu: tu: Clear patchControlPoints dirty state with static patchControlPoints 2022-11-09 21:22:05 +00:00
gallium panfrost: Copy resources when necessary 2022-11-09 21:22:06 +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 glx: Fixes apple/apple_visual.c that include non-exist util/debug.h 2022-11-09 21:22:05 +00:00
gtest
hgl
imagination nir: Drop infer_non_readable option for nir_opt_access() 2022-11-02 03:42:04 +00:00
imgui
intel intel: Don't cross DWORD boundaries with byte scratch load/store 2022-11-09 21:22:06 +00:00
loader
mapi mesa: fix typo from adding glGetObjectLabelEXT 2022-11-17 14:05:02 +00:00
mesa mesa/st: Query driver for interop data 2022-11-02 18:11:41 +00:00
microsoft utils: Merge util/debug.* into util/u_debug.* and remove util/debug.* 2022-11-02 07:25:39 +00:00
nouveau nv50/ir/nir: ignore sampler for TXF/TXQ ops. 2022-11-02 12:29:34 +00:00
panfrost panfrost: Require 64-byte alignment on imports 2022-11-17 14:05:02 +00:00
tool
util utils: Merge util/debug.* into util/u_debug.* and remove util/debug.* 2022-11-02 07:25:39 +00:00
virtio utils: Merge util/debug.* into util/u_debug.* and remove util/debug.* 2022-11-02 07:25:39 +00:00
vulkan vulkan/wsi/display: Reset connector state in vkReleaseDisplay(). 2022-11-09 21:22:06 +00:00
meson.build