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" 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) { diff --git a/sysmodule/src/profile.cpp b/sysmodule/src/profile.cpp index dbf7481..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; @@ -148,10 +150,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; }