Add pixel doubling for FKMS

This commit is contained in:
Simon Long 2020-02-03 09:38:15 +00:00
parent 629699ff9b
commit 951b1b7996
2 changed files with 20 additions and 13 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
raspi-config (20200203) buster; urgency=medium
* Add pixel doubling option for FKMS using xrandr
-- Simon Long <simon@raspberrypi.org> Mon, 03 Feb 2020 09:36:38 +0000
raspi-config (20200120) buster; urgency=medium raspi-config (20200120) buster; urgency=medium
* Add audio switching for discrete internal ALSA devices * Add audio switching for discrete internal ALSA devices

View File

@ -353,7 +353,7 @@ do_blanking() {
} }
get_pixdub() { get_pixdub() {
if is_pi ; then if is_pi && ! is_fkms; then
FBW=$(get_config_var framebuffer_width $CONFIG) FBW=$(get_config_var framebuffer_width $CONFIG)
if [ $FBW -eq 0 ]; then if [ $FBW -eq 0 ]; then
echo 1 echo 1
@ -361,7 +361,7 @@ get_pixdub() {
echo 0 echo 0
fi fi
else else
if [ -e /etc/profile.d/pd.sh ] ; then if grep -q 'scale 0.5x0.5' /usr/share/dispsetup.sh ; then
echo 0 echo 0
else else
echo 1 echo 1
@ -377,12 +377,6 @@ is_number() {
} }
do_pixdub() { 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 DEFAULT=--defaultno
CURRENT=0 CURRENT=0
if [ $(get_pixdub) -eq 0 ]; then if [ $(get_pixdub) -eq 0 ]; then
@ -395,7 +389,7 @@ do_pixdub() {
else else
RET=$1 RET=$1
fi fi
if is_pi ; then if is_pi && ! is_fkms; then
if [ $RET -eq 0 ] ; then if [ $RET -eq 0 ] ; then
XVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f3 -d' ') XVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f3 -d' ')
YVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f5 -d' ') YVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f5 -d' ')
@ -420,21 +414,28 @@ do_pixdub() {
return $RET return $RET
fi fi
else else
if [ -e /etc/profile.d/pd.sh ] ; then
rm /etc/profile.d/pd.sh
fi
if [ $RET -eq 0 ] ; then 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' ') DEV=$(xrandr | grep -w connected | cut -f1 -d' ')
for item in $DEV for item in $DEV
do 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 done
STATUS=enabled STATUS=enabled
elif [ $RET -eq 1 ]; then 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 STATUS=disabled
else else
return $RET return $RET
fi fi
chmod a+x /usr/share/dispsetup.sh
fi fi
if [ $RET -eq $CURRENT ]; then if [ $RET -eq $CURRENT ]; then
ASK_TO_REBOOT=1 ASK_TO_REBOOT=1