UPSTREAM: egl: android: use num_planes param in createImageFromDmaBufs()
Fixes 972f36d8fa62 ("egl/android: Call createImageFromDmaBufs directly")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9278>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Change-Id: I7f90b641dda771b7742f68e9f497cb808b39acc9
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 8c52a4a..2b75dfa 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -254,16 +254,16 @@
* the single-fd case cannot happen. So handle eithe single
* fd or fd-per-plane case:
*/
+ int num_planes = (ycbcr.chroma_step == 2) ? 2 : 3;
if (num_fds == 1) {
fds[2] = fds[1] = fds[0];
} else {
- int expected_planes = (ycbcr.chroma_step == 2) ? 2 : 3;
- assert(num_fds == expected_planes);
+ assert(num_fds == num_planes);
}
return dri2_dpy->image->createImageFromDmaBufs(dri2_dpy->dri_screen,
buf->width, buf->height, fourcc,
- fds, num_fds, pitches, offsets,
+ fds, num_planes, pitches, offsets,
EGL_ITU_REC601_EXT,
EGL_YUV_NARROW_RANGE_EXT,
EGL_YUV_CHROMA_SITING_0_EXT,