init: early_boot:make default lcd density independent
Making default lcd density independent which is based on framebuffer width from target. It will not overwrite the previous density, if any target is setting forcefully. Change-Id: I807550276fb0579ba88ecdd0a15c7dbe78bbb73e
This commit is contained in:
parent
3b782bf9e9
commit
51f8045d96
|
@ -52,6 +52,22 @@ fi
|
|||
|
||||
log -t BOOT -p i "MSM target '$1', SoC '$soc_hwplatform', HwID '$soc_hwid', SoC ver '$soc_hwver'"
|
||||
|
||||
function set_density_by_fb() {
|
||||
#put default density based on width
|
||||
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
|
||||
}
|
||||
target=`getprop ro.board.platform`
|
||||
case "$target" in
|
||||
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
|
||||
|
@ -184,7 +200,6 @@ case "$target" in
|
|||
esac
|
||||
;;
|
||||
"msm8937")
|
||||
setprop ro.sf.lcd_density 480
|
||||
# Set ro.opengles.version based on chip id.
|
||||
# MSM8937 variants supports OpenGLES 3.1
|
||||
# 196608 is decimal for 0x30000 to report version 3.0
|
||||
|
@ -198,21 +213,12 @@ 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
|
||||
#set default lcd density
|
||||
#Since lcd density has read only
|
||||
#property, it will not overwrite previous set
|
||||
#property if any target is setting forcefully.
|
||||
set_density_by_fb
|
||||
|
||||
# Setup display nodes & permissions
|
||||
# HDMI can be fb1 or fb2
|
||||
|
|
Loading…
Reference in New Issue