blob: 6914c932c810f94a0702ed5399a4a55752269007 [file] [log] [blame]
From a7bfc6808d0ef3b90a5d85224673a5e6ff284339 Mon Sep 17 00:00:00 2001
From: Lepton Wu <lepton@chromium.org>
Date: Wed, 3 Jun 2020 20:33:26 -0700
Subject: [PATCH] egl/android: Increase preferred buffer count to 4.
It seems 3 is not enough for drivers like virgl. With 4, it increases
T-Rex of gfxbench FPS from 42 to 55 on a Pixelbook.
Signed-off-by: Lepton Wu <lepton@chromium.org>
---
src/egl/drivers/dri2/platform_android.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 31acf540657..a1f7b2379ab 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -356,8 +356,8 @@ droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
int buffer_count;
int min_buffer_count, max_buffer_count;
- /* Prefer triple buffering for performance reasons. */
- const int preferred_buffer_count = 3;
+ /* Some driver like virgl, need quad buffering for performance reasons. */
+ const int preferred_buffer_count = 4;
if (window->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
_eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
--
2.26.2