#!/bin/sh ################################################################################ # This file is part of OpenELEC - http://www.openelec.tv # Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) # # OpenELEC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # OpenELEC is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with OpenELEC. If not, see . ################################################################################ hdmimode=1080p60hz # Parse command line arguments for arg in $(cat /proc/cmdline); do case $arg in hdmimode=*) hdmimode="${arg#*=}" ;; esac done # Enable first framebuffer echo 0 > /sys/class/graphics/fb0/blank # Disable second framebuffer echo 1 > /sys/class/graphics/fb1/blank # Disable framebuffer scaling echo 0 > /sys/class/graphics/fb0/free_scale echo 0 > /sys/class/graphics/fb1/free_scale # set initial video state echo 1 > /sys/class/video/disable_video # Set framebuffer geometry to match the resolution case $hdmimode in 480*) X=720 Y=480 ;; 576*) X=720 Y=576 ;; 720p*) X=1280 Y=720 ;; *) X=1920 Y=1080 ;; esac fbset -fb /dev/fb0 -g $X $Y 1920 2160 32 fbset -fb /dev/fb1 -g 32 32 32 32 32 # Enable scaling for 4K output case $hdmimode in 4k*|smpte*|2160*) echo 0 0 1919 1079 > /sys/class/graphics/fb0/free_scale_axis echo 0 0 3839 2159 > /sys/class/graphics/fb0/window_axis echo 1920 > /sys/class/graphics/fb0/scale_width echo 1080 > /sys/class/graphics/fb0/scale_height echo 0x10001 > /sys/class/graphics/fb0/free_scale ;; 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