diff --git a/debian/changelog b/debian/changelog index f58217c..2f55121 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -steamdeck-jupiter-driver (20221213.1-99pika1-lunar) lunar; urgency=low +steamdeck-jupiter-driver (20221213.1-99pika2-lunar) lunar; urgency=low * Initial Creation diff --git a/main.sh b/main.sh index 9b2dc9d..5d6fc72 100755 --- a/main.sh +++ b/main.sh @@ -1,3 +1,5 @@ +#! /bin/bash + DEBIAN_FRONTEND=noninteractive # Clone Upstream @@ -13,8 +15,11 @@ cd ./steamdeck-jupiter-driver # Get build deps apt-get build-dep ./ -y +# Patch +for i in ../patches/*.patch; do patch -Np1 -i $i ;done + # Build package -dpkg-buildpackage +dpkg-buildpackage --no-sign # Move the debs to output cd ../ diff --git a/patches/0001-Don-t-impose-limits-on-gpu-voltage-cpu-voltage-screen.patch b/patches/0001-Don-t-impose-limits-on-gpu-voltage-cpu-voltage-screen.patch new file mode 100644 index 0000000..c85bb89 --- /dev/null +++ b/patches/0001-Don-t-impose-limits-on-gpu-voltage-cpu-voltage-screen.patch @@ -0,0 +1,81 @@ +From c3014c9bd771d5624230ebf464ba20816b9b2479 Mon Sep 17 00:00:00 2001 +From: GloriousEggroll +Date: Sat, 8 Jul 2023 04:07:16 -0600 +Subject: [PATCH] Don't impose limits on gpu voltage,cpu voltage,screen + brightness,backlight if the device is in charging mode + +--- + .../steamos-polkit-helpers/steamos-priv-write | 52 +++++++++++-------- + 1 file changed, 30 insertions(+), 22 deletions(-) + +diff --git usr/bin/steamos-polkit-helpers/steamos-priv-write usr/bin/steamos-polkit-helpers/steamos-priv-write +index 907133b..f57e2a4 100755 +--- usr/bin/steamos-polkit-helpers/steamos-priv-write ++++ usr/bin/steamos-polkit-helpers/steamos-priv-write +@@ -25,34 +25,42 @@ function DeclineWrite() + exit 1 + } + +-echo "checking: $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning +-if [[ "$WRITE_PATH" == /sys/class/backlight/*/brightness ]]; then +- CommitWrite +-fi ++HASBAT=$(upower -e | grep 'BAT') ++CHARGING="$(upower -i $(upower -e | grep 'BAT') | grep state | grep charging)" ++DEVICES="$(lspci | cut -c8- | grep -i -E '(vga|display|3d)' | grep -vi 'non-vga' | wc -l)" + ++if [[ ! -z $HASBAT ]] && [[ $DEVICES < 2 ]] && [[ -z $CHARGING ]] ; then + +-if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/power_dpm_force_performance_level ]]; then +- CommitWrite +-fi ++ echo "checking: $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning ++ if [[ "$WRITE_PATH" == /sys/class/backlight/*/brightness ]]; then ++ CommitWrite ++ fi + +-if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/pp_od_clk_voltage ]]; then +- CommitWrite +-fi ++ if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/power_dpm_force_performance_level ]]; then ++ CommitWrite ++ fi + +-if [[ "$WRITE_PATH" == /sys/class/hwmon/hwmon*/power*_cap ]]; then +- CommitWrite +-fi ++ if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/pp_od_clk_voltage ]]; then ++ CommitWrite ++ fi + +-if [[ "$WRITE_PATH" == /sys/devices/platform/*/*/*/iio:device*/in_illuminance_integration_time ]]; then +- CommitWrite +-fi ++ if [[ "$WRITE_PATH" == /sys/class/hwmon/hwmon*/power*_cap ]]; then ++ CommitWrite ++ fi + +-if [[ "$WRITE_PATH" == /sys/devices/*/*/*/*/hwmon/hwmon*/led_brightness ]]; then +- CommitWrite +-fi ++ if [[ "$WRITE_PATH" == /sys/devices/platform/*/*/*/iio:device*/in_illuminance_integration_time ]]; then ++ CommitWrite ++ fi ++ ++ if [[ "$WRITE_PATH" == /sys/devices/*/*/*/*/hwmon/hwmon*/led_brightness ]]; then ++ CommitWrite ++ fi ++ ++ if [[ "$WRITE_PATH" == /sys/devices/*/*/*/*/hwmon/hwmon*/content_adaptive_brightness ]]; then ++ CommitWrite ++ fi ++ ++ DeclineWrite + +-if [[ "$WRITE_PATH" == /sys/devices/*/*/*/*/hwmon/hwmon*/content_adaptive_brightness ]]; then +- CommitWrite + fi + +-DeclineWrite +-- +2.41.0