[SCM] kodi/master: Add upstream patches for fixing suspend and adding MIPS support
rbalint at users.alioth.debian.org
rbalint at users.alioth.debian.org
Mon Nov 10 13:36:05 UTC 2014
The following commit has been merged in the master branch:
commit c3548df57f1cc5155066d16625c81ef818c74486
Author: Balint Reczey <balint at balintreczey.hu>
Date: Mon Nov 10 08:35:35 2014 +0100
Add upstream patches for fixing suspend and adding MIPS support
diff --git a/debian/patches/0001-linux-Check-for-Logind-first-then-Kit-s-with-UPower-.patch b/debian/patches/0001-linux-Check-for-Logind-first-then-Kit-s-with-UPower-.patch
new file mode 100644
index 0000000..4465fb8
--- /dev/null
+++ b/debian/patches/0001-linux-Check-for-Logind-first-then-Kit-s-with-UPower-.patch
@@ -0,0 +1,35 @@
+From 879a4cfcd6b0a31d7f483d91a3685f4c497036cb Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Tue, 4 Nov 2014 00:13:21 +0100
+Subject: [PATCH 1/6] linux: Check for Logind first, then *Kit-s with UPower
+ when detecting PM framework
+
+Logind is the most likely candidate to work nowadays and latest UPower does
+not provide suspend/hibernate API.
+---
+ xbmc/powermanagement/PowerManager.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp
+index 5900f98..27948b5 100644
+--- a/xbmc/powermanagement/PowerManager.cpp
++++ b/xbmc/powermanagement/PowerManager.cpp
+@@ -75,12 +75,12 @@ void CPowerManager::Initialize()
+ m_instance = new CAndroidPowerSyscall();
+ #elif defined(TARGET_POSIX)
+ #if defined(HAS_DBUS)
+- if (CConsoleUPowerSyscall::HasConsoleKitAndUPower())
++ if (CLogindUPowerSyscall::HasLogind())
++ m_instance = new CLogindUPowerSyscall();
++ else if (CConsoleUPowerSyscall::HasConsoleKitAndUPower())
+ m_instance = new CConsoleUPowerSyscall();
+ else if (CConsoleDeviceKitPowerSyscall::HasDeviceConsoleKit())
+ m_instance = new CConsoleDeviceKitPowerSyscall();
+- else if (CLogindUPowerSyscall::HasLogind())
+- m_instance = new CLogindUPowerSyscall();
+ else if (CUPowerSyscall::HasUPower())
+ m_instance = new CUPowerSyscall();
+ else
+--
+2.1.1
+
diff --git a/debian/patches/0002-mips-add-guards.patch b/debian/patches/0002-mips-add-guards.patch
new file mode 100644
index 0000000..e64f951
--- /dev/null
+++ b/debian/patches/0002-mips-add-guards.patch
@@ -0,0 +1,96 @@
+From 15179cf949eab8a5fa57db92d168b07b8f32acd1 Mon Sep 17 00:00:00 2001
+From: theuni <theuni-nospam- at xbmc.org>
+Date: Fri, 30 Sep 2011 06:16:18 -0400
+Subject: [PATCH 2/6] mips: add guards
+
+Updated for Helix by Balint Reczey
+---
+ Makefile.in | 2 +-
+ xbmc/cores/DllLoader/DllLoader.h | 2 +-
+ xbmc/cores/DllLoader/ldt_keeper.c | 2 +-
+ xbmc/linux/PlatformDefs.h | 2 +-
+ xbmc/utils/fastmemcpy.c | 2 +-
+ xbmc/utils/fastmemcpy.h | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 1ce9039..0a56132 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -441,7 +441,7 @@ ifeq (@USE_ASAP_CODEC@,1)
+ endif
+ endif
+ $(MAKE) -C lib/stsound/StSoundLibrary
+-ifeq ($(or $(findstring powerpc, at ARCH@),$(findstring x86_64-linux, at ARCH@),$(findstring arm, @ARCH@),$(findstring freebsd, at ARCH@)),)
++ifeq ($(or $(findstring powerpc, at ARCH@),$(findstring x86_64-linux, at ARCH@),$(findstring arm, @ARCH@),$(findstring freebsd, at ARCH@),$(findstring mips, at ARCH@)),)
+ $(MAKE) -C lib/snesapu/SNES/SNESAPU
+ endif
+ imagelib: dllloader
+diff --git a/xbmc/cores/DllLoader/DllLoader.h b/xbmc/cores/DllLoader/DllLoader.h
+index c32c2b0..070aee6 100644
+--- a/xbmc/cores/DllLoader/DllLoader.h
++++ b/xbmc/cores/DllLoader/DllLoader.h
+@@ -23,7 +23,7 @@
+ #include "coffldr.h"
+ #include "LibraryLoader.h"
+
+-#if defined(__linux__) && !defined(__powerpc__) && !defined(__arm__)
++#if defined(__linux__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__mips__)
+ #define USE_LDT_KEEPER
+ #include "ldt_keeper.h"
+ #endif
+diff --git a/xbmc/cores/DllLoader/ldt_keeper.c b/xbmc/cores/DllLoader/ldt_keeper.c
+index 91c7a22..8af9a86 100644
+--- a/xbmc/cores/DllLoader/ldt_keeper.c
++++ b/xbmc/cores/DllLoader/ldt_keeper.c
+@@ -19,7 +19,7 @@
+ */
+
+ //#ifndef __powerpc__
+-#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__)
++#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__) && !defined(__mips__)
+
+ #include "ldt_keeper.h"
+
+diff --git a/xbmc/linux/PlatformDefs.h b/xbmc/linux/PlatformDefs.h
+index 1686961..4350075 100644
+--- a/xbmc/linux/PlatformDefs.h
++++ b/xbmc/linux/PlatformDefs.h
+@@ -161,7 +161,7 @@
+ #define __int64 long long
+ #define __uint64 unsigned long long
+
+-#if defined(__x86_64__) || defined(__powerpc__) || defined(__ppc__) || defined (__arm__) // should this be powerpc64 only?
++#if defined(__x86_64__) || defined(__powerpc__) || defined(__ppc__) || defined (__arm__) || defined(__mips__) // should this be powerpc64 only?
+ #define __stdcall
+ #else /* !__x86_64__ */
+ #define __stdcall __attribute__((__stdcall__))
+diff --git a/xbmc/utils/fastmemcpy.c b/xbmc/utils/fastmemcpy.c
+index d2a1d49..ec9019a 100644
+--- a/xbmc/utils/fastmemcpy.c
++++ b/xbmc/utils/fastmemcpy.c
+@@ -25,7 +25,7 @@
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+-#if !defined(TARGET_WINDOWS) && !defined(__ppc__) && !defined(__powerpc__) && !defined(__arm__)
++#if !defined(TARGET_WINDOWS) && !defined(__ppc__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__mips__)
+ #define HAVE_MMX2
+ #define HAVE_SSE
+
+diff --git a/xbmc/utils/fastmemcpy.h b/xbmc/utils/fastmemcpy.h
+index ce78d49..43f5904 100644
+--- a/xbmc/utils/fastmemcpy.h
++++ b/xbmc/utils/fastmemcpy.h
+@@ -23,7 +23,7 @@
+ extern "C" {
+ #endif
+
+-#if !defined(TARGET_WINDOWS) && !defined(__ppc__) && !defined(__powerpc__) && !defined(TARGET_ANDROID) && !defined(TARGET_DARWIN_IOS)
++#if !defined(TARGET_WINDOWS) && !defined(__ppc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(TARGET_ANDROID) && !defined(TARGET_DARWIN_IOS)
+ void * fast_memcpy(void * to, const void * from, size_t len);
+ //#define fast_memcpy memcpy
+ #else
+--
+2.1.1
+
diff --git a/debian/patches/0003-mips-add-atomics.patch b/debian/patches/0003-mips-add-atomics.patch
new file mode 100644
index 0000000..053b809
--- /dev/null
+++ b/debian/patches/0003-mips-add-atomics.patch
@@ -0,0 +1,230 @@
+From 36604dc16c9100c7e8fb2f567f8c443054d08522 Mon Sep 17 00:00:00 2001
+From: theuni <theuni-nospam- at xbmc.org>
+Date: Fri, 30 Sep 2011 06:17:00 -0400
+Subject: [PATCH 3/6] mips: add atomics
+
+Most taken from the Linux kernel.
+
+Updated for Helix by Balint Reczey
+---
+ xbmc/threads/Atomics.cpp | 35 ++++++--------
+ xbmc/threads/MipsAtomics.h | 115 +++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 130 insertions(+), 20 deletions(-)
+ create mode 100644 xbmc/threads/MipsAtomics.h
+
+diff --git a/xbmc/threads/Atomics.cpp b/xbmc/threads/Atomics.cpp
+index 12d3e56..ca5d981 100644
+--- a/xbmc/threads/Atomics.cpp
++++ b/xbmc/threads/Atomics.cpp
+@@ -20,6 +20,12 @@
+
+ #include "Atomics.h"
+ #include "system.h"
++
++#if defined(__mips__)
++#include "MipsAtomics.h"
++pthread_mutex_t cmpxchg_mutex = PTHREAD_MUTEX_INITIALIZER;
++#endif
++
+ ///////////////////////////////////////////////////////////////////////////
+ // 32-bit atomic compare-and-swap
+ // Returns previous value of *pAddr
+@@ -63,10 +69,7 @@ long cas(volatile long *pAddr, long expectedVal, long swapVal)
+ return prev;
+
+ #elif defined(__mips__)
+-// TODO:
+- unsigned int prev;
+- #error atomic cas undefined for mips
+- return prev;
++ return cmpxchg32(pAddr, expectedVal, swapVal);
+
+ #elif defined(TARGET_WINDOWS)
+ long prev;
+@@ -103,11 +106,14 @@ long cas(volatile long *pAddr, long expectedVal, long swapVal)
+ ///////////////////////////////////////////////////////////////////////////
+ long long cas2(volatile long long* pAddr, long long expectedVal, long long swapVal)
+ {
+-#if defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || defined(__mips__) // PowerPC, ARM, and MIPS
++#if defined(__ppc__) || defined(__powerpc__) || defined(__arm__)// PowerPC and ARM
+ // Not available/required
+ // Hack to allow compilation
+ throw "cas2 is not implemented";
+
++#elif defined(__mips__)
++ return cmpxchg64(pAddr, expectedVal, swapVal);
++
+ #elif defined(TARGET_WINDOWS)
+ long long prev;
+ __asm
+@@ -183,10 +189,7 @@ long AtomicIncrement(volatile long* pAddr)
+ return val;
+
+ #elif defined(__mips__)
+-// TODO:
+- long val;
+- #error AtomicIncrement undefined for mips
+- return val;
++ return atomic_add(1, pAddr);
+
+ #elif defined(TARGET_WINDOWS)
+ long val;
+@@ -261,10 +264,7 @@ long AtomicAdd(volatile long* pAddr, long amount)
+ return val;
+
+ #elif defined(__mips__)
+-// TODO:
+- long val;
+- #error AtomicAdd undefined for mips
+- return val;
++ return atomic_add(amount, pAddr);
+
+ #elif defined(TARGET_WINDOWS)
+ __asm
+@@ -339,10 +339,7 @@ long AtomicDecrement(volatile long* pAddr)
+ return val;
+
+ #elif defined(__mips__)
+-// TODO:
+- long val;
+- #error AtomicDecrement undefined for mips
+- return val;
++ return atomic_sub(1, pAddr);
+
+ #elif defined(TARGET_WINDOWS)
+ long val;
+@@ -418,9 +415,7 @@ long AtomicSubtract(volatile long* pAddr, long amount)
+ return val;
+
+ #elif defined(__mips__)
+-// TODO:
+- #error AtomicSubtract undefined for mips
+- return val;
++ return atomic_sub(amount, pAddr);
+
+ #elif defined(TARGET_WINDOWS)
+ amount *= -1;
+diff --git a/xbmc/threads/MipsAtomics.h b/xbmc/threads/MipsAtomics.h
+new file mode 100644
+index 0000000..8ff69b6
+--- /dev/null
++++ b/xbmc/threads/MipsAtomics.h
+@@ -0,0 +1,115 @@
++/*
++ * Copyright (C) 2005-2011 Team XBMC
++ * http://www.xbmc.org
++ *
++ * This Program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This Program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with XBMC; see the file COPYING. If not, write to
++ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
++ * http://www.gnu.org/copyleft/gpl.html
++ *
++ * Copyright (C) 2003, 06, 07 by Ralf Baechle (ralf at linux-mips.org)
++ *
++ * Most of this file was borrowed from the linux kernel.
++ */
++
++#ifndef __ATOMIC_MIPS_H_
++#define __ATOMIC_MIPS_H_
++
++#include <inttypes.h>
++#include <pthread.h>
++
++extern pthread_mutex_t cmpxchg_mutex;
++
++static inline long cmpxchg32(volatile long *m, long oldval, long newval)
++{
++ long retval;
++ __asm__ __volatile__( \
++ " .set push \n" \
++ " .set noat \n" \
++ " .set mips3 \n" \
++ "1: ll %0, %2 # __cmpxchg_asm \n" \
++ " bne %0, %z3, 2f \n" \
++ " .set mips0 \n" \
++ " move $1, %z4 \n" \
++ " .set mips3 \n" \
++ " sc $1, %1 \n" \
++ " beqz $1, 3f \n" \
++ "2: \n" \
++ " .subsection 2 \n" \
++ "3: b 1b \n" \
++ " .previous \n" \
++ " .set pop \n" \
++ : "=&r" (retval), "=R" (*m) \
++ : "R" (*m), "Jr" (oldval), "Jr" (newval) \
++ : "memory"); \
++
++ return retval;
++}
++
++
++static inline long long cmpxchg64(volatile long long *ptr,
++ long long oldval, long long newval)
++{
++ long long prev;
++
++ pthread_mutex_lock(&cmpxchg_mutex);
++ prev = *(long long *)ptr;
++ if (prev == oldval)
++ *(long long *)ptr = newval;
++ pthread_mutex_unlock(&cmpxchg_mutex);
++ return prev;
++}
++
++
++static __inline__ long atomic_add(int i, volatile long* v)
++{
++ long temp;
++
++ __asm__ __volatile__(
++ " .set mips3 \n"
++ "1: ll %0, %1 # atomic_add \n"
++ " addu %0, %2 \n"
++ " sc %0, %1 \n"
++ " beqz %0, 2f \n"
++ " .subsection 2 \n"
++ "2: b 1b \n"
++ " .previous \n"
++ " .set mips0 \n"
++ : "=&r" (temp), "=m" (*v)
++ : "Ir" (i), "m" (*v));
++
++ return temp;
++}
++
++static __inline__ long atomic_sub(int i, volatile long* v)
++{
++ long temp;
++
++ __asm__ __volatile__(
++ " .set mips3 \n"
++ "1: ll %0, %1 # atomic_sub \n"
++ " subu %0, %2 \n"
++ " sc %0, %1 \n"
++ " beqz %0, 2f \n"
++ " .subsection 2 \n"
++ "2: b 1b \n"
++ " .previous \n"
++ " .set mips0 \n"
++ : "=&r" (temp), "=m" (*v)
++ : "Ir" (i), "m" (*v));
++
++ return temp;
++}
++
++
++#endif
+--
+2.1.1
+
diff --git a/debian/patches/0004-mips-Add-configure-option-for-mips-and-mipsel.patch b/debian/patches/0004-mips-Add-configure-option-for-mips-and-mipsel.patch
new file mode 100644
index 0000000..b196a0c
--- /dev/null
+++ b/debian/patches/0004-mips-Add-configure-option-for-mips-and-mipsel.patch
@@ -0,0 +1,48 @@
+From 33b84cf0af7f42c8cbe6532905b89a94bf1cb094 Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Fri, 30 Sep 2011 06:22:51 -0400
+Subject: [PATCH 4/6] mips: Add configure option for mips and mipsel
+
+---
+ configure.in | 10 ++++++++++
+ m4/xbmc_arch.m4 | 3 +++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/configure.in b/configure.in
+index fe2e882..62a6387 100644
+--- a/configure.in
++++ b/configure.in
+@@ -691,6 +691,16 @@ case $host in
+ use_wayland=no
+ build_shared_lib=yes
+ ;;
++ mips*-*-linux-gnu*)
++ ARCH="mips"
++ use_arch="mips"
++ use_joystick=no
++ use_gles=no
++ use_gl=yes
++ use_sdl=yes
++ use_wayland=no
++ USE_STATIC_FFMPEG=1
++ ;;
+ *)
+ AC_MSG_ERROR(unsupported host ($host))
+ esac
+diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
+index 5bcdd81..f9ab5cd 100644
+--- a/m4/xbmc_arch.m4
++++ b/m4/xbmc_arch.m4
+@@ -32,6 +32,9 @@ case $host in
+ arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ ;;
++ mips*-*-linux-gnu*|mips*-*-linux-uclibc*)
++ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
++ ;;
+ *-*linux-android*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID")
+ ;;
+--
+2.1.1
+
diff --git a/debian/patches/0005-mips-Don-t-use-ASM-rounding-on-MIPS.patch b/debian/patches/0005-mips-Don-t-use-ASM-rounding-on-MIPS.patch
new file mode 100644
index 0000000..2caeb49
--- /dev/null
+++ b/debian/patches/0005-mips-Don-t-use-ASM-rounding-on-MIPS.patch
@@ -0,0 +1,24 @@
+From 4e15d0d88c014ad6bcf1243e9c28053aac4da5b9 Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Mon, 13 Oct 2014 17:10:40 +0100
+Subject: [PATCH 5/6] mips: Don't use ASM rounding on MIPS
+
+---
+ xbmc/utils/MathUtils.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/xbmc/utils/MathUtils.h b/xbmc/utils/MathUtils.h
+index ea32f37..82165f2 100644
+--- a/xbmc/utils/MathUtils.h
++++ b/xbmc/utils/MathUtils.h
+@@ -34,6 +34,7 @@
+
+ #if defined(__ppc__) || \
+ defined(__powerpc__) || \
++ defined(__mips__) || \
+ defined(__arm__)
+ #define DISABLE_MATHUTILS_ASM_ROUND_INT
+ #endif
+--
+2.1.1
+
diff --git a/debian/patches/0006-mips-Fix-build-with-using-OpenGL-rendering.patch b/debian/patches/0006-mips-Fix-build-with-using-OpenGL-rendering.patch
new file mode 100644
index 0000000..3501d85
--- /dev/null
+++ b/debian/patches/0006-mips-Fix-build-with-using-OpenGL-rendering.patch
@@ -0,0 +1,25 @@
+From b9ca26bc35295ae72f46ec5a716c550c11857d41 Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Mon, 20 Oct 2014 17:01:51 +0200
+Subject: [PATCH 6/6] mips: Fix build with using OpenGL rendering
+
+---
+ xbmc/cores/VideoRenderers/LinuxRendererGL.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h
+index e74b01e..2f757d8 100644
+--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h
++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h
+@@ -325,7 +325,7 @@ protected:
+
+
+ inline int NP2( unsigned x ) {
+-#if defined(TARGET_POSIX) && !defined(__POWERPC__) && !defined(__PPC__) && !defined(__arm__)
++#if defined(TARGET_POSIX) && !defined(__POWERPC__) && !defined(__PPC__) && !defined(__arm__) && !defined(__mips__)
+ // If there are any issues compiling this, just append a ' && 0'
+ // to the above to make it '#if defined(TARGET_POSIX) && 0'
+
+--
+2.1.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 664bc40..ca1b27d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,9 @@
+0001-linux-Check-for-Logind-first-then-Kit-s-with-UPower-.patch
+0002-mips-add-guards.patch
+0003-mips-add-atomics.patch
+0004-mips-Add-configure-option-for-mips-and-mipsel.patch
+0005-mips-Don-t-use-ASM-rounding-on-MIPS.patch
+0006-mips-Fix-build-with-using-OpenGL-rendering.patch
01-Stop-using-internal-ffmpeg-functions.patch
03-privacy.patch
04-differentiate-from-vanilla-Kodi.patch
--
kodi packaging
More information about the pkg-multimedia-commits
mailing list