* [Buildroot] [PATCH 1/1] package/sdl2: Cherry-pick KMSDRM_CreateWindow fix
@ 2021-01-07 10:25 Gleb Mazovetskiy
2021-01-13 9:09 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Gleb Mazovetskiy @ 2021-01-07 10:25 UTC (permalink / raw)
To: buildroot
Fixes crashes on SDL2 when using GLES on some devices with vc4 and mali gpus.
Cherry-pick of https://hg.libsdl.org/SDL/rev/fb6395c49ce97ad3f70de2dfd616c715ab0ebc6d
Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
---
.../sdl2/0003-fix-kmsdrm-createwindow.patch | 35 +++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 package/sdl2/0003-fix-kmsdrm-createwindow.patch
diff --git a/package/sdl2/0003-fix-kmsdrm-createwindow.patch b/package/sdl2/0003-fix-kmsdrm-createwindow.patch
new file mode 100644
index 0000000000..d46d4d4c91
--- /dev/null
+++ b/package/sdl2/0003-fix-kmsdrm-createwindow.patch
@@ -0,0 +1,35 @@
+# HG changeset patch
+# User Sam Lantinga <slouken@libsdl.org>
+# Date 1592588234 25200
+# Fri Jun 19 10:37:14 2020 -0700
+# Node ID fb6395c49ce97ad3f70de2dfd616c715ab0ebc6d
+# Parent b622185b81ce31ac8e0c418f7d2cefd3feb6ffd4
+Fixed bug 5199 - Fix KMSDRM_CreateWindow() segfault when starting L?VE2D engine.
+
+Manuel Alfayate Corchete
+
+This small patch fixes the KMSDRM_CreateSurfaces() call in KMSDRM_CreateWindow(), that was segfaulting deeper into SDL internals because the windata->viddata pointer wasn't set before the KMSDRM_CreateSurfaces() call.
+So that's what this small patch does.
+
+Now, L?VE2D works perfectly well on the Raspberry Pi 3, instead of just segfaulting.
+
+diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
+--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
++++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
+@@ -798,6 +798,7 @@ KMSDRM_CreateWindow(_THIS, SDL_Window *
+ }
+
+ /* Setup driver data for this window */
++ windata->viddata = viddata;
+ window->driverdata = windata;
+
+ if (KMSDRM_CreateSurfaces(_this, window)) {
+@@ -807,8 +808,6 @@ KMSDRM_CreateWindow(_THIS, SDL_Window *
+ /* Add window to the internal list of tracked windows. Note, while it may
+ seem odd to support multiple fullscreen windows, some apps create an
+ extra window as a dummy surface when working with multiple contexts */
+- windata->viddata = viddata;
+-
+ if (viddata->num_windows >= viddata->max_windows) {
+ int new_max_windows = viddata->max_windows + 1;
+ viddata->windows = (SDL_Window **)SDL_realloc(viddata->windows,
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH 1/1] package/sdl2: Cherry-pick KMSDRM_CreateWindow fix
2021-01-07 10:25 [Buildroot] [PATCH 1/1] package/sdl2: Cherry-pick KMSDRM_CreateWindow fix Gleb Mazovetskiy
@ 2021-01-13 9:09 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2021-01-13 9:09 UTC (permalink / raw)
To: buildroot
>>>>> "Gleb" == Gleb Mazovetskiy <glex.spb@gmail.com> writes:
> Fixes crashes on SDL2 when using GLES on some devices with vc4 and mali gpus.
> Cherry-pick of https://hg.libsdl.org/SDL/rev/fb6395c49ce97ad3f70de2dfd616c715ab0ebc6d
> Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
This looks to be included in the 2.0.14 we have recently moved to, so
I've marked this patch as superseeded.
Can you please verify that it works with 2.0.14?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-13 9:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 10:25 [Buildroot] [PATCH 1/1] package/sdl2: Cherry-pick KMSDRM_CreateWindow fix Gleb Mazovetskiy
2021-01-13 9:09 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.