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 <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>
This commit is contained in:
Nanley Chery 2023-10-24 08:06:55 -04:00 committed by Marge Bot
parent 79222e5884
commit 733607cc37

View file

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