From 148ab0278e2556f4917f459ee2107db25463ca6f Mon Sep 17 00:00:00 2001 From: Quantum Date: Wed, 13 Oct 2021 21:23:53 -0400 Subject: [PATCH] [client] egl: add debug options to disable damage tracking This should aid in figuring out the source of damage tracking bugs. --- client/renderers/EGL/egl.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index a9db8cd6..4ba3e5f4 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -110,6 +110,7 @@ struct Inst struct CursorState cursorLast; bool hadOverlay; + bool noSwapDamage; struct DesktopDamage desktopDamage[DESKTOP_DAMAGE_COUNT]; unsigned int desktopDamageIdx; LG_Lock desktopDamageLock; @@ -182,6 +183,20 @@ static struct Option egl_options[] = .type = OPTION_TYPE_BOOL, .value.x_bool = false }, + { + .module = "egl", + .name = "noBufferAge", + .description = "Disable partial rendering based on buffer age", + .type = OPTION_TYPE_BOOL, + .value.x_bool = false + }, + { + .module = "egl", + .name = "noSwapDamage", + .description = "Disable swapping with damage", + .type = OPTION_TYPE_BOOL, + .value.x_bool = false + }, {0} }; @@ -781,6 +796,16 @@ static bool egl_renderStartup(LG_Renderer * renderer, bool useDMA) if (!this->hasBufferAge) DEBUG_WARN("GL_EXT_buffer_age is not supported, will not perform as well."); + if (this->hasBufferAge && option_get_bool("egl", "noBufferAge")) + { + DEBUG_WARN("egl:noBufferAge specified, disabling buffer age."); + this->hasBufferAge = false; + } + + this->noSwapDamage = option_get_bool("egl", "noSwapDamage"); + if (this->noSwapDamage) + DEBUG_WARN("egl:noSwapDamage specified, disabling swap buffers with damage."); + if (!g_egl_dynProcs.glEGLImageTargetTexture2DOES) DEBUG_INFO("glEGLImageTargetTexture2DOES unavilable, DMA support disabled"); else if (!g_egl_dynProcs.eglCreateImage || !g_egl_dynProcs.eglDestroyImage) @@ -1098,7 +1123,7 @@ static bool egl_render(LG_Renderer * renderer, LG_RendererRotate rotate, this->cursorLast = cursorState; preSwap(udata); - app_eglSwapBuffers(this->display, this->surface, damage, damageIdx); + app_eglSwapBuffers(this->display, this->surface, damage, this->noSwapDamage ? 0 : damageIdx); return true; }