From 733607cc37ee75269663c838d8ee502ff7e5ad1a Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Tue, 24 Oct 2023 08:06:55 -0400 Subject: [PATCH] iris: Simplify a plane count check in from_handle Instead of checking the plane count in order to finish importing the aux info, just check the plane index. Planes are added in reverse, so we'll have the complete number of planes once we reach plane zero. Reviewed-by: Jianxun Zhang Part-of: --- src/gallium/drivers/iris/iris_resource.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 35279e9e86d..b692a355530 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -1500,8 +1500,7 @@ iris_resource_from_handle(struct pipe_screen *pscreen, res->bo = NULL; } - if (get_num_planes(&res->base.b) == - iris_get_dmabuf_modifier_planes(pscreen, modifier, whandle->format)) { + if (whandle->plane == 0) { iris_resource_finish_aux_import(pscreen, res); }