Skip to content

Commit

Permalink
rk3588: WIP rkr-5 bsp kernel update
Browse files Browse the repository at this point in the history
Issues on Ace:
- No sound, not from speaker, not from headphones
- Vulkan not working, ignore for now as we should move to g24 blob
- One dmesg horror related to pinctrl, possibly a dts issue
  • Loading branch information
sydarn committed Feb 1, 2025
1 parent c09c4b5 commit 26409e1
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 131,644 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,32 @@ diff -rupN dolphin.orig/Source/Core/Common/GL/GLInterface/WGL.h dolphin/Source/C

void Swap() override;
void SwapInterval(int interval) override;
diff -rupN dolphin.orig/Source/Core/Common/WindowSystemInfo.h dolphin/Source/Core/Common/WindowSystemInfo.h
--- dolphin.orig/Source/Core/Common/WindowSystemInfo.h 2024-03-05 04:05:26.578982537 +0000
+++ dolphin/Source/Core/Common/WindowSystemInfo.h 2024-03-05 04:06:08.240295843 +0000
diff --git a/Source/Core/Common/WindowSystemInfo.h b/Source/Core/Common/WindowSystemInfo.h
index 8936ad1a02..ae7279ed83 100644
--- a/Source/Core/Common/WindowSystemInfo.h
+++ b/Source/Core/Common/WindowSystemInfo.h
@@ -19,9 +19,10 @@ struct WindowSystemInfo
{
WindowSystemInfo() = default;
WindowSystemInfo(WindowSystemType type_, void* display_connection_, void* render_window_,
- void* render_surface_)
+ void* render_surface_, int width_, int height_)
: type(type_), display_connection(display_connection_), render_window(render_window_),
- render_surface(render_surface_)
+ render_surface(render_surface_), render_surface_width(width_),
+ render_surface_height(height_)
{
}

@@ -40,7 +40,11 @@ struct WindowSystemInfo
// This is kept seperate as input may require a different handle to rendering, and
// during video backend startup the surface pointer may change (MoltenVK).
void* render_surface = nullptr;
-
+
+ // Dimensions of the render surface, if this is determined by the frontend.
+ int render_surface_width = 0;
+ int render_surface_height = 0;
+ int render_surface_width = -1;
+ int render_surface_height = -1;
+
// Scale of the render surface. For hidpi systems, this will be >1.
float render_surface_scale = 1.0f;
Expand Down Expand Up @@ -492,15 +506,17 @@ diff -rupN dolphin.orig/Source/Core/Core/ConfigManager.h dolphin/Source/Core/Cor
std::string m_game_id;
std::string m_gametdb_id;
std::string m_title_name;
diff -rupN dolphin.orig/Source/Core/Core/Core.cpp dolphin/Source/Core/Core/Core.cpp
--- dolphin.orig/Source/Core/Core/Core.cpp 2024-03-05 04:05:26.578982537 +0000
+++ dolphin/Source/Core/Core/Core.cpp 2024-03-05 04:06:08.240295843 +0000
@@ -474,6 +474,8 @@ static void EmuThread(std::unique_ptr<Bo
diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp
index 7757414834..3688961e25 100644
--- a/Source/Core/Core/Core.cpp
+++ b/Source/Core/Core/Core.cpp
@@ -473,7 +473,8 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
// Switch the window used for inputs to the render window. This way, the cursor position
// is relative to the render window, instead of the main window.
ASSERT(g_controller_interface.IsInit());
g_controller_interface.ChangeWindow(wsi.render_window);
+ //g_controller_interface.ChangeWindow(wsi.render_surface, wsi.render_surface_width,
+ // wsi.render_surface_height);
- g_controller_interface.ChangeWindow(wsi.render_window);
+ g_controller_interface.ChangeWindow(wsi.render_surface, wsi.render_surface_width,
+ wsi.render_surface_height);

Pad::LoadConfig();
Pad::LoadGBAConfig();
Expand Down Expand Up @@ -713,7 +729,7 @@ diff -rupN dolphin.orig/Source/Core/DolphinNoGUI/Platform.h dolphin/Source/Core/
diff -rupN dolphin.orig/Source/Core/DolphinNoGUI/PlatformWayland.cpp dolphin/Source/Core/DolphinNoGUI/PlatformWayland.cpp
--- dolphin.orig/Source/Core/DolphinNoGUI/PlatformWayland.cpp 1970-01-01 00:00:00.000000000 +0000
+++ dolphin/Source/Core/DolphinNoGUI/PlatformWayland.cpp 2024-03-05 04:06:08.240295843 +0000
@@ -0,0 +1,364 @@
@@ -0,0 +1,365 @@
+// Copyright 2018 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
Expand All @@ -731,6 +747,7 @@ diff -rupN dolphin.orig/Source/Core/DolphinNoGUI/PlatformWayland.cpp dolphin/Sou
+#include "InputCommon/GCPadStatus.h"
+#include <fmt/format.h>
+#include "Core/Config/GraphicsSettings.h"
+#include "InputCommon/ControllerInterface/ControllerInterface.h"
+#include "VideoCommon/VideoConfig.h"
+#include "VideoCommon/OnScreenDisplay.h"
+
Expand Down Expand Up @@ -853,8 +870,8 @@ diff -rupN dolphin.orig/Source/Core/DolphinNoGUI/PlatformWayland.cpp dolphin/Sou
+ platform->m_surface_height = height;
+ if (g_renderer)
+ g_renderer->ResizeSurface(width, height);
+ //if (g_controller_interface.IsInit())
+ //g_controller_interface.OnWindowResized(width, height);
+ if (g_controller_interface.IsInit())
+ g_controller_interface.OnWindowResized(width, height);
+}
+
+void PlatformWayland::TopLevelClose(void* data, struct xdg_toplevel* xdg_toplevel)
Expand Down
4 changes: 2 additions & 2 deletions packages/emulators/standalone/kronos-sa/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
PKG_NAME="kronos-sa"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/FCare/Kronos"
PKG_ARCH="x86_64"
PKG_ARCH="x86_64 aarch64"
PKG_URL="${PKG_SITE}.git"
PKG_VERSION="400670e78da403ec37a86f23ac6e6c64e641e78e"
PKG_VERSION="46e687cb07f4bf8cb1717b0a7b4b48d208d20bb6"
PKG_GIT_CLONE_BRANCH="extui-align"
PKG_DEPENDS_TARGET="toolchain SDL2 boost openal-soft zlib qt6"
PKG_LONGDESC="Kronos is a Sega Saturn emulator forked from yabause."
Expand Down
5 changes: 2 additions & 3 deletions packages/graphics/mesa/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

PKG_NAME="mesa"
PKG_LICENSE="OSS"
PKG_VERSION="24.3.4"
PKG_VERSION="98ddfd040a3612c9007f41501888998449b51614"
PKG_SITE="http://www.mesa3d.org/"
PKG_URL="https://gitlab.freedesktop.org/mesa/mesa/-/archive/mesa-${PKG_VERSION}/mesa-mesa-${PKG_VERSION}.tar.gz"
PKG_URL="https://gitlab.freedesktop.org/mesa/mesa/-/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain expat libdrm zstd Mako:host pyyaml:host"
PKG_LONGDESC="Mesa is a 3-D graphics library with an API."
PKG_TOOLCHAIN="meson"
Expand Down
4 changes: 2 additions & 2 deletions packages/kernel/linux/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ PKG_PATCH_DIRS="${LINUX} mainline ${DEVICE} default"

case ${DEVICE} in
RK3588)
PKG_VERSION="b8e62bed74766b6c8c423a767b35495e78b64caf"
PKG_VERSION="772d6f09a7569faa1ab6450b80f73ce359f3a39a"
PKG_URL="https://github.com/armbian/linux-rockchip/archive/${PKG_VERSION}.tar.gz"
PKG_GIT_CLONE_BRANCH="rk-6.1-rkr3"
PKG_GIT_CLONE_BRANCH="rk-6.1-rkr5"
PKG_PATCH_DIRS="${LINUX} ${DEVICE} default"
;;
SM8250|H700)
Expand Down
2 changes: 1 addition & 1 deletion projects/Rockchip/bootloader/dtb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<file>rk3588-orangepi-5-plus</file>
<file>rk3588-orangepi-5-max</file>
<file>rk3588-rock-5b</file>
<file>rk3588-rock-5b-plus</file>
<file>rk3588-radxa-rock-5b+</file>
<file>rk3588s-orangepi-5</file>
<file>rk3588s-orangepi-5-pro</file>
<file>rk3588s-retro-lite-cm5</file>
Expand Down
10 changes: 8 additions & 2 deletions projects/Rockchip/devices/RK3326/options
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@
# OpenGL(X) implementation to use (mesa / no)
OPENGL="mesa"

# OpenGL-ES implementation to use (mesa / no)
OPENGLES="mesa"

# For maximum cross compatbility
PREFER_GLES="yes"

# OpenGL-ES implementation to use (mesa / no)
OPENGLES="mesa"
# Vulkan implementation to use (vulkan-loader / no)
VULKAN="vulkan-loader"

# VULKAN_SUPPORT
VULKAN_SUPPORT="yes"

# Displayserver to use (wl / no)
DISPLAYSERVER="wl"
Expand Down
10 changes: 8 additions & 2 deletions projects/Rockchip/devices/RK3566/options
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
TARGET_CPU="cortex-a55"
TARGET_CPU_FLAGS="+crc+crypto+fp+simd+rcpc"
TARGET_FPU="fp-armv8"
TARGET_FLOAT="hard"
TARGET_FLOAT="hard"
TARGET_FEATURES="64bit"
;;
arm)
Expand All @@ -20,7 +20,7 @@
TARGET_CPU="cortex-a55"
TARGET_CPU_FLAGS="+crc"
TARGET_FPU="neon-fp-armv8"
TARGET_FLOAT="hard"
TARGET_FLOAT="hard"
TARGET_FEATURES="32bit"
;;
esac
Expand All @@ -47,6 +47,12 @@
# For maximum cross compatbility
PREFER_GLES="yes"

# Vulkan implementation to use (vulkan-loader / no)
VULKAN="vulkan-loader"

# VULKAN_SUPPORT
VULKAN_SUPPORT="yes"

# Displayserver to use (wl / no)
DISPLAYSERVER="wl"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ make_target() {
setup_pkg_config_host

DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make mrproper
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make HOSTCC="${HOST_CC}" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTLDFLAGS="${HOST_LDFLAGS}" ${PKG_UBOOT_CONFIG} ${PKG_MINILOADER} u-boot.dtb u-boot.img tools
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make HOSTCC="${HOST_CC}" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTLDFLAGS="${HOST_LDFLAGS}" ${PKG_UBOOT_CONFIG} u-boot.dtb u-boot.img tools
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make BL31="${PKG_BL31}" ROCKCHIP_TPL="${PKG_DDR_BIN}" HOSTCC="${HOST_CC}" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTLDFLAGS="${HOST_LDFLAGS}" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"

find_file_path bootloader/rkhelper && . ${FOUND_PATH}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ make_target() {
[ "${BUILD_WITH_DEBUG}" = "yes" ] && PKG_DEBUG=1 || PKG_DEBUG=0
setup_pkg_config_host
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make mrproper
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make HOSTCC="${HOST_CC}" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTLDFLAGS="${HOST_LDFLAGS}" ${PKG_UBOOT_CONFIG} ${PKG_MINILOADER} u-boot.dtb u-boot.img tools
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 make HOSTCC="${HOST_CC}" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTLDFLAGS="${HOST_LDFLAGS}" ${PKG_UBOOT_CONFIG} u-boot.dtb u-boot.img tools
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm64 _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make BL31="${PKG_BL31}" ROCKCHIP_TPL="${PKG_DDR_BIN}" HOSTCC="${HOST_CC}" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTLDFLAGS="${HOST_LDFLAGS}" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"

find_file_path bootloader/rkhelper && . ${FOUND_PATH}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts li
+ rotation = <90>;
+ disable-delay-ms = <120>;
+ dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+ MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
+ MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET)>;
+ dsi,format = <MIPI_DSI_FMT_RGB888>;
+ dsi,lanes = <4>;
+ panel-init-sequence = [
Expand Down
2 changes: 2 additions & 0 deletions projects/Rockchip/patches/linux/RK3588/003-audio-fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ diff -rupbN linux.orig/sound/soc/rockchip/rockchip_multicodecs.c linux/sound/soc
+
switch (event) {
case SND_SOC_DAPM_POST_PMU:
if (mc_data->pre_poweron_delayms)
msleep(mc_data->pre_poweron_delayms);
- gpiod_set_value_cansleep(mc_data->hp_ctl_gpio, 1);
+ //gpiod_set_value_cansleep(mc_data->hp_ctl_gpio, 1);
+ if (!(jack_headset->status & SND_JACK_HEADPHONE))
Expand Down
Loading

0 comments on commit 26409e1

Please sign in to comment.