Sync with nobara

This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2023-07-15 11:37:51 +03:00 committed by GitHub
parent b54b18c585
commit e18fe55471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 88 additions and 2 deletions

2
debian/changelog vendored
View File

@ -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 * Initial Creation

View File

@ -1,3 +1,5 @@
#! /bin/bash
DEBIAN_FRONTEND=noninteractive DEBIAN_FRONTEND=noninteractive
# Clone Upstream # Clone Upstream
@ -13,8 +15,11 @@ cd ./steamdeck-jupiter-driver
# Get build deps # Get build deps
apt-get build-dep ./ -y apt-get build-dep ./ -y
# Patch
for i in ../patches/*.patch; do patch -Np1 -i $i ;done
# Build package # Build package
dpkg-buildpackage dpkg-buildpackage --no-sign
# Move the debs to output # Move the debs to output
cd ../ cd ../

View File

@ -0,0 +1,81 @@
From c3014c9bd771d5624230ebf464ba20816b9b2479 Mon Sep 17 00:00:00 2001
From: GloriousEggroll <gloriouseggroll@gmail.com>
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