Module: Mesa
Branch: main
Commit: 733607cc37ee75269663c838d8ee502ff7e5ad1a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=733607cc37ee75269663c838d8ee502ff7e5ad1a

Author: Nanley Chery <[email protected]>
Date:   Tue Oct 24 08:06:55 2023 -0400

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>

---

 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);
    }
 

Reply via email to