Fix KMSDRM double buffering.

(cherry picked from commit 5ab1151508)
This commit is contained in:
vanfanel 2024-07-18 21:21:52 +02:00 committed by Sam Lantinga
parent 9af7a80767
commit 7d83e03ac2
2 changed files with 7 additions and 1 deletions

View File

@ -192,7 +192,7 @@ int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
we have waited here, there won't be a pending pageflip so the
WaitPageflip at the beginning of this function will be a no-op.
Just leave it here and don't worry.
Run your SDL program with "SDL_KMSDRM_DOUBLE_BUFFER=1 <program_name>"
Run your SDL program with "SDL_VIDEO_DOUBLE_BUFFER=1 <program_name>"
to enable this. */
if (windata->double_buffer) {
if (!KMSDRM_WaitPageflip(_this, windata)) {

View File

@ -1567,6 +1567,12 @@ int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER, viddata->drm_fd);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev);
/* Do we want a double buffering scheme to get low video lag? */
windata->double_buffer = SDL_FALSE;
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, SDL_FALSE)) {
windata->double_buffer = SDL_TRUE;
}
if (!is_vulkan && !vulkan_mode) { /* NON-Vulkan block. */
/* Maybe you didn't ask for an OPENGL window, but that's what you will get.