From 37617ab09e98916e8c493821bae29eee8dcfc9a6 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 17 Nov 2022 17:44:27 -0500 Subject: [PATCH] asahi: Don't validate WSI (twiddled) strides These are made up and won't necessarily be aligned. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index c5e88ae5117..911506ce5ef 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -167,10 +167,13 @@ agx_resource_from_handle(struct pipe_screen *pscreen, if (!rsc) return NULL; + rsc->modifier = whandle->modifier == DRM_FORMAT_MOD_INVALID ? + DRM_FORMAT_MOD_LINEAR : whandle->modifier; + /* We need strides to be aligned. ail asserts this, but we want to fail * gracefully so the app can handle the error. */ - if ((whandle->stride % 16) != 0) + if (rsc->modifier == DRM_FORMAT_MOD_LINEAR && (whandle->stride % 16) != 0) return false; prsc = &rsc->base; @@ -189,8 +192,6 @@ agx_resource_from_handle(struct pipe_screen *pscreen, return NULL; } - rsc->modifier = whandle->modifier == DRM_FORMAT_MOD_INVALID ? - DRM_FORMAT_MOD_LINEAR : whandle->modifier; agx_resource_setup(dev, rsc); if (rsc->layout.tiling == AIL_TILING_LINEAR)