Skip to content

Commit

Permalink
bump SDL2
Browse files Browse the repository at this point in the history
  • Loading branch information
dhwz committed Feb 5, 2024
1 parent a13ff54 commit 8222fca
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/games/tools/SDL2/package.mk
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2021-present AmberELEC (https://github.com/AmberELEC)

PKG_NAME="SDL2"
PKG_VERSION="2.28.5"
PKG_VERSION="2.30.0"
PKG_LICENSE="GPL"
PKG_SITE="https://www.libsdl.org/"
PKG_URL="https://www.libsdl.org/release/SDL2-${PKG_VERSION}.tar.gz"
Expand Down
@@ -1,23 +1,25 @@
diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c
index 87d693e8d..891d588c4 100644
index a89c0e812..c35791ce3 100644
--- a/src/video/SDL_egl.c
+++ b/src/video/SDL_egl.c
@@ -1032,7 +1032,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
@@ -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) {
/* Save the SDL error set by SDL_EGL_MakeCurrent */
/* Delete the context */
diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c
index 9b34d6896..11ee40f72 100644
--- a/src/video/kmsdrm/SDL_kmsdrmopengles.c
+++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c
@@ -41,11 +41,17 @@ KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor)
@@ -41,11 +41,17 @@ void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor)
{
/* if SDL was _also_ built with the Raspberry Pi driver (so we're
definitely a Pi device), default to GLES2. */
-#if SDL_VIDEO_DRIVER_RPI
-#ifdef SDL_VIDEO_DRIVER_RPI
- *mask = SDL_GL_CONTEXT_PROFILE_ES;
- *major = 2;
- *minor = 0;
Expand All @@ -34,11 +36,12 @@ index 87d693e8d..891d588c4 100644
+ }
}

int
@@ -72,6 +78,7 @@ SDL_EGL_CreateContext_impl(KMSDRM)

int KMSDRM_GLES_SetSwapInterval(_THIS, int interval) {
int KMSDRM_GLES_LoadLibrary(_THIS, const char *path)
@@ -72,7 +78,7 @@ SDL_EGL_CreateContext_impl(KMSDRM)

int KMSDRM_GLES_SetSwapInterval(_THIS, int interval)
{
-
+ interval = 1;
if (!_this->egl_data) {
return SDL_SetError("EGL not initialized");
Expand Down
Expand Up @@ -25,36 +25,36 @@ index 65ccc55..bf4e3aa 100644
LIBTOOL = @LIBTOOL@
INSTALL = @INSTALL@
diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c
index 2de35e0e8..66067f15b 100644
index 9b34d6896..83dc39bb4 100644
--- a/src/video/kmsdrm/SDL_kmsdrmopengles.c
+++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c
@@ -27,11 +27,15 @@
@@ -30,11 +30,15 @@
#include "SDL_kmsdrmopengles.h"
#include "SDL_kmsdrmdyn.h"
#include <errno.h>
+#include<stdbool.h>

#ifndef EGL_PLATFORM_GBM_MESA
#define EGL_PLATFORM_GBM_MESA 0x31D7
#endif

+extern rga_info_t src_info;
+extern rga_info_t dst_info;
+
/* EGL implementation of SDL OpenGL support */
void KMSDRM_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor)
@@ -91,6 +95,7 @@ int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
SDL_VideoData *viddata = _this->driverdata;

void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor)
@@ -93,6 +97,7 @@ int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window)
SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
KMSDRM_FBInfo *fb_info;
int ret = 0;
+ struct gbm_bo* rga_buffer = NULL;

/* Always wait for the previous issued flip before issuing a new one,
even if you do async flips. */
@@ -134,7 +139,26 @@ int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
@@ -143,7 +148,26 @@ int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window)
}

/* Get an actual usable fb for the next front buffer. */
- fb_info = KMSDRM_FBFromBO(_this, windata->next_bo);
+ if (src_info.fd) {
Expand All @@ -74,10 +74,10 @@ index 2de35e0e8..66067f15b 100644
+ SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not get a framebuffer");
+ return 0;
+ }
+
+
+ viddata->rga_buffer_index = (viddata->rga_buffer_index + 1) % RGA_BUFFERS_MAX;
+
if (fb_info == NULL) {
if (!fb_info) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not get a framebuffer");
return 0;
diff --git a/src/video/kmsdrm/SDL_kmsdrmsym.h b/src/video/kmsdrm/SDL_kmsdrmsym.h
Expand Down

0 comments on commit 8222fca

Please sign in to comment.