[client] egl: add debug options to disable damage tracking

This should aid in figuring out the source of damage tracking bugs.
This commit is contained in:
Quantum 2021-10-13 21:23:53 -04:00 committed by Geoffrey McRae
parent d60dcb718b
commit 148ab0278e

View File

@ -110,6 +110,7 @@ struct Inst
struct CursorState cursorLast; struct CursorState cursorLast;
bool hadOverlay; bool hadOverlay;
bool noSwapDamage;
struct DesktopDamage desktopDamage[DESKTOP_DAMAGE_COUNT]; struct DesktopDamage desktopDamage[DESKTOP_DAMAGE_COUNT];
unsigned int desktopDamageIdx; unsigned int desktopDamageIdx;
LG_Lock desktopDamageLock; LG_Lock desktopDamageLock;
@ -182,6 +183,20 @@ static struct Option egl_options[] =
.type = OPTION_TYPE_BOOL, .type = OPTION_TYPE_BOOL,
.value.x_bool = false .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} {0}
}; };
@ -781,6 +796,16 @@ static bool egl_renderStartup(LG_Renderer * renderer, bool useDMA)
if (!this->hasBufferAge) if (!this->hasBufferAge)
DEBUG_WARN("GL_EXT_buffer_age is not supported, will not perform as well."); 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) if (!g_egl_dynProcs.glEGLImageTargetTexture2DOES)
DEBUG_INFO("glEGLImageTargetTexture2DOES unavilable, DMA support disabled"); DEBUG_INFO("glEGLImageTargetTexture2DOES unavilable, DMA support disabled");
else if (!g_egl_dynProcs.eglCreateImage || !g_egl_dynProcs.eglDestroyImage) 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; this->cursorLast = cursorState;
preSwap(udata); preSwap(udata);
app_eglSwapBuffers(this->display, this->surface, damage, damageIdx); app_eglSwapBuffers(this->display, this->surface, damage, this->noSwapDamage ? 0 : damageIdx);
return true; return true;
} }