From 17f7ffcb364f43e30ecdcb0b83c7c80fcc96399f Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Wed, 30 Aug 2023 16:53:06 +0300 Subject: [PATCH] android: Fix num_planes assignment in u_gralloc_fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That seems to be an uncaught porting issue from EGL code to a common. Fixes: ee42e2166d8362 ("android: Introduce the Android buffer info abstraction") Signed-off-by: Roman Stratiienko Reviewed-by: Tapani Pälli Part-of: --- src/util/u_gralloc/u_gralloc_fallback.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/u_gralloc/u_gralloc_fallback.c b/src/util/u_gralloc/u_gralloc_fallback.c index 27999a76ff1..e478b9040fd 100644 --- a/src/util/u_gralloc/u_gralloc_fallback.c +++ b/src/util/u_gralloc/u_gralloc_fallback.c @@ -166,7 +166,6 @@ fallback_gralloc_get_yuv_info(struct u_gralloc *gralloc, enum chroma_order chroma_order; struct android_ycbcr ycbcr; int drm_fourcc = 0; - int num_planes = 0; int num_fds = 0; int fds[3]; int ret; @@ -209,7 +208,7 @@ fallback_gralloc_get_yuv_info(struct u_gralloc *gralloc, out->drm_fourcc = drm_fourcc; out->modifier = DRM_FORMAT_MOD_INVALID; - num_planes = ycbcr.chroma_step == 2 ? 2 : 3; + out->num_planes = ycbcr.chroma_step == 2 ? 2 : 3; /* When lock_ycbcr's usage argument contains no SW_READ/WRITE flags * it will return the .y/.cb/.cr pointers based on a NULL pointer, * so they can be interpreted as offsets. */