merge buffer_age render into general render code
avoiding the blocking swapinterval detection causes issues in the timing strategy and prevents protection against CPU overload on the nvidia blob BUG: 329821 FIXED-IN: 4.11.6 REVIEW: 115306
This commit is contained in:
parent
882d55f1b5
commit
79c3fa55f2
2 changed files with 16 additions and 20 deletions
|
@ -279,15 +279,8 @@ void EglOnXBackend::present()
|
||||||
if (lastDamage().isEmpty())
|
if (lastDamage().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (supportsBufferAge()) {
|
|
||||||
eglSwapBuffers(dpy, surface);
|
|
||||||
eglQuerySurface(dpy, surface, EGL_BUFFER_AGE_EXT, &m_bufferAge);
|
|
||||||
setLastDamage(QRegion());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QRegion displayRegion(0, 0, displayWidth(), displayHeight());
|
const QRegion displayRegion(0, 0, displayWidth(), displayHeight());
|
||||||
const bool fullRepaint = (lastDamage() == displayRegion);
|
const bool fullRepaint = supportsBufferAge() || (lastDamage() == displayRegion);
|
||||||
|
|
||||||
if (fullRepaint || !surfaceHasSubPost) {
|
if (fullRepaint || !surfaceHasSubPost) {
|
||||||
if (gs_tripleBufferNeedsDetection) {
|
if (gs_tripleBufferNeedsDetection) {
|
||||||
|
@ -315,6 +308,9 @@ void EglOnXBackend::present()
|
||||||
setBlocksForRetrace(result == 'd');
|
setBlocksForRetrace(result == 'd');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (supportsBufferAge()) {
|
||||||
|
eglQuerySurface(dpy, surface, EGL_BUFFER_AGE_EXT, &m_bufferAge);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// a part of the screen changed, and we can use eglPostSubBufferNV to copy the updated area
|
// a part of the screen changed, and we can use eglPostSubBufferNV to copy the updated area
|
||||||
foreach (const QRect & r, lastDamage().rects()) {
|
foreach (const QRect & r, lastDamage().rects()) {
|
||||||
|
@ -323,8 +319,10 @@ void EglOnXBackend::present()
|
||||||
}
|
}
|
||||||
|
|
||||||
setLastDamage(QRegion());
|
setLastDamage(QRegion());
|
||||||
eglWaitGL();
|
if (!supportsBufferAge()) {
|
||||||
xcb_flush(connection());
|
eglWaitGL();
|
||||||
|
xcb_flush(connection());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EglOnXBackend::screenGeometryChanged(const QSize &size)
|
void EglOnXBackend::screenGeometryChanged(const QSize &size)
|
||||||
|
|
|
@ -438,15 +438,8 @@ void GlxBackend::present()
|
||||||
if (lastDamage().isEmpty())
|
if (lastDamage().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (supportsBufferAge()) {
|
|
||||||
glXSwapBuffers(display(), glxWindow);
|
|
||||||
glXQueryDrawable(display(), glxWindow, GLX_BACK_BUFFER_AGE_EXT, (GLuint *) &m_bufferAge);
|
|
||||||
setLastDamage(QRegion());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QRegion displayRegion(0, 0, displayWidth(), displayHeight());
|
const QRegion displayRegion(0, 0, displayWidth(), displayHeight());
|
||||||
const bool fullRepaint = (lastDamage() == displayRegion);
|
const bool fullRepaint = supportsBufferAge() || (lastDamage() == displayRegion);
|
||||||
|
|
||||||
if (fullRepaint) {
|
if (fullRepaint) {
|
||||||
if (haveSwapInterval) {
|
if (haveSwapInterval) {
|
||||||
|
@ -478,6 +471,9 @@ void GlxBackend::present()
|
||||||
waitSync();
|
waitSync();
|
||||||
glXSwapBuffers(display(), glxWindow);
|
glXSwapBuffers(display(), glxWindow);
|
||||||
}
|
}
|
||||||
|
if (supportsBufferAge()) {
|
||||||
|
glXQueryDrawable(display(), glxWindow, GLX_BACK_BUFFER_AGE_EXT, (GLuint *) &m_bufferAge);
|
||||||
|
}
|
||||||
} else if (glXCopySubBuffer) {
|
} else if (glXCopySubBuffer) {
|
||||||
foreach (const QRect & r, lastDamage().rects()) {
|
foreach (const QRect & r, lastDamage().rects()) {
|
||||||
// convert to OpenGL coordinates
|
// convert to OpenGL coordinates
|
||||||
|
@ -490,9 +486,11 @@ void GlxBackend::present()
|
||||||
glDrawBuffer(GL_BACK);
|
glDrawBuffer(GL_BACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
glXWaitGL();
|
|
||||||
setLastDamage(QRegion());
|
setLastDamage(QRegion());
|
||||||
XFlush(display());
|
if (!supportsBufferAge()) {
|
||||||
|
glXWaitGL();
|
||||||
|
XFlush(display());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlxBackend::screenGeometryChanged(const QSize &size)
|
void GlxBackend::screenGeometryChanged(const QSize &size)
|
||||||
|
|
Loading…
Reference in a new issue