[07/61] libsdl2: upgrade 2.0.20 -> 2.0.22

Message ID 20220505050544.651895-7-alex@linutronix.de
State Accepted, archived
Commit 047f05c7a641db4138cbf3b3ea965873fe75035c
Headers show
Series [01/61] sato: work around missing icons in adwaita 42.0 | expand

Commit Message

Alexander Kanavin May 5, 2022, 5:04 a.m. UTC
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 ...d-in-native-OE-builds-by-not-looking.patch | 10 ++--
 ...pass-cflags-to-the-appropriate-cmake.patch | 46 -------------------
 ...ability-to-disable-fb-accel-via-hint.patch | 36 +++++++++++++++
 .../libsdl2/optional-libunwind-generic.patch  | 18 --------
 .../{libsdl2_2.0.20.bb => libsdl2_2.0.22.bb}  |  5 +-
 5 files changed, 42 insertions(+), 73 deletions(-)
 delete mode 100644 meta/recipes-graphics/libsdl2/libsdl2/0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch
 create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/0001-video-restore-ability-to-disable-fb-accel-via-hint.patch
 delete mode 100644 meta/recipes-graphics/libsdl2/libsdl2/optional-libunwind-generic.patch
 rename meta/recipes-graphics/libsdl2/{libsdl2_2.0.20.bb => libsdl2_2.0.22.bb} (94%)

Patch

diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch b/meta/recipes-graphics/libsdl2/libsdl2/0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch
index 214664f621..57bc522393 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2/0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch
+++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch
@@ -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
-
diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch b/meta/recipes-graphics/libsdl2/libsdl2/0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch
deleted file mode 100644
index e5d6cda0eb..0000000000
--- a/meta/recipes-graphics/libsdl2/libsdl2/0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch
+++ /dev/null
@@ -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
-
diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-video-restore-ability-to-disable-fb-accel-via-hint.patch b/meta/recipes-graphics/libsdl2/libsdl2/0001-video-restore-ability-to-disable-fb-accel-via-hint.patch
new file mode 100644
index 0000000000..fc74d30556
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-video-restore-ability-to-disable-fb-accel-via-hint.patch
@@ -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
+
diff --git a/meta/recipes-graphics/libsdl2/libsdl2/optional-libunwind-generic.patch b/meta/recipes-graphics/libsdl2/libsdl2/optional-libunwind-generic.patch
deleted file mode 100644
index 757b99a5f6..0000000000
--- a/meta/recipes-graphics/libsdl2/libsdl2/optional-libunwind-generic.patch
+++ /dev/null
@@ -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()
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.20.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.22.bb
similarity index 94%
rename from meta/recipes-graphics/libsdl2/libsdl2_2.0.20.bb
rename to meta/recipes-graphics/libsdl2/libsdl2_2.0.22.bb
index c1c827af79..7678319770 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.20.bb
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.22.bb
@@ -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