Improve hdmi support on x55, add a hotkey to kill ES for switching between internal and hdmi displays without rebooting.
This commit is contained in:
parent
3bb6cd1d23
commit
c9938ed45d
8 changed files with 27 additions and 2 deletions
|
@ -12,6 +12,10 @@ DEVICE_PLAYBACK_PATH_HP="HP"
|
|||
#DEVICE_HEADPHONE_DEV=""
|
||||
DEVICE_BRIGHTNESS="128"
|
||||
DEVICE_ROTATED_SDL=true
|
||||
|
||||
HDMI_STATE="/sys/class/extcon/hdmi/state"
|
||||
HDMI_DETECT_PATTERN="HDMI=1"
|
||||
|
||||
UI_SERVICE="emustation.service"
|
||||
|
||||
# Kernel Modules
|
||||
|
|
|
@ -27,6 +27,9 @@ if [ ! "\${HDMI}" = "HDMI=1" ]
|
|||
then
|
||||
SDL=\$(readlink -f /usr/lib/SDL2-rotated/libSDL2.so 2>/dev/null)
|
||||
export LD_PRELOAD="\${SDL}"
|
||||
else
|
||||
SDL=\$(readlink -f /usr/lib/libSDL2.so 2>/dev/null)
|
||||
export LD_PRELOAD="\${SDL}"
|
||||
fi
|
||||
EOF
|
||||
|
||||
|
|
|
@ -39,4 +39,6 @@ export SLOW_CORES \
|
|||
DEVICE_VOLUMECTL \
|
||||
DEVICE_WIFI \
|
||||
DEVICE_WIFI_MODULE \
|
||||
HDMI_DETECT_PATTERN \
|
||||
HDMI_STATE \
|
||||
UI_SERVICE
|
||||
|
|
|
@ -193,7 +193,7 @@ EOF
|
|||
function quit() {
|
||||
$VERBOSE && log $0 "Cleaning up and exiting"
|
||||
bluetooth enable
|
||||
jslisten stop
|
||||
jslisten set "emulationstation"
|
||||
clear_screen
|
||||
DEVICE_CPU_GOVERNOR=$(get_setting system.cpugovernor)
|
||||
${DEVICE_CPU_GOVERNOR}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
. /etc/profile
|
||||
|
||||
NATIVE_ROTATION="$(awk 'match ($0, /fbcon=rotate:[0-3]/) {print substr($0, RSTART + 13, 1)}' /flash/extlinux/extlinux.conf)"
|
||||
|
||||
if [[ "$(cat ${HDMI_PROP})" =~ ${HDMI_PATTERN} ]]
|
||||
then
|
||||
echo 0 >/sys/devices/virtual/graphics/fbcon/rotate
|
||||
else
|
||||
echo ${NATIVE_ROTATION} >/sys/devices/virtual/graphics/fbcon/rotate
|
||||
fi
|
2
packages/sysutils/system-utils/udev.d/099-hdmi
Normal file
2
packages/sysutils/system-utils/udev.d/099-hdmi
Normal file
|
@ -0,0 +1,2 @@
|
|||
### Change FB rotation when hdmi is connected (Powkiddy x55)
|
||||
ACTION=="change", SUBSYSTEM=="extcon", ATTRS{name}=="*hdmi*", RUN+="/usr/bin/hdmi_sense"
|
|
@ -45,4 +45,4 @@ then
|
|||
fi
|
||||
|
||||
systemctl import-environment LD_PRELOAD
|
||||
|
||||
jslisten set "emulationstation"
|
||||
|
|
|
@ -44,4 +44,6 @@ then
|
|||
systemctl import-environment LANGUAGE
|
||||
fi
|
||||
|
||||
jslisten set "emulationstation"
|
||||
|
||||
emulationstation --log-path /var/log --no-splash
|
||||
|
|
Loading…
Reference in a new issue