From c54796f34c5d917c8fed76abaeae94dd06332944 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Mon, 17 Feb 2025 17:13:28 -0800 Subject: [PATCH 1/2] fix(mangohud): Add some fixes for Steam Deck hardware & APUs --- ...d93f0493e88637ff4a6ef1140a13ded05cc8.patch | 28 +++++++++++++++++ ...1b5c4bbd9fa1ff56337bff6d307568afc4d5.patch | 31 +++++++++++++++++++ ...29f2f292e2a7089caff6c78d79a102da96d.patch} | 0 ...45c288610145b172af4f0dff49697337abc4.patch | 31 +++++++++++++++++++ spec_files/mangohud/mangohud.spec | 10 ++++-- 5 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 spec_files/mangohud/5b7bd93f0493e88637ff4a6ef1140a13ded05cc8.patch create mode 100644 spec_files/mangohud/6dcd1b5c4bbd9fa1ff56337bff6d307568afc4d5.patch rename spec_files/mangohud/{dont_crash_gpu_uninit.patch => 85bd029f2f292e2a7089caff6c78d79a102da96d.patch} (100%) create mode 100644 spec_files/mangohud/f60145c288610145b172af4f0dff49697337abc4.patch diff --git a/spec_files/mangohud/5b7bd93f0493e88637ff4a6ef1140a13ded05cc8.patch b/spec_files/mangohud/5b7bd93f0493e88637ff4a6ef1140a13ded05cc8.patch new file mode 100644 index 0000000000..4f5510e6c5 --- /dev/null +++ b/spec_files/mangohud/5b7bd93f0493e88637ff4a6ef1140a13ded05cc8.patch @@ -0,0 +1,28 @@ +From 5b7bd93f0493e88637ff4a6ef1140a13ded05cc8 Mon Sep 17 00:00:00 2001 +From: flightlessmango +Date: Mon, 17 Feb 2025 21:18:04 +0100 +Subject: [PATCH] Params: preset 4: disable some more options for steam deck + +--- + src/overlay_params.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp +index 9fbe4a4fc4..cf4446a87f 100644 +--- a/src/overlay_params.cpp ++++ b/src/overlay_params.cpp +@@ -1165,8 +1165,13 @@ void presets(int preset, struct overlay_params *params, bool inherit) { + add_to_options(params, "frame_timing_detailed", "1"); + add_to_options(params, "network", "1"); + add_to_options(params, "present_mode", "0"); +- if ( deviceID == 0x1435 || deviceID == 0x163f ) ++ // Disable some options if steamdeck ++ if ( deviceID == 0x1435 || deviceID == 0x163f ) { + add_to_options(params, "gpu_fan", "0"); ++ add_to_options(params, "gpu_junction_temp", "0"); ++ add_to_options(params, "gpu_voltage", "0"); ++ add_to_options(params, "gpu_mem_temp", "0"); ++ } + + break; + diff --git a/spec_files/mangohud/6dcd1b5c4bbd9fa1ff56337bff6d307568afc4d5.patch b/spec_files/mangohud/6dcd1b5c4bbd9fa1ff56337bff6d307568afc4d5.patch new file mode 100644 index 0000000000..e97f2f1f5a --- /dev/null +++ b/spec_files/mangohud/6dcd1b5c4bbd9fa1ff56337bff6d307568afc4d5.patch @@ -0,0 +1,31 @@ +From 6dcd1b5c4bbd9fa1ff56337bff6d307568afc4d5 Mon Sep 17 00:00:00 2001 +From: flightlessmango +Date: Mon, 17 Feb 2025 20:28:18 +0100 +Subject: [PATCH] amdgpu: current_gfxclk was not being collected in APUs + +--- + src/amdgpu.cpp | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/amdgpu.cpp b/src/amdgpu.cpp +index ebd2667e1f..b3cc5b9375 100644 +--- a/src/amdgpu.cpp ++++ b/src/amdgpu.cpp +@@ -133,6 +133,17 @@ void AMDGPU::get_instant_metrics(struct amdgpu_common_metrics *metrics) { + metrics->apu_cpu_temp_c = 0; + } + ++ if( IS_VALID_METRIC(amdgpu_metrics->current_gfxclk) ) { ++ // prefered method ++ metrics->current_gfxclk_mhz = amdgpu_metrics->current_gfxclk; ++ } else if( IS_VALID_METRIC(amdgpu_metrics->average_gfxclk_frequency) ) { ++ // fallback 1 ++ metrics->current_gfxclk_mhz = amdgpu_metrics->average_gfxclk_frequency; ++ } else { ++ // giving up ++ metrics->current_gfxclk_mhz = 0; ++ } ++ + indep_throttle_status = amdgpu_metrics->indep_throttle_status; + } + diff --git a/spec_files/mangohud/dont_crash_gpu_uninit.patch b/spec_files/mangohud/85bd029f2f292e2a7089caff6c78d79a102da96d.patch similarity index 100% rename from spec_files/mangohud/dont_crash_gpu_uninit.patch rename to spec_files/mangohud/85bd029f2f292e2a7089caff6c78d79a102da96d.patch diff --git a/spec_files/mangohud/f60145c288610145b172af4f0dff49697337abc4.patch b/spec_files/mangohud/f60145c288610145b172af4f0dff49697337abc4.patch new file mode 100644 index 0000000000..0763e37348 --- /dev/null +++ b/spec_files/mangohud/f60145c288610145b172af4f0dff49697337abc4.patch @@ -0,0 +1,31 @@ +From f60145c288610145b172af4f0dff49697337abc4 Mon Sep 17 00:00:00 2001 +From: flightlessmango +Date: Mon, 17 Feb 2025 21:07:20 +0100 +Subject: [PATCH] amdgpu: current_uclk was not being collected in APUs + +--- + src/amdgpu.cpp | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/amdgpu.cpp b/src/amdgpu.cpp +index b3cc5b9375..4a2542298a 100644 +--- a/src/amdgpu.cpp ++++ b/src/amdgpu.cpp +@@ -143,6 +143,17 @@ void AMDGPU::get_instant_metrics(struct amdgpu_common_metrics *metrics) { + // giving up + metrics->current_gfxclk_mhz = 0; + } ++ ++ if( IS_VALID_METRIC(amdgpu_metrics->current_uclk) ) { ++ // prefered method ++ metrics->current_uclk_mhz = amdgpu_metrics->current_uclk; ++ } else if( IS_VALID_METRIC(amdgpu_metrics->average_uclk_frequency) ) { ++ // fallback 1 ++ metrics->current_uclk_mhz = amdgpu_metrics->average_uclk_frequency; ++ } else { ++ // giving up ++ metrics->current_uclk_mhz = 0; ++ } + + indep_throttle_status = amdgpu_metrics->indep_throttle_status; + } diff --git a/spec_files/mangohud/mangohud.spec b/spec_files/mangohud/mangohud.spec index cf0ea1413a..ca93b76845 100644 --- a/spec_files/mangohud/mangohud.spec +++ b/spec_files/mangohud/mangohud.spec @@ -23,7 +23,7 @@ Name: mangohud Version: 0.8.0 -Release: 3 +Release: 4 Summary: Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load License: MIT @@ -41,9 +41,15 @@ Source6: https://wrapdb.mesonbuild.com/v%{implot_wrap_ver}/implot_%{implo Source20: README.Fedora.md # https://github.com/flightlessmango/MangoHud/commit/85bd029f2f292e2a7089caff6c78d79a102da96d -Patch0: dont_crash_gpu_uninit.patch +Patch0: 85bd029f2f292e2a7089caff6c78d79a102da96d.patch # https://github.com/flightlessmango/MangoHud/pull/1581 Patch1: 1581.patch +# https://github.com/flightlessmango/MangoHud/commit/6dcd1b5c4bbd9fa1ff56337bff6d307568afc4d5 +Patch2: 6dcd1b5c4bbd9fa1ff56337bff6d307568afc4d5.patch +# https://github.com/flightlessmango/MangoHud/commit/f60145c288610145b172af4f0dff49697337abc4 +Patch3: f60145c288610145b172af4f0dff49697337abc4.patch +# https://github.com/flightlessmango/MangoHud/commit/5b7bd93f0493e88637ff4a6ef1140a13ded05cc8 +Patch4: 5b7bd93f0493e88637ff4a6ef1140a13ded05cc8.patch BuildRequires: vulkan-headers BuildRequires: appstream From 748b9afa21864ee06b1c31ca2ae45af74156c27a Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Mon, 17 Feb 2025 18:24:29 -0800 Subject: [PATCH 2/2] fix(msi-claw): Add fix for audio cutting out --- .../wireplumber.conf.d/80-alsa-headroom.conf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 system_files/deck/shared/usr/share/wireplumber/hardware-profiles/micro-star international co., ltd.-claw 7 ai+ a2vm/wireplumber.conf.d/80-alsa-headroom.conf diff --git a/system_files/deck/shared/usr/share/wireplumber/hardware-profiles/micro-star international co., ltd.-claw 7 ai+ a2vm/wireplumber.conf.d/80-alsa-headroom.conf b/system_files/deck/shared/usr/share/wireplumber/hardware-profiles/micro-star international co., ltd.-claw 7 ai+ a2vm/wireplumber.conf.d/80-alsa-headroom.conf new file mode 100644 index 0000000000..5c02eafdea --- /dev/null +++ b/system_files/deck/shared/usr/share/wireplumber/hardware-profiles/micro-star international co., ltd.-claw 7 ai+ a2vm/wireplumber.conf.d/80-alsa-headroom.conf @@ -0,0 +1,14 @@ +monitor.alsa.rules = [ + { + matches = [ + { + node.name = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Speaker__sink" + } + ] + actions = { + update-props = { + api.alsa.headroom = 1024 + } + } + } +] \ No newline at end of file