Use page flip events to correctly synchronize with async flips

This commit is contained in:
Cameron Gutman
2026-01-02 19:47:43 -06:00
parent 745ac34b15
commit ac6dadffc6
2 changed files with 119 additions and 39 deletions

View File

@@ -164,6 +164,7 @@ DrmRenderer::~DrmRenderer()
m_PropSetter.disablePlane(m_OverlayPlanes[i]);
}
m_PropSetter.apply();
m_PropSetter.waitForFlipCompletion();
}
for (int i = 0; i < k_SwFrameCount; i++) {
@@ -1243,8 +1244,9 @@ bool DrmRenderer::addFbForFrame(AVFrame *frame, uint32_t* newFbId, bool testMode
if (err < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"drmModeAddFB2[WithModifiers]() failed: %d",
errno);
"drmModeAddFB2[WithModifiers]() failed: %d (format: " FOURCC_FMT ")",
errno,
FOURCC_FMT_ARGS(drmFrame->layers[0].format));
return false;
}