backends/drm: do glFinish after rendering on NVidia

Polling the dmabuf for readability doesn't appear to work on NVidia and
we're no longer using an egl surface where the driver does this for us,
so we need to explicitly wait for rendering to complete or there are glitches
on the output
This commit is contained in:
Xaver Hugl 2023-12-13 20:03:13 +01:00
parent 0ff4f84ace
commit 51ff2e4c32

View file

@ -176,8 +176,9 @@ bool EglGbmLayerSurface::endRendering(const QRegion &damagedRegion)
m_surface->gbmSwapchain->release(m_surface->currentSlot);
m_surface->timeQuery->end();
glFlush();
if (m_eglBackend->contextObject()->isSoftwareRenderer()) {
if (m_eglBackend->contextObject()->isSoftwareRenderer() || m_eglBackend->gpu()->isNVidia()) {
// llvmpipe doesn't do synchronization properly: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9375
// and NVidia doesn't support implicit sync
glFinish();
}
const auto buffer = importBuffer(m_surface.get(), m_surface->currentSlot.get());
@ -547,6 +548,10 @@ std::shared_ptr<DrmFramebuffer> EglGbmLayerSurface::importWithEgl(Surface *surfa
surface->importContext->shaderManager()->popShader();
glFlush();
if (m_gpu->isNVidia()) {
// the proprietary NVidia driver desn't support implicit sync
glFinish();
}
surface->importGbmSwapchain->release(slot);
surface->importTimeQuery->end();