mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +00:00
projects/WeTek_Play/initramfs: Init framebuffer according to HDMI resolution from kernel command line
This commit is contained in:
parent
5d69b89842
commit
effad0ec41
@ -18,25 +18,14 @@
|
|||||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Force 720p display mode at startup
|
hdmimode=720p
|
||||||
echo 720p > /sys/class/display/mode
|
|
||||||
|
|
||||||
# Enable framebuffer device
|
|
||||||
echo 0 > /sys/class/graphics/fb0/blank
|
|
||||||
|
|
||||||
# Disable framebuffer scaling
|
|
||||||
echo 0 > /sys/class/graphics/fb0/free_scale
|
|
||||||
|
|
||||||
# Set framebuffer geometry
|
|
||||||
fbset -fb /dev/fb0 -g 1280 720 1280 1440 32
|
|
||||||
|
|
||||||
# Include deinterlacer into default VFM map
|
|
||||||
echo rm default > /sys/class/vfm/map
|
|
||||||
echo add default decoder ppmgr deinterlace amvideo > /sys/class/vfm/map
|
|
||||||
|
|
||||||
# Parse command line arguments
|
# Parse command line arguments
|
||||||
for arg in $(cat /proc/cmdline); do
|
for arg in $(cat /proc/cmdline); do
|
||||||
case $arg in
|
case $arg in
|
||||||
|
hdmimode=*)
|
||||||
|
hdmimode="${arg#*=}"
|
||||||
|
;;
|
||||||
scaling_governor=*)
|
scaling_governor=*)
|
||||||
scaling_governor="${arg#*=}"
|
scaling_governor="${arg#*=}"
|
||||||
;;
|
;;
|
||||||
@ -49,6 +38,28 @@ for arg in $(cat /proc/cmdline); do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "$hdmimode" > /sys/class/display/mode
|
||||||
|
|
||||||
|
# Enable framebuffer device
|
||||||
|
echo 0 > /sys/class/graphics/fb0/blank
|
||||||
|
|
||||||
|
# Disable framebuffer scaling
|
||||||
|
echo 0 > /sys/class/graphics/fb0/free_scale
|
||||||
|
|
||||||
|
# Set framebuffer geometry to match the resolution
|
||||||
|
case "$hdmimode" in
|
||||||
|
720*)
|
||||||
|
fbset -fb /dev/fb0 -g 1280 720 1280 1440 32
|
||||||
|
;;
|
||||||
|
1080*)
|
||||||
|
fbset -fb /dev/fb0 -g 1920 1080 1920 2160 32
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Include deinterlacer into default VFM map
|
||||||
|
echo rm default > /sys/class/vfm/map
|
||||||
|
echo add default decoder ppmgr deinterlace amvideo > /sys/class/vfm/map
|
||||||
|
|
||||||
# Boot with performance governor, then switch to the governor specified in the kernel command line
|
# Boot with performance governor, then switch to the governor specified in the kernel command line
|
||||||
for cpufreq in /sys/devices/system/cpu/cpu[0-9]*/cpufreq; do
|
for cpufreq in /sys/devices/system/cpu/cpu[0-9]*/cpufreq; do
|
||||||
if [ -n "$scaling_governor" ]; then
|
if [ -n "$scaling_governor" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user