libsdl2: upgrade 2.0.20 -> 2.0.22

(From OE-Core rev: 047f05c7a641db4138cbf3b3ea965873fe75035c)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2022-05-05 07:04:50 +02:00
committed by Richard Purdie
parent bf6c662361
commit 8558c5292a
5 changed files with 42 additions and 73 deletions

View File

@@ -1,4 +1,4 @@
From 50c691e83f81b235bb96ef996dd4568ffaae256f Mon Sep 17 00:00:00 2001
From 0234c546d86174fafe9ab280cf5f44de50b73676 Mon Sep 17 00:00:00 2001
From: Carlos Rafael Giani <crg7475@mailbox.org>
Date: Fri, 18 Mar 2022 12:06:23 +0100
Subject: [PATCH] Disable libunwind in native OE builds by not looking for
@@ -16,15 +16,16 @@ By not looking for the libunwind header, the rest of the libunwind
specific bits in the CMake build script are disabled.
Upstream-Status: Inappropriate [OE specific]
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 64f9fbf..12a4d8f 100644
index 644715a..bbf2e28 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -862,7 +862,7 @@ if(SDL_LIBC)
@@ -869,7 +869,7 @@ if(SDL_LIBC)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
foreach(_HEADER
stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h limits.h float.h
@@ -33,6 +34,3 @@ index 64f9fbf..12a4d8f 100644
string(TOUPPER "HAVE_${_HEADER}" _UPPER)
string(REPLACE "." "_" _HAVE_H ${_UPPER})
check_include_file("${_HEADER}" ${_HAVE_H})
--
2.32.0

View File

@@ -1,46 +0,0 @@
From dbf0a3f6ea77a1d5f5e3c4dec7a22fcc09a49537 Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.krummenacher@toradex.com>
Date: Mon, 10 Jan 2022 21:52:02 +0000
Subject: [PATCH] cmake: sdlchecks.cmake: pass cflags to the appropriate cmake
variable
If egl.pc sets at least two macros as the i.MX Vivante driver does, e.g.:
| Cflags: -I${includedir} -DLINUX -DWL_EGL_PLATFORM
then we get the following error during configuration:
| -- Performing Test HAVE_OPENGL_EGL
| CMake Error: Parse error in command line argument: WL_EGL_PLATFORM
| Should be: VAR:type=value
If one changes to add a value to the macro, e.g.
| Cflags: -I${includedir} -DLINUX=1 -DWL_EGL_PLATFORM=1
then cmake does not error out but the macro is not passed to the
C compiler.
CMAKE_REQUIRED_FLAGS is the wrong variable to pass the CFLAGS in,
CMAKE_REQUIRED_DEFINITIONS should be used.
Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/5209]
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
cmake/sdlchecks.cmake | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 32be19c..f61b8df 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -808,8 +808,7 @@ endmacro()
macro(CheckEGL)
if (SDL_OPENGL OR SDL_OPENGLES)
pkg_check_modules(EGL egl)
- string(REPLACE "-D_THREAD_SAFE;" "-D_THREAD_SAFE=1;" EGL_CFLAGS "${EGL_CFLAGS}")
- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${EGL_CFLAGS}")
+ set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${EGL_CFLAGS}")
check_c_source_compiles("
#define EGL_API_FB
#define MESA_EGL_NO_X11_HEADERS
--
2.20.1

View File

@@ -0,0 +1,36 @@
From 14ad91658fd296e34bb9e833281e72c871bfb189 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Tue, 3 May 2022 12:31:50 +0200
Subject: [PATCH] video: restore ability to disable fb accel via hint
Somewhere in code refactoring between .20 and .22 this check
was lost, and so the hint had no effect anymore.
Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/5611]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
src/video/SDL_video.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 93c803e..cbe7616 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2503,6 +2503,14 @@ SDL_CreateWindowFramebuffer(SDL_Window * window)
if (!_this->checked_texture_framebuffer) {
SDL_bool attempt_texture_framebuffer = SDL_TRUE;
+ /* See if the user or application wants to specifically disable the framebuffer */
+ const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION);
+ if (hint) {
+ if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0) {
+ attempt_texture_framebuffer = SDL_FALSE;
+ }
+ }
+
if (_this->is_dummy) { /* dummy driver never has GPU support, of course. */
attempt_texture_framebuffer = SDL_FALSE;
}
--
2.30.2

View File

@@ -1,18 +0,0 @@
Do not error when libunwind-generic is not found, Not all
implementations of libunwind will provide this library therefore
do not make it hard error if its not found.
Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/5194]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1358,7 +1358,7 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROI
if(HAVE_LIBUNWIND_H)
# We've already found the header, so REQUIRE the lib to be present
pkg_search_module(UNWIND REQUIRED libunwind)
- pkg_search_module(UNWIND_GENERIC REQUIRED libunwind-generic)
+ pkg_search_module(UNWIND_GENERIC libunwind-generic)
list(APPEND EXTRA_LIBS ${UNWIND_LIBRARIES} ${UNWIND_GENERIC_LIBRARIES})
endif()
endif()

View File

@@ -22,14 +22,13 @@ LIC_FILES_CHKSUM:append = " ${@bb.utils.contains('PACKAGECONFIG', 'arm-neon', 'f
PROVIDES = "virtual/libsdl2"
SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
file://optional-libunwind-generic.patch \
file://0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch \
file://0001-video-restore-ability-to-disable-fb-accel-via-hint.patch \
"
SRC_URI:append:class-native = " file://0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch"
S = "${WORKDIR}/SDL2-${PV}"
SRC_URI[sha256sum] = "c56aba1d7b5b0e7e999e4a7698c70b63a3394ff9704b5f6e1c57e0c16f04dd06"
SRC_URI[sha256sum] = "fe7cbf3127882e3fc7259a75a0cb585620272c51745d3852ab9dd87960697f2e"
inherit cmake lib_package binconfig-disabled pkgconfig