Hello community, here is the log from the commit of package suse-prime for openSUSE:Factory checked in at 2019-11-18 20:12:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/suse-prime (Old) and /work/SRC/openSUSE:Factory/.suse-prime.new.26869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "suse-prime" Mon Nov 18 20:12:12 2019 rev:15 rq:749323 version:0.7.3 Changes: -------- --- /work/SRC/openSUSE:Factory/suse-prime/suse-prime.changes 2019-10-08 19:59:58.427832054 +0200 +++ /work/SRC/openSUSE:Factory/.suse-prime.new.26869/suse-prime.changes 2019-11-18 20:12:43.861520414 +0100 @@ -1,0 +2,13 @@ +Mon Nov 18 14:42:07 UTC 2019 - Stefan Dirsch <sndir...@suse.com> + +- this release also includes support for NVIDIA's PRIME render + offloading (jsc#SLE-9068) + +------------------------------------------------------------------- +Wed Oct 23 01:31:45 UTC 2019 - Stefan Dirsch <sndir...@suse.com> + +- Update to version 0.7.3 + * Restore previous configuration if nvidia reconfiguration fails + * Set the right panel variables for LVDS displays (issue#26) + +------------------------------------------------------------------- Old: ---- SUSEPrime-0.7.2.tar.gz New: ---- SUSEPrime-0.7.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ suse-prime.spec ++++++ --- /var/tmp/diff_new_pack.2BHoVD/_old 2019-11-18 20:12:45.417519620 +0100 +++ /var/tmp/diff_new_pack.2BHoVD/_new 2019-11-18 20:12:45.433519612 +0100 @@ -17,7 +17,7 @@ Name: suse-prime -Version: 0.7.2 +Version: 0.7.3 Release: 0 Summary: GPU (nvidia/intel) selection for NVIDIA optimus laptops License: SUSE-Public-Domain ++++++ SUSEPrime-0.7.2.tar.gz -> SUSEPrime-0.7.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SUSEPrime-0.7.2/prime-select.sh new/SUSEPrime-0.7.3/prime-select.sh --- old/SUSEPrime-0.7.2/prime-select.sh 2019-10-08 12:18:31.000000000 +0200 +++ new/SUSEPrime-0.7.3/prime-select.sh 2019-10-23 03:09:18.000000000 +0200 @@ -22,9 +22,16 @@ lspci_nvidia_3d_line="3D controller: NVIDIA" # name of the laptop panel output as returned by 'xrandr -q'. Driver dependent, because why not -panel_nvidia=eDP-1-1 -panel_intel=eDP-1 -panel_intel2=eDP1 +ls /sys/class/drm/ | grep -q LVDS +if [ $? -eq 0 ]; then + panel_nvidia=LVDS-1-1 + panel_intel=LVDS-1 + panel_intel2=LVDS1 +else + panel_nvidia=eDP-1-1 + panel_intel=eDP-1 + panel_intel2=eDP1 +fi # Check if prime-select service is enabled. Some users may want to use nvidia prime offloading sometimes so they can disable service temporarily. # SusePRIME bbswitch will work as non-bbswitch one @@ -162,6 +169,33 @@ fi } +function restore_old_state { + if [ -f /etc/prime/current_type.old ]; then + echo "Reconfiguration failed" + logging "Reconfiguration failed" + mv -f /etc/prime/current_type.old /etc/prime/current_type + config=$(cat /etc/prime/current_type) + echo "Restoring previous configuration: $config" + logging "Restoring previous configuration: $config" + else + echo "Configuration failed" + logging "Configuration failed" + rm /etc/prime/current_type + fi +} + +function save_old_state { + if [ -f /etc/prime/current_type ]; then + cp -f /etc/prime/current_type /etc/prime/current_type.old + fi +} + +function remove_old_state { + if [ -f /etc/prime/current_type.old ]; then + rm /etc/prime/current_type.old + fi +} + function set_nvidia { if (( service_test == 0)); then @@ -183,6 +217,7 @@ # This may easily fail, if no NVIDIA kernel module is available or alike if [ $? -ne 0 ]; then logging "PCI BusID of NVIDIA card could not be detected!" + restore_old_state exit 1 fi @@ -442,15 +477,19 @@ logging "user_logout_waiter: started" # from console without Xorg running else + save_old_state echo $type > /etc/prime/current_type apply_current + remove_old_state exit fi else # no service used + save_old_state echo $type > /etc/prime/current_type apply_current + remove_old_state fi