diff options
author | Hunter Sezen <orbea@fredslev.dk> | 2018-12-07 22:32:12 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-12-07 22:32:12 +0700 |
commit | 9f21d197105c7608ee9ba9ff11355a5fc2cf562a (patch) | |
tree | 38b2fe1cb7c41d315ab7de810d5c06d44ed25fc4 /games | |
parent | 37255c73c2ed1a969fc34b9adc7c6d6bae737e45 (diff) | |
download | slackbuilds-9f21d197105c7608ee9ba9ff11355a5fc2cf562a.tar.gz |
games/RetroArch: Fix KMS mode bug.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games')
-rw-r--r-- | games/RetroArch/RetroArch.SlackBuild | 12 | ||||
-rw-r--r-- | games/RetroArch/kms.patch | 65 |
2 files changed, 74 insertions, 3 deletions
diff --git a/games/RetroArch/RetroArch.SlackBuild b/games/RetroArch/RetroArch.SlackBuild index 861886605d..892174ec35 100644 --- a/games/RetroArch/RetroArch.SlackBuild +++ b/games/RetroArch/RetroArch.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=RetroArch VERSION=${VERSION:-1.7.5} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -123,6 +123,12 @@ sed -e "s|# audio_filter_dir =|audio_filter_dir = ${filter_dir}/audio|" \ -e "$SED_CORE;$SED_INFO;$SED_MENU" \ -i retroarch.cfg +# Fix KMS with OpenGL. +# https://github.com/libretro/RetroArch/commit/5898f3e5d22b930a1050a59b61e98ecd07dd6977 +# https://github.com/libretro/RetroArch/issues/7119 +# https://github.com/libretro/RetroArch/pull/7708 +patch -p1 < $CWD/kms.patch + # Set $lib to a portable array eval "set -- $lib" @@ -161,8 +167,8 @@ done mv $PKG/etc/retroarch.cfg $PKG/etc/retroarch.cfg.new if [ $DEBUG = 0 ]; then - find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | + grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true fi find $PKG/usr/man -type f -exec gzip -9 {} \; diff --git a/games/RetroArch/kms.patch b/games/RetroArch/kms.patch new file mode 100644 index 0000000000..28ebb1e15e --- /dev/null +++ b/games/RetroArch/kms.patch @@ -0,0 +1,65 @@ +From 5898f3e5d22b930a1050a59b61e98ecd07dd6977 Mon Sep 17 00:00:00 2001 +From: orbea <orbea@fredslev.dk> +Date: Thu, 6 Dec 2018 08:31:01 -0800 +Subject: [PATCH] Fix KMS with OpenGL. + +All credit for this patch goes to dtsarr. + +Fixes https://github.com/libretro/RetroArch/issues/7119 +--- + gfx/common/egl_common.c | 41 ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 40 insertions(+), 1 deletion(-) + +diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c +index f3c579af21..ee7bca84b6 100644 +--- a/gfx/common/egl_common.c ++++ b/gfx/common/egl_common.c +@@ -329,8 +329,47 @@ bool egl_init_context(egl_ctx_data_t *egl, + + RARCH_LOG("[EGL]: EGL version: %d.%d\n", *major, *minor); + +- if (!eglChooseConfig(egl->dpy, attrib_ptr, &egl->config, 1, n) || *n != 1) ++ EGLint count = 0; ++ EGLint matched = 0; ++ EGLConfig *configs; ++ int config_index = -1; ++ ++ if (!eglGetConfigs(egl->dpy, NULL, 0, &count) || count < 1) ++ { ++ RARCH_ERR("[EGL]: No cofigs to choose from.\n"); ++ return false; ++ } ++ ++ configs = malloc(count * sizeof *configs); ++ if (!configs) return false; ++ ++ if (!eglChooseConfig(egl->dpy, attrib_ptr, configs, count, &matched) || !matched) ++ { ++ RARCH_ERR("[EGL]: No EGL configs with appropriate attributes.\n"); + return false; ++ } ++ ++ int i; ++ EGLint id; ++ ++ for (i = 0; i < count; ++i) ++ { ++ if (!eglGetConfigAttrib(egl->dpy, configs[i], EGL_NATIVE_VISUAL_ID, &id)) ++ continue; ++ ++ if (id == GBM_FORMAT_XRGB8888) break; ++ } ++ ++ if (id != GBM_FORMAT_XRGB8888) ++ { ++ RARCH_ERR("[EGL]: No EGL configs with format XRGB8888\n"); ++ return false; ++ } ++ ++ config_index = i; ++ if (config_index != -1) egl->config = configs[config_index]; ++ ++ free(configs); + + egl->major = g_egl_major; + egl->minor = g_egl_minor; |