distribution/packages/graphics/SDL2/patches/0002-Force-VSync-when-using-KMSDRM.patch

38 lines
1.3 KiB
Diff

From 075da47d122522b66dc87528199a8aaf363309aa Mon Sep 17 00:00:00 2001
From: Johnny on Flame <johnnyonflame@hotmail.com>
Date: Sun, 6 Aug 2023 20:55:04 +0000
Subject: [PATCH 2/7] Force VSync when using KMSDRM.
---
src/video/SDL_egl.c | 2 +-
src/video/kmsdrm/SDL_kmsdrmopengles.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c
index 8e5f165b5..e270429b1 100644
--- a/src/video/SDL_egl.c
+++ b/src/video/SDL_egl.c
@@ -1044,7 +1044,7 @@ SDL_GLContext SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
return NULL;
}
- _this->egl_data->egl_swapinterval = 0;
+ _this->egl_data->egl_swapinterval = 1;
if (SDL_EGL_MakeCurrent(_this, egl_surface, egl_context) < 0) {
/* Delete the context */
diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c
index 8dc2bfdc6..487168203 100644
--- a/src/video/kmsdrm/SDL_kmsdrmopengles.c
+++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c
@@ -76,6 +76,7 @@ SDL_EGL_CreateContext_impl(KMSDRM)
return SDL_SetError("EGL not initialized");
}
+ interval = 1;
if (interval == 0 || interval == 1) {
_this->egl_data->egl_swapinterval = interval;
} else {
--
2.20.1