From 951b1b79966b7321641d1caa46e7667baf98c1dc Mon Sep 17 00:00:00 2001 From: Simon Long Date: Mon, 3 Feb 2020 09:38:15 +0000 Subject: [PATCH] Add pixel doubling for FKMS --- debian/changelog | 6 ++++++ raspi-config | 27 ++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index b0a1232..935e256 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +raspi-config (20200203) buster; urgency=medium + + * Add pixel doubling option for FKMS using xrandr + + -- Simon Long Mon, 03 Feb 2020 09:36:38 +0000 + raspi-config (20200120) buster; urgency=medium * Add audio switching for discrete internal ALSA devices diff --git a/raspi-config b/raspi-config index 2a53bff..248a4ab 100755 --- a/raspi-config +++ b/raspi-config @@ -353,7 +353,7 @@ do_blanking() { } get_pixdub() { - if is_pi ; then + if is_pi && ! is_fkms; then FBW=$(get_config_var framebuffer_width $CONFIG) if [ $FBW -eq 0 ]; then echo 1 @@ -361,7 +361,7 @@ get_pixdub() { echo 0 fi else - if [ -e /etc/profile.d/pd.sh ] ; then + if grep -q 'scale 0.5x0.5' /usr/share/dispsetup.sh ; then echo 0 else echo 1 @@ -377,12 +377,6 @@ is_number() { } do_pixdub() { - if is_fkms ; then - if [ "$INTERACTIVE" = True ]; then - whiptail --msgbox "Pixel doubling cannot be used with the GL driver" 20 60 1 - fi - return 1 - fi DEFAULT=--defaultno CURRENT=0 if [ $(get_pixdub) -eq 0 ]; then @@ -395,7 +389,7 @@ do_pixdub() { else RET=$1 fi - if is_pi ; then + if is_pi && ! is_fkms; then if [ $RET -eq 0 ] ; then XVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f3 -d' ') YVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f5 -d' ') @@ -420,21 +414,28 @@ do_pixdub() { return $RET fi else - if [ -e /etc/profile.d/pd.sh ] ; then - rm /etc/profile.d/pd.sh - fi if [ $RET -eq 0 ] ; then + if [ -e /usr/share/dispsetup.sh ] ; then + rm /usr/share/dispsetup.sh + fi + echo '#!/bin/sh' > /usr/share/dispsetup.sh DEV=$(xrandr | grep -w connected | cut -f1 -d' ') for item in $DEV do - echo xrandr --output $item --scale 0.5x0.5 >> /etc/profile.d/pd.sh + echo xrandr --output $item --scale 0.5x0.5 >> /usr/share/dispsetup.sh done STATUS=enabled elif [ $RET -eq 1 ]; then + if [ -e /usr/share/dispsetup.sh ] ; then + rm /usr/share/dispsetup.sh + fi + echo '#!/bin/sh' > /usr/share/dispsetup.sh + echo 'exit 0' >> /usr/share/dispsetup.sh STATUS=disabled else return $RET fi + chmod a+x /usr/share/dispsetup.sh fi if [ $RET -eq $CURRENT ]; then ASK_TO_REBOOT=1