Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| From d75b6d3bc893a313876fa884a2ef674fa282622f Mon Sep 17 00:00:00 2001 | |
| From: Ivan Popovic <ivan.popovic@seavus.com> | |
| Date: Mon, 23 Nov 2015 13:07:43 +0000 | |
| Subject: [PATCH] Patch for DragonBoard410c Kodi build | |
| --- | |
| configure.ac | 14 ++++++++++- | |
| m4/xbmc_arch.m4 | 6 +++++ | |
| tools/depends/configure.ac | 29 ++++++++++++++++++--- | |
| xbmc/Application.cpp | 2 +- | |
| xbmc/cores/DllLoader/DllLoader.h | 2 +- | |
| xbmc/cores/DllLoader/ldt_keeper.c | 2 +- | |
| xbmc/cores/VideoRenderers/LinuxRendererGL.h | 2 +- | |
| xbmc/guilib/GUIFontTTFGL.cpp | 4 ++- | |
| xbmc/linux/PlatformDefs.h | 2 +- | |
| xbmc/threads/Atomics.cpp | 2 +- | |
| xbmc/utils/CPUInfo.cpp | 2 +- | |
| xbmc/utils/MathUtils.h | 3 ++- | |
| xbmc/windowing/X11/WinSystemX11.cpp | 39 +++++++++++++++++++++-------- | |
| xbmc/windows/GUIWindowSystemInfo.cpp | 6 ++--- | |
| 14 files changed, 89 insertions(+), 26 deletions(-) | |
| diff --git a/configure.ac b/configure.ac | |
| index 603f04f..0d94834 100644 | |
| --- a/configure.ac | |
| +++ b/configure.ac | |
| @@ -656,6 +656,18 @@ case $host in | |
| use_wayland=no | |
| USE_STATIC_FFMPEG=1 | |
| ;; | |
| + aarch64-unknown-linux-gnu) | |
| + target_platform=target_linux | |
| + ARCH="aarch64" | |
| + use_arch="aarch64" | |
| + use_cpu=cortex-a53 | |
| + use_joystick=no | |
| + use_neon=yes | |
| + use_gles=yes | |
| + use_gl=no | |
| + use_wayland=no | |
| + USE_STATIC_FFMPEG=1 | |
| + ;; | |
| arm*-*linux-android*) | |
| target_platform=target_android | |
| use_arch="arm" | |
| @@ -1893,7 +1905,7 @@ if test "$build_vendor" != "apple" ; then | |
| fi | |
| fi | |
| -if test "$use_arch" != "arm" ; then | |
| +if test "$use_arch" != "arm" || test "$use_arch" != "aarch64"; then | |
| AC_CHECK_PROG(HAVE_CMAKE,cmake,"yes","no",) | |
| if test "$HAVE_CMAKE" = "no" ; then | |
| AC_MSG_ERROR($missing_program) | |
| diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4 | |
| index 0b66a82..1657ec5 100644 | |
| --- a/m4/xbmc_arch.m4 | |
| +++ b/m4/xbmc_arch.m4 | |
| @@ -26,6 +26,9 @@ case $build in | |
| arm*-*-linux-gnu*|arm*-*-linux-uclibc*) | |
| AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX") | |
| ;; | |
| + aarch64-*-linux-gnu*) | |
| + AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX") | |
| + ;; | |
| *) | |
| AC_MSG_ERROR(unsupported native build platform: $build) | |
| esac | |
| @@ -63,6 +66,9 @@ case $host in | |
| arm*-*-linux-gnu*|arm*-*-linux-uclibc*) | |
| AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX") | |
| ;; | |
| + aarch64-*-linux-gnu*) | |
| + 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") | |
| ;; | |
| diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac | |
| index 12935e3..42c5ec8 100644 | |
| --- a/tools/depends/configure.ac | |
| +++ b/tools/depends/configure.ac | |
| @@ -100,6 +100,9 @@ case $build in | |
| arm*-*-linux-gnu*|arm*-*-linux-uclibc*) | |
| build_os="linux" | |
| ;; | |
| + aarch64-unknown-linux-gnu) | |
| + build_os="linux" | |
| + ;; | |
| *i686*-linux-gnu*|i*86*-*-linux-uclibc*) | |
| build_os="linux" | |
| ;; | |
| @@ -110,10 +113,9 @@ case $build in | |
| build_os="osx" | |
| ;; | |
| *) | |
| - AC_MSG_ERROR(unsupported native build platform: $build) | |
| + AC_MSG_ERROR(unsupported native build platform PI: $build) | |
| esac | |
| - | |
| case $host in | |
| arm*-*linux-android*) | |
| if test "x$use_cpu" = "xauto"; then | |
| @@ -158,6 +160,27 @@ case $host in | |
| platform_os="linux" | |
| fi | |
| ;; | |
| + aarch64-unknown-linux-gnu) | |
| + use_arch="aarch64" | |
| + use_cpu="arm64" | |
| + ARCH="aarch64" | |
| + platform_os="linux" | |
| + use_host="aarch64-unknown-linux-gnu" | |
| + deps_dir="$use_host" | |
| + host_cpu="armv8l" | |
| + if test "$use_platform" = "auto"; then | |
| + if test "x$use_cpu" = "xauto"; then | |
| + use_cpu=$host_cpu | |
| + fi | |
| + use_toolchain="${use_toolchain:-/usr}" | |
| + platform_cflags="-Os -fPIC -DPIC" | |
| + # Add platform flags for snapdragon 410 | |
| + platform_cflags+=" -march=armv8-a -mtune=cortex-a53 -mfpu=neon -mcpu=cortex-a53" | |
| + platform_ldflags="-Wl,-rpath-link=$prefix/$deps_dir/lib" | |
| + platform_cxxflags="$platform_cflags" | |
| + platform_os="linux" | |
| + fi | |
| + ;; | |
| *i686*-linux-gnu*|i*86*-*-linux-uclibc*) | |
| use_cpu=$host_cpu | |
| use_toolchain="${use_toolchain:-/usr}" | |
| @@ -299,7 +322,7 @@ case $host in | |
| tool_dir=buildtools-native; | |
| ;; | |
| *) | |
| - AC_MSG_ERROR(unsupported host ($use_host)) | |
| + AC_MSG_ERROR(>>>unsupported host ($use_host)) | |
| esac | |
| if test "$use_platform" = "raspberry-pi"; then | |
| diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp | |
| index f2abf2a..ae6c1f5 100644 | |
| --- a/xbmc/Application.cpp | |
| +++ b/xbmc/Application.cpp | |
| @@ -563,7 +563,7 @@ bool CApplication::Create() | |
| CLog::Log(LOGNOTICE, "External storage path = %s; status = %s", extstorage.c_str(), extready ? "ok" : "nok"); | |
| #endif | |
| -#if defined(__arm__) | |
| +#if defined(__arm__) || defined(__aarch64__) | |
| if (g_cpuInfo.GetCPUFeatures() & CPU_FEATURE_NEON) | |
| CLog::Log(LOGNOTICE, "ARM Features: Neon enabled"); | |
| else | |
| diff --git a/xbmc/cores/DllLoader/DllLoader.h b/xbmc/cores/DllLoader/DllLoader.h | |
| index 070aee6..eb3c54c 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__) && !defined(__mips__) | |
| +#if defined(__linux__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__aarch64__) && !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 8af9a86..1c0cdb2 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__) && !defined(__mips__) | |
| +#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__) && !defined(__mips__) && !defined(__aarch64__) | |
| #include "ldt_keeper.h" | |
| diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h | |
| index fcdea8d..1cdeea9 100644 | |
| --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h | |
| +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h | |
| @@ -323,7 +323,7 @@ protected: | |
| inline int NP2( unsigned x ) { | |
| -#if defined(TARGET_POSIX) && !defined(__POWERPC__) && !defined(__PPC__) && !defined(__arm__) && !defined(__mips__) | |
| +#if defined(TARGET_POSIX) && !defined(__POWERPC__) && !defined(__PPC__) && !defined(__arm__) && !defined(__aarch64__) && !defined(__mips__) | |
| // If there are any issues compiling this, just append a ' && 0' | |
| // to the above to make it '#if defined(TARGET_POSIX) && 0' | |
| diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp | |
| index d19a2e0..5d11a0b 100644 | |
| --- a/xbmc/guilib/GUIFontTTFGL.cpp | |
| +++ b/xbmc/guilib/GUIFontTTFGL.cpp | |
| @@ -232,7 +232,9 @@ void CGUIFontTTFGL::LastEnd() | |
| glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glMatrixModview.Get()); | |
| // Bind the buffer to the OpenGL context's GL_ARRAY_BUFFER binding point | |
| - glBindBuffer(GL_ARRAY_BUFFER, (GLuint) m_vertexTrans[i].vertexBuffer->bufferHandle); | |
| +// Workaround for aarch64 | |
| +// glBindBuffer(GL_ARRAY_BUFFER, (GLuint) m_vertexTrans[i].vertexBuffer->bufferHandle); | |
| + glBindBuffer(GL_ARRAY_BUFFER, *((GLuint*) m_vertexTrans[i].vertexBuffer->bufferHandle)); | |
| // Do the actual drawing operation, split into groups of characters no | |
| // larger than the pre-determined size of the element array | |
| diff --git a/xbmc/linux/PlatformDefs.h b/xbmc/linux/PlatformDefs.h | |
| index 4350075..754de5c 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__) || defined(__mips__) // should this be powerpc64 only? | |
| +#if defined(__x86_64__) || defined(__powerpc__) || defined(__ppc__) || defined (__arm__) || defined(__mips__) || defined(__aarch64__) // should this be powerpc64 only? | |
| #define __stdcall | |
| #else /* !__x86_64__ */ | |
| #define __stdcall __attribute__((__stdcall__)) | |
| diff --git a/xbmc/threads/Atomics.cpp b/xbmc/threads/Atomics.cpp | |
| index 417b2b6..c172867 100644 | |
| --- a/xbmc/threads/Atomics.cpp | |
| +++ b/xbmc/threads/Atomics.cpp | |
| @@ -106,7 +106,7 @@ 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__)// PowerPC and ARM | |
| +#if defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || defined(__aarch64__) // PowerPC and ARM | |
| // Not available/required | |
| // Hack to allow compilation | |
| throw "cas2 is not implemented"; | |
| diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp | |
| index 660d355..5d4cf50 100644 | |
| --- a/xbmc/utils/CPUInfo.cpp | |
| +++ b/xbmc/utils/CPUInfo.cpp | |
| @@ -912,7 +912,7 @@ void CCPUInfo::ReadCPUFeatures() | |
| #endif | |
| #elif defined(LINUX) | |
| // empty on purpose, the implementation is in the constructor | |
| -#elif !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__) | |
| +#elif !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__) && !defined(__aarch64__) | |
| m_cpuFeatures |= CPU_FEATURE_MMX; | |
| #elif defined(__powerpc__) || defined(__ppc__) | |
| m_cpuFeatures |= CPU_FEATURE_ALTIVEC; | |
| diff --git a/xbmc/utils/MathUtils.h b/xbmc/utils/MathUtils.h | |
| index 21b6a37..c7a6159 100644 | |
| --- a/xbmc/utils/MathUtils.h | |
| +++ b/xbmc/utils/MathUtils.h | |
| @@ -35,7 +35,8 @@ | |
| #if defined(__ppc__) || \ | |
| defined(__powerpc__) || \ | |
| defined(__mips__) || \ | |
| - defined(__arm__) | |
| + defined(__arm__) || \ | |
| + defined(__aarch64__) | |
| #define DISABLE_MATHUTILS_ASM_ROUND_INT | |
| #endif | |
| diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp | |
| index 27da163..0617726 100644 | |
| --- a/xbmc/windowing/X11/WinSystemX11.cpp | |
| +++ b/xbmc/windowing/X11/WinSystemX11.cpp | |
| @@ -504,6 +504,7 @@ EGLConfig getEGLConfig(EGLDisplay eglDisplay, XVisualInfo *vInfo) | |
| CLog::Log(LOGERROR, "Failed to query number of egl configs"); | |
| return EGL_NO_CONFIG; | |
| } | |
| + | |
| if (numConfigs == 0) | |
| { | |
| CLog::Log(LOGERROR, "No suitable egl configs found"); | |
| @@ -531,6 +532,7 @@ EGLConfig getEGLConfig(EGLDisplay eglDisplay, XVisualInfo *vInfo) | |
| CLog::Log(LOGERROR, "Failed to query EGL_NATIVE_VISUAL_ID for egl config."); | |
| break; | |
| } | |
| + CLog::Log(LOGERROR, "value [%d] visualID [%d]", value, vInfo->visualid); | |
| if (value == (EGLint)vInfo->visualid) { | |
| eglConfig = eglConfigs[i]; | |
| break; | |
| @@ -574,16 +576,34 @@ bool CWinSystemX11::IsSuitableVisual(XVisualInfo *vInfo) | |
| EGLint value; | |
| if (!eglGetConfigAttrib(m_eglDisplay, config, EGL_RED_SIZE, &value) || value < 8) | |
| - return false; | |
| + { | |
| + CLog::Log(LOGERROR, "wrong EGL_RED_SIZE value [%d]", value); | |
| + return false; | |
| + } | |
| if (!eglGetConfigAttrib(m_eglDisplay, config, EGL_GREEN_SIZE, &value) || value < 8) | |
| - return false; | |
| + { | |
| + CLog::Log(LOGERROR, "wrong EGL_GREEN_SIZE value [%d]", value); | |
| + return false; | |
| + } | |
| if (!eglGetConfigAttrib(m_eglDisplay, config, EGL_BLUE_SIZE, &value) || value < 8) | |
| - return false; | |
| + { | |
| + CLog::Log(LOGERROR, "wrong EGL_BLUE_SIZE value [%d]", value); | |
| + return false; | |
| + } | |
| +/* HACK: Reported EGL_ALPHA_SIZE is 0, hence Kodi fails to initialize graphics | |
| if (!eglGetConfigAttrib(m_eglDisplay, config, EGL_ALPHA_SIZE, &value) || value < 8) | |
| - return false; | |
| + { | |
| + CLog::Log(LOGERROR, "wrong EGL_ALPHA_SIZE value [%d]", value); | |
| + return false; | |
| + } | |
| +*/ | |
| + | |
| if (!eglGetConfigAttrib(m_eglDisplay, config, EGL_DEPTH_SIZE, &value) || value < 24) | |
| - return false; | |
| - | |
| + { | |
| + CLog::Log(LOGERROR, "wrong EGL_DEPTH_SIZE value [%d]", value); | |
| + return false; | |
| + } | |
| + | |
| #endif | |
| return true; | |
| } | |
| @@ -630,10 +650,10 @@ bool CWinSystemX11::RefreshGlxContext(bool force) | |
| vMask.visualid = XVisualIDFromVisual(winAttr.visual); | |
| vInfo = XGetVisualInfo(m_dpy, VisualScreenMask | VisualIDMask, &vMask, &availableVisuals); | |
| if (!vInfo) | |
| - CLog::Log(LOGWARNING, "Failed to get VisualInfo of SDL visual 0x%x", (unsigned) vMask.visualid); | |
| + CLog::Log(LOGERROR, "Failed to get VisualInfo of SDL visual 0x%x", (unsigned) vMask.visualid); | |
| else if(!IsSuitableVisual(vInfo)) | |
| { | |
| - CLog::Log(LOGWARNING, "Visual 0x%x of the SDL window is not suitable, looking for another one...", | |
| + CLog::Log(LOGERROR, "Visual 0x%x of the SDL window is not suitable, looking for another one...", | |
| (unsigned) vInfo->visualid); | |
| vMask.depth = vInfo->depth; | |
| XFree(vInfo); | |
| @@ -641,7 +661,7 @@ bool CWinSystemX11::RefreshGlxContext(bool force) | |
| } | |
| } | |
| else | |
| - CLog::Log(LOGWARNING, "Failed to get SDL window attributes"); | |
| + CLog::Log(LOGERROR, "Failed to get SDL window attributes"); | |
| /* As per glXMakeCurrent documentation, we have to use the same visual as | |
| m_glWindow. Since that was not suitable for use, we try to use another | |
| @@ -664,7 +684,6 @@ bool CWinSystemX11::RefreshGlxContext(bool force) | |
| if (vInfo) | |
| { | |
| - CLog::Log(LOGNOTICE, "Using visual 0x%x", (unsigned) vInfo->visualid); | |
| #if defined(HAS_GLX) | |
| if (m_glContext) | |
| { | |
| diff --git a/xbmc/windows/GUIWindowSystemInfo.cpp b/xbmc/windows/GUIWindowSystemInfo.cpp | |
| index 8941b87..5ab4c63 100644 | |
| --- a/xbmc/windows/GUIWindowSystemInfo.cpp | |
| +++ b/xbmc/windows/GUIWindowSystemInfo.cpp | |
| @@ -139,7 +139,7 @@ void CGUIWindowSystemInfo::FrameMove() | |
| #else | |
| SetControlLabel(i++, "%s %s", 22024, SYSTEM_RENDER_VERSION); | |
| #endif | |
| -#if !defined(__arm__) && !defined(HAS_DX) | |
| +#if !defined(__arm__) && !defined(__aarch64__) && !defined(HAS_DX) | |
| SetControlLabel(i++, "%s %s", 22010, SYSTEM_GPU_TEMPERATURE); | |
| #endif | |
| } | |
| @@ -148,7 +148,7 @@ void CGUIWindowSystemInfo::FrameMove() | |
| { | |
| SET_CONTROL_LABEL(40,g_localizeStrings.Get(20160)); | |
| SET_CONTROL_LABEL(i++, g_sysinfo.GetCPUModel()); | |
| -#if defined(__arm__) && defined(TARGET_LINUX) | |
| +#if (defined(__arm__) || defined(__aarch64__)) && defined(TARGET_LINUX) | |
| SET_CONTROL_LABEL(i++, g_sysinfo.GetCPUBogoMips()); | |
| SET_CONTROL_LABEL(i++, g_sysinfo.GetCPUHardware()); | |
| SET_CONTROL_LABEL(i++, g_sysinfo.GetCPURevision()); | |
| @@ -158,7 +158,7 @@ void CGUIWindowSystemInfo::FrameMove() | |
| #if !defined(__arm__) || defined(TARGET_RASPBERRY_PI) | |
| SetControlLabel(i++, "%s %s", 13284, SYSTEM_CPUFREQUENCY); | |
| #endif | |
| -#if !(defined(__arm__) && defined(TARGET_LINUX)) | |
| +#if !(defined(__arm__) && !defined(__aarch64__) && defined(TARGET_LINUX)) | |
| SetControlLabel(i++, "%s %s", 13271, SYSTEM_CPU_USAGE); | |
| #endif | |
| i++; // empty line | |
| -- | |
| 2.1.4 | |