From: Asahi Lina Date: Fri, 9 Dec 2022 11:16:28 +0000 (+0900) Subject: asahi: Refuse to transfer out-of-bounds mip levels X-Git-Tag: upstream/23.3.3~13659 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a88aa3e8350ced14a4a3ae24af12447067ce55d3;p=platform%2Fupstream%2Fmesa.git asahi: Refuse to transfer out-of-bounds mip levels Fixes ail asserts on a pile of dEQP3 tests. Signed-off-by: Asahi Lina Part-of: --- diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 5b39955..689b66f 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -742,6 +742,10 @@ agx_transfer_map(struct pipe_context *pctx, struct pipe_resource *resource, if ((usage & PIPE_MAP_DIRECTLY) && rsrc->modifier != DRM_FORMAT_MOD_LINEAR) return NULL; + /* Can't transfer out of bounds mip levels */ + if (level >= rsrc->layout.levels) + return NULL; + agx_prepare_for_map(ctx, rsrc, level, usage, box); struct agx_transfer *transfer = CALLOC_STRUCT(agx_transfer);