asahi: Don't validate WSI (twiddled) strides

These are made up and won't necessarily be aligned.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
This commit is contained in:
Alyssa Rosenzweig
2022-11-17 17:44:27 -05:00
committed by Marge Bot
parent f328207475
commit 37617ab09e

View File

@@ -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)