supergfxctl is able to manage with nvidia hybrid graphics on laptops, users can just turn off the dGPU even without reboot (logout and automatically restart display manager is enough).

OBS-URL: https://build.opensuse.org/package/show/hardware/supergfxctl?expand=0&rev=1
This commit is contained in:
Jan Engelhardt 2023-12-27 22:55:35 +00:00 committed by Git OBS Bridge
commit 796289d1bb
7 changed files with 267 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

5
cargo_config Normal file
View File

@ -0,0 +1,5 @@
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"

3
supergfxctl-5.1.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:42671feacf8924c1a6b7ac14b1af099765240dd272b861aa39ea03c5a4f583ec
size 49076

140
supergfxctl.changes Normal file
View File

@ -0,0 +1,140 @@
-------------------------------------------------------------------
Tue Nov 14 05:46:34 UTC 2023 - rn <R_Nik_C@proton.me>
- Update to version 5.1.2:
* Bump deps
* Add missing entry in changelog
* Adjust makefile to use vender-filter
* Ensure supergfx tries to fallback if change fails
* Small fixes for egpu
* Bump version
* Update deps
* Update deps
* Fix: Don't continue with action list if the error is a logout timeout
* Fix pipeline
-------------------------------------------------------------------
Fri Nov 18 07:57:22 UTC 2022 - luke@ljones.dev
- Update to version 5.0.1:
* Add dgpu status notification on dbus
* Fix: Check for GA401I, remove compute mode, set log level info
* Release 5.0.0
* Prep tag RC15
* RC15, final
* RC13 with various corrections
* Update dependencies
* Enable hotplug use, fixes to dgpu_disable, fixes to integrated
* Do pci rescan even if no missing device
* Update changelog
* Switch to async with tokio. Use asus switches if avilable. Bugfixes.
* Ignore possible i/o error as invalid
* Bump zbus version
* Add 99-nvidia-ac.rules udev rule
* fix: correction in changelog
* fix: make sure to use asus_use_dgpu_disable
* Add pipeline, cleanup with clippy
* 5.0.0-rc1
* Update dbus API docs (introspectable)
* Add more debug logging, default service to debug for now
* Switch to async runtime
* Slap Arc<Mutex<>> around gpu device
* Switch to udev. Add ASUS methods. Optimise.
* Remove dedicated mode
* Added pipe to sh command to install Rust Taken from the official Rust website -- https://www.rust-lang.org/tools/install
* fix AMD detection for pci-ids version 2020.03.20
-------------------------------------------------------------------
Tue Jul 05 08:23:07 UTC 2022 - luke@ljones.dev
- Update to version 4.0.5:
* Prep new release
* Fix interaction with newer lspci version
* add "Quadro" to the lspci parsing for NVIDIA cards
-------------------------------------------------------------------
Wed May 11 16:17:34 UTC 2022 - Enrico Belleri <idesmi@protonmail.com>
- Use obs services for source and vendor
-------------------------------------------------------------------
Fri Feb 4 22:35:35 UTC 2022 - Luke Jones <luke@ljones.dev>
- Version 4.0.4
- Adjust the kernel cmdline arg code path
-------------------------------------------------------------------
Thu Feb 3 21:37:52 UTC 2022 - Luke Jones <luke@ljones.dev>
- Version 4.0.3
- Add config option `no_logind`: Don't use logind to see if all sessions are
logged out and therefore safe to change mode. This will be useful for people not
using a login manager, however it is not guaranteed to work unless all graphical
sessions are ended and nothing is hooking the drivers. Ignored if `always_reboot`
is set.
- Add config option `logout_timeout_s`: The timeout in seconds to wait for all user
graphical sessions to end. Default is 3 minutes, 0 = infinite. Ignored if
`no_logind` or `always_reboot` is set.
- Add new dbus method: `PendingMode`, to check if a mode change is required
- Add new dbus method: `PendingUserAction`, to check if the user is required to perform an action
- Add new dbus method: `Config`, to get the current base config
- Add new dbus method: `SetConfig`, to set the base config
- Add `-p, --pend-action` CLI arg to get the pending user action if any
- Add `-P, --pend-mode` CLI arg to get the pending mode change if any`
- Add ability to read `supergfxd.mode=` from kernel cmdline on startup and set the mode appropriately
- CLI option `--force` was unused, it is now removed.
-------------------------------------------------------------------
Sat Jan 22 09:35:11 UTC 2022 - Luke Jones <luke@ljones.dev>
- Version 4.0.2
-------------------------------------------------------------------
Wed Jan 19 23:12:03 UTC 2022 - Luke Jones <luke@ljones.dev>
- Version 4.0.1
- Fix version upgrade of config
- Recreate the config if parsing fails
- Only write the (reboot) mode change to config file, don't update live config
- AMD dedicated + hybrid config for xorg
- "AllowExternalGpus" added to xorg for Nvidia Egpu mode
-------------------------------------------------------------------
Tue Jan 18 07:17:49 UTC 2022 - Luke Jones <luke@ljones.dev>
- Version 4.0.0
- Added
- Add new dbus method: `Version` to get supergfxd version
- Add new dbus method: `Vendor` to get dGPU vendor name
- Add new dbus method: `Supported` to get list of supported modes
- Add `-v, --version` CLI arg to get supergfxd version
- Add `-V, --vendor` CLI arg to get dGPU vendor name
- Add `-s, --supported` CLI arg to get list of supported modes
- Add new config option: `vfio_save` to reload VFIO on boot
- Add new config option: `compute_save` to reload compute on boot
- Add new config option: `always_reboot` reboot to change modes
- Changed
- Adjust startup to check for ASUS eGPU and dGPU enablement if no modes supported
- If nvidia-drm.modeset=1 is set then save mode and require a reboot by default\
- Add extra check for Nvidia dGPU (fixes Flow 13")
- Properly check the correct device for power status
- Breaking
- Rename Vendor, GetVendor to Mode, GetMode to better reflect their results
-------------------------------------------------------------------
Mon Jan 10 00:37:46 UTC 2022 - Luke Jones <luke@ljones.dev>
- Version 3.0.0
Sun Dec 19 07:43:11 UTC 2021 - Luke Jones <luke@ljones.dev>
- Version 2.0.5
-------------------------------------------------------------------
Tue Nov 2 20:23:58 UTC 2021 - Luke Jones <luke@ljones.dev>
- Version 2.0.4
-------------------------------------------------------------------
Tue Nov 2 03:56:07 UTC 2021 - Luke Jones <luke@ljones.dev>
- Version 2.0.3

92
supergfxctl.spec Normal file
View File

@ -0,0 +1,92 @@
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
Name: supergfxctl
Version: 5.1.2
Release: 0
Summary: Super graphics mode controller
License: MPL-2.0
URL: https://gitlab.com/asus-linux/supergfxctl
Source0: %{name}-%{version}.tar.gz
Source1: vendor-%{version}.tar.xz
Source2: cargo_config
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: clang-devel
BuildRequires: pkgconfig
BuildRequires: rust
BuildRequires: rust-std-static
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(systemd)
Requires: systemd
Conflicts: bumblebee
Conflicts: bumblebee-status-module-nvidia-optimus-manager
Conflicts: bbswitch
Conflicts: suse-prime
Conflicts: system76-power
%description
supergfxctl is a super graphics mode controller for laptops with hybrid nvidia.
%prep
%autosetup -a1
mkdir .cargo
cp %{SOURCE2} .cargo/config
%build
%cargo_build
%install
%cargo_install
mkdir -p "%{buildroot}%{_bindir}"
install -D -m 0755 target/release/supergfxd %{buildroot}%{_bindir}/supergfxd
install -D -m 0755 target/release/supergfxctl %{buildroot}%{_bindir}/supergfxctl
install -D -m 0644 data/90-supergfxd-nvidia-pm.rules %{buildroot}%{_udevrulesdir}/90-supergfxd-nvidia-pm.rules
install -D -m 0644 data/org.supergfxctl.Daemon.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.supergfxctl.Daemon.conf
install -D -m 0644 data/supergfxd.service %{buildroot}%{_unitdir}/supergfxd.service
install -D -m 0644 data/supergfxd.preset %{buildroot}%{_presetdir}/99-supergfxd.preset
install -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE
install -D -m 0644 README.md %{buildroot}%{_datadir}/doc/%{name}/README.md
%pre
%service_add_pre supergfxd.service
%post
%service_add_post supergfxd.service
systemctl enable supergfxd.service
%preun
%service_del_preun supergfxd.service
%postun
%service_del_postun_with_restart supergfxd.service
if [[ -e %{_sysconfdir}/modprobe.d/supergfxd.conf ]]
then
rm %{_sysconfdir}/modprobe.d/supergfxd.conf
fi
if [[ -e %{_sysconfdir}/modprobe.d/nvidia.conf ]]
then
if grep -q "# options nvidia-drm.modeset=1" %{_sysconfdir}/modprobe.d/nvidia.conf
then
echo "optional nvidia-drm.modeset=1" > %{_sysconfdir}/modprobe.d/nvidia.conf
fi
fi
%files
%license LICENSE
%{_bindir}/supergfxd
%{_bindir}/supergfxctl
%{_unitdir}/supergfxd.service
%{_presetdir}/99-supergfxd.preset
%{_udevrulesdir}/90-supergfxd-nvidia-pm.rules
%config %{_sysconfdir}/dbus-1/system.d/org.supergfxctl.Daemon.conf
%dir %{_datadir}/doc
%dir %{_datadir}/doc/%{name}
%{_datadir}/doc/%{name}/*
%changelog

3
vendor-5.1.2.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:260cae0a62ca840834f8845a0ed81925c68925b87f1b8b54d2260c218bb27f68
size 14793916