Merge "init: early_boot: Use virtual_size to set lcd_density"

This commit is contained in:
Linux Build Service Account 2015-11-18 02:41:52 -08:00 committed by Gerrit - the friendly Code Review server
commit b7ae5489be
1 changed files with 19 additions and 0 deletions

View File

@ -45,6 +45,11 @@ else
soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null
fi
if [ -f /sys/class/graphics/fb0/virtual_size ]; then
res=`cat /sys/class/graphics/fb0/virtual_size` 2> /dev/null
fb_width=${res%,*}
fi
log -t BOOT -p i "MSM target '$1', SoC '$soc_hwplatform', HwID '$soc_hwid', SoC ver '$soc_hwver'"
target=`getprop ro.board.platform`
@ -178,6 +183,20 @@ case "$target" in
;;
esac
;;
*)
if [ -z $fb_width ]; then
setprop ro.sf.lcd_density 320
else
if [ $fb_width -ge 1080 ]; then
setprop ro.sf.lcd_density 480
elif [ $fb_width -ge 720 ]; then
setprop ro.sf.lcd_density 320 #for 720X1280 resolution
elif [ $fb_width -ge 480 ]; then
setprop ro.sf.lcd_density 240 #for 480X854 QRD resolution
else
setprop ro.sf.lcd_density 160
fi
fi
esac
# Setup display nodes & permissions