mirror of
https://github.com/Fishwaldo/build.git
synced 2025-06-26 16:19:32 +00:00
added frame buffer configuration
This commit is contained in:
parent
347a169994
commit
e0e6bb182d
1 changed files with 38 additions and 5 deletions
43
packages/bsp/h3disp
Normal file → Executable file
43
packages/bsp/h3disp
Normal file → Executable file
|
@ -25,6 +25,8 @@
|
||||||
#
|
#
|
||||||
# CHANGES:
|
# CHANGES:
|
||||||
#
|
#
|
||||||
|
# v0.6: Added frame buffer config (fb[0-1]_format, fb[0-1]_width, fb[0-1]_height)
|
||||||
|
#
|
||||||
# v0.5: Added bare modes display (-i)
|
# v0.5: Added bare modes display (-i)
|
||||||
#
|
#
|
||||||
# v0.4: Added new modes in a combination with kernel patch, but they refuse to work.
|
# v0.4: Added new modes in a combination with kernel patch, but they refuse to work.
|
||||||
|
@ -102,6 +104,15 @@ Main() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -v FrameBuffer ]; then
|
||||||
|
re='^(0|4|5|6|7|8|9|10|12):[0-9]{1,4}:[0-9]{1,4}$'
|
||||||
|
if ! [[ ${FrameBuffer} =~ ${re} ]] ; then
|
||||||
|
echo "$0: Invalid frame buffer config data. use -h option to help."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
case ${VideoMode} in
|
case ${VideoMode} in
|
||||||
0|480i) # res
|
0|480i) # res
|
||||||
HDMIMode=0
|
HDMIMode=0
|
||||||
|
@ -224,7 +235,7 @@ Main() {
|
||||||
pll_video=688
|
pll_video=688
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ "X${VideoMode}" = "X" ]; then
|
if [ ${VideoMode} ]; then
|
||||||
echo -e "$0: missing video mode. Try one of the following:\n"
|
echo -e "$0: missing video mode. Try one of the following:\n"
|
||||||
else
|
else
|
||||||
echo -e "$0: illegal video mode \"-m ${VideoMode}\". Try one of the following:\n"
|
echo -e "$0: illegal video mode \"-m ${VideoMode}\". Try one of the following:\n"
|
||||||
|
@ -251,7 +262,7 @@ Main() {
|
||||||
} # Main
|
} # Main
|
||||||
|
|
||||||
ParseOptions() {
|
ParseOptions() {
|
||||||
while getopts 'hHvVdDm:M:c:C:i' c ; do
|
while getopts 'hHvVdDm:M:c:C:i:f:F' c ; do
|
||||||
case ${c} in
|
case ${c} in
|
||||||
H)
|
H)
|
||||||
export FullUsage=TRUE
|
export FullUsage=TRUE
|
||||||
|
@ -288,6 +299,10 @@ ParseOptions() {
|
||||||
# The colour-range in question
|
# The colour-range in question
|
||||||
export ColourRange=${OPTARG}
|
export ColourRange=${OPTARG}
|
||||||
;;
|
;;
|
||||||
|
f|F)
|
||||||
|
# Set frame buffer config
|
||||||
|
export FrameBuffer=${OPTARG}
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
} # ParseOptions
|
} # ParseOptions
|
||||||
|
@ -303,11 +318,11 @@ DisplayUsage() {
|
||||||
LGREEN='\033[1;32m'
|
LGREEN='\033[1;32m'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo -e "Usage: ${BOLD}${0##*/} [-h/-H] -m [video mode] [-d] [-c [0-2]]${NC}\n"
|
echo -e "Usage: ${BOLD}${0##*/} [-h/-H] -m [video mode] [-d] [-c [0-2]] [-f [fb_mode:fb_width:fb_height]]${NC}\n"
|
||||||
echo -e "############################################################################"
|
echo -e "############################################################################"
|
||||||
if [ ${FullUsage} ]; then
|
if [ ${FullUsage} ]; then
|
||||||
echo -e "\nDetailed Description:"
|
echo -e "\nDetailed Description:"
|
||||||
grep "^#" "$0" | grep -v "^#\!/bin/bash" | sed 's/^#//'
|
grep "^#" "$0" | grep -v "^#\!/bin/bash" | sed 's/^#//'
|
||||||
fi
|
fi
|
||||||
echo -e "\n This is a tool to set the display resolution of your Orange"
|
echo -e "\n This is a tool to set the display resolution of your Orange"
|
||||||
echo -e " Pi by patching script.bin.\n\n In case you use an HDMI-to-DVI converter\c"
|
echo -e " Pi by patching script.bin.\n\n In case you use an HDMI-to-DVI converter\c"
|
||||||
|
@ -319,6 +334,14 @@ DisplayUsage() {
|
||||||
echo -e " ${BOLD}0${NC} -- RGB range 16-255 (Default, use \"${LGREEN}-c 0${NC}\")"
|
echo -e " ${BOLD}0${NC} -- RGB range 16-255 (Default, use \"${LGREEN}-c 0${NC}\")"
|
||||||
echo -e " ${BOLD}1${NC} -- RGB range 0-255 (Full range, use \"${LGREEN}-c 1${NC}\")"
|
echo -e " ${BOLD}1${NC} -- RGB range 0-255 (Full range, use \"${LGREEN}-c 1${NC}\")"
|
||||||
echo -e " ${BOLD}2${NC} -- RGB range 16-235 (Limited video, \"${LGREEN}-c 2${NC}\")\n"
|
echo -e " ${BOLD}2${NC} -- RGB range 16-235 (Limited video, \"${LGREEN}-c 2${NC}\")\n"
|
||||||
|
echo -e "To change frame buffer config use ${LGREEN}-f${NC} option and data in format ${BOLD}fb_mode:fb_width:fb_height${NC} where:"
|
||||||
|
echo -e " ${BOLD}fb_mode${NC} :"
|
||||||
|
echo -e " ${LGREEN}0${NC} -- DEFAULT, ${LGREEN}4${NC} -- RGB655, ${LGREEN}5${NC} -- RGB565, ${LGREEN}6${NC} -- RGB556, ${LGREEN}7${NC} -- ARGB1555"
|
||||||
|
echo -e " ${LGREEN}8${NC} -- RGBA5551, ${LGREEN}9${NC} -- RGB888, ${LGREEN}10${NC} -- ARGB8888, ${LGREEN}12${NC} -- ARGB4444"
|
||||||
|
echo -e " ${BOLD}fb_width${NC}:"
|
||||||
|
echo -e " width resolution in pixel -- range 0-9999"
|
||||||
|
echo -e " ${BOLD}fb_height${NC}:"
|
||||||
|
echo -e " height resolution in pixel -- range 0-9999"
|
||||||
echo -e "############################################################################\n"
|
echo -e "############################################################################\n"
|
||||||
} # DisplayUsage
|
} # DisplayUsage
|
||||||
|
|
||||||
|
@ -418,6 +441,16 @@ PatchScriptBin() {
|
||||||
FexChange "${MyTmpFile}" "disp_init" "screen0_out_color_range" "${ColourRange}"
|
FexChange "${MyTmpFile}" "disp_init" "screen0_out_color_range" "${ColourRange}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -v FrameBuffer ]; then
|
||||||
|
FrameBuffer_config=($(echo "${FrameBuffer}" | tr ':' '\n'))
|
||||||
|
FexChange "${MyTmpFile}" "disp_init" "fb0_format" "${FrameBuffer_config[0]}"
|
||||||
|
FexChange "${MyTmpFile}" "disp_init" "fb0_width" "${FrameBuffer_config[1]}"
|
||||||
|
FexChange "${MyTmpFile}" "disp_init" "fb0_height" "${FrameBuffer_config[2]}"
|
||||||
|
FexChange "${MyTmpFile}" "disp_init" "fb1_format" "${FrameBuffer_config[0]}"
|
||||||
|
FexChange "${MyTmpFile}" "disp_init" "fb1_width" "${FrameBuffer_config[1]}"
|
||||||
|
FexChange "${MyTmpFile}" "disp_init" "fb1_height" "${FrameBuffer_config[2]}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "X$2" = "XTRUE" ]; then
|
if [ "X$2" = "XTRUE" ]; then
|
||||||
# add entries necessary for HDMI-to-DVI adapters
|
# add entries necessary for HDMI-to-DVI adapters
|
||||||
FexChange "${MyTmpFile}" "hdmi_para" "hdcp_enable" "0"
|
FexChange "${MyTmpFile}" "hdmi_para" "hdcp_enable" "0"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue