android: build failure on android 8
Since commit 386b9c5e ("egl/android: fix buffer_count for applications setting max count")
the build fails on Android 8 with
external/mesa3d/src/egl/drivers/dri2/platform_android.c:404:33: error: use of undeclared identifier "NATIVE_WINDOW_MAX_BUFFER_COUNT"
I have fixed this locally with
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -398,6 +398,7 @@ droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
goto cleanup_surface;
}
+#ifdef NATIVE_WINDOW_MAX_BUFFER_COUNT
/* Query for maximum buffer count, application can set this
* to limit the total amount of buffers.
*/
@@ -412,6 +413,13 @@ droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
*/
buffer_count = CLAMP(preferred_buffer_count, min_buffer_count + 1,
max_buffer_count);
+#else
+ const int min_buffers = 3;
+
+ buffer_count = min_buffer_count;
+ if (buffer_count < min_buffers)
+ buffer_count = min_buffers;
+#endif