From e7e3c181eaa2590a54902eec45633d98b5b968e0 Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 7 Aug 2026 14:25:57 +0100 Subject: [PATCH 1/4] Add Docker build Replaces 7zip with regular zip so it can be done within the container. --- .github/workflows/main.yml | 3 --- .gitignore | 2 ++ Makefile | 9 +++------ build-docker.sh | 4 ++++ 4 files changed, 9 insertions(+), 9 deletions(-) create mode 100755 build-docker.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e19959e..97f678b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,9 +8,6 @@ jobs: container: devkitpro/devkita64:latest steps: - - name: Install 7z - run: sudo apt update && sudo apt install -y p7zip-full - - uses: actions/checkout@v1 with: submodules: recursive diff --git a/.gitignore b/.gitignore index 2db1b54..ef37e08 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ misc/patches misc/icon.svg !misc/default.ini + +.DS_Store diff --git a/Makefile b/Makefile index dd311bb..0fa285a 100644 --- a/Makefile +++ b/Makefile @@ -25,10 +25,7 @@ MODULES = application sysmodule overlay all: $(MODULES) @: -dist: $(DIST_TARGET) - @: - -$(DIST_TARGET): | all +dist: | all @rm -rf $(OUT)/Fizeau-*-*.zip @mkdir -p $(OUT)/config/Fizeau @@ -47,9 +44,9 @@ $(DIST_TARGET): | all @mkdir -p $(OUT)/atmosphere/exefs_patches/nvnflinger_cmu @cp misc/patches/*.ips $(OUT)/atmosphere/exefs_patches/nvnflinger_cmu || : - @7z a $@ ./$(OUT)/atmosphere ./$(OUT)/config ./$(OUT)/switch >/dev/null + @cd $(OUT) && zip -qr $(notdir $(DIST_TARGET)) atmosphere config switch -x "*.DS_Store" @rm -r $(OUT)/atmosphere $(OUT)/config $(OUT)/switch - @echo Compressed release to $@ + @echo Compressed release to $(DIST_TARGET) clean: @rm -rf out diff --git a/build-docker.sh b/build-docker.sh new file mode 100755 index 0000000..669fd94 --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +docker run --rm --name devkitpro-fizeau -v .:/mnt/ devkitpro/devkita64:20260215 sh -c "git config --global --add safe.directory /mnt && cd /mnt/ && make -C common -j\$(nproc) && make -j\$(nproc) dist" From 0c5ee085ed27b1f757a9823c1a29e323103bacbd Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 7 Aug 2026 14:49:13 +0100 Subject: [PATCH 2/4] Fix inverted external display check in HDMI infoframe updates Since the sysmodule rework (a457636), the AVI infoframe was updated when applying the internal profile, and never for the external one, inverting the pre-rework behavior. The color quantization range of the external profile is now honored again, and the infoframe is left alone when applying/disabling internal corrections. --- sysmodule/src/nvdisp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysmodule/src/nvdisp.cpp b/sysmodule/src/nvdisp.cpp index e7f505a..cbf5559 100644 --- a/sysmodule/src/nvdisp.cpp +++ b/sysmodule/src/nvdisp.cpp @@ -82,7 +82,7 @@ Result DisplayController::disable(bool external) const { if (auto rc = nvioctlNvDisp_SetCmu(!external ? this->disp0_fd : this->disp1_fd, &cmu)) return rc; - if (external) + if (!external) return 0; AviInfoframe infoframe; @@ -111,7 +111,7 @@ Result DisplayController::apply_color_profile(bool external, FizeauSettings &set } Result DisplayController::set_hdmi_color_range(bool external, ColorRange range) const { - if (external) + if (!external) return 0; auto is_limited = [](const ColorRange &range) { From 7bfe5017edf8a59949bf3b859d95eb43e0aefa9a Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 7 Aug 2026 14:49:33 +0100 Subject: [PATCH 3/4] Skip dimming checks when the dimming timeout is disabled With dimming_timeout set to 0, the transition thread considered dimming overdue whenever no input activity occurred for over a second, and recalculated/reapplied the whole configuration on every 100ms tick until the next input. Mirror the timeout check already done in should_dim(). --- sysmodule/src/profile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysmodule/src/profile.cpp b/sysmodule/src/profile.cpp index dbf7481..1445077 100644 --- a/sysmodule/src/profile.cpp +++ b/sysmodule/src/profile.cpp @@ -148,10 +148,10 @@ void ProfileManager::transition_thread_func(void *args) { std::uint64_t timeout = to_timestamp(profile.dimming_timeout), delta = armTicksToNs(armGetSystemTick() - self->activity_tick) / std::chrono::nanoseconds(1s).count(); - if ( + if (timeout && ( (!self->is_dimming && delta > timeout) || ( self->is_dimming && delta <= timeout) - ) + )) need_apply = true; } From 614c07e003639ceef0a7912a90190297e45766da Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 7 Aug 2026 14:49:58 +0100 Subject: [PATCH 4/4] Fix system hang when undocking while an input is held (#104) The CMU reset detection only skipped polling when both display clocks were gated, but reads the registers of a single head, selected by the current operation mode. When undocking while a button is held down, the operation mode change notification is delayed, so the poll kept targeting DISPLAY_B after the undock had already gated the DISP2 clock (DISP1 kept the check passing). MMIO reads to a clock-gated module stall the bus transaction, hanging core 3 until the clock is re-enabled by docking again, or a reboot. Check the clock of the specific head being polled instead. --- sysmodule/src/profile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sysmodule/src/profile.cpp b/sysmodule/src/profile.cpp index 1445077..71a3c48 100644 --- a/sysmodule/src/profile.cpp +++ b/sysmodule/src/profile.cpp @@ -88,7 +88,9 @@ void ProfileManager::transition_thread_func(void *args) { // CMU resets if (!need_apply) { - if (!(READ(self->clock_va_base + CLK_RST_CONTROLLER_CLK_OUT_ENB_L) & (CLK_ENB_DISP1 | CLK_ENB_DISP2)) || + // Check the clock for the specific head we are about to poll: reading the + // registers of a clock-gated module stalls the bus, hanging the core (#104) + if (!(READ(self->clock_va_base + CLK_RST_CONTROLLER_CLK_OUT_ENB_L) & (is_handheld ? CLK_ENB_DISP1 : CLK_ENB_DISP2)) || !mutexTryLock(&self->commit_mutex)) goto cmu_end;