summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/bin/screenres
diff options
context:
space:
mode:
Diffstat (limited to 'initrd/initrd-stuff/bin/screenres')
-rwxr-xr-xinitrd/initrd-stuff/bin/screenres21
1 files changed, 12 insertions, 9 deletions
diff --git a/initrd/initrd-stuff/bin/screenres b/initrd/initrd-stuff/bin/screenres
index 190a9bb4..d9d13e00 100755
--- a/initrd/initrd-stuff/bin/screenres
+++ b/initrd/initrd-stuff/bin/screenres
@@ -19,7 +19,7 @@
#
## For CRTs determine recommended screen modes ####################################################
-DEBUG=""
+DEBUG="yes"
function calculate_max_horizontal_freq()
{
@@ -29,9 +29,9 @@ function calculate_max_horizontal_freq()
#Search for a number followed by the term "Hz" in the same line as the highest resolution
freq_for_highest_res=`sed -n /$highest_resolution'/s/.*[^a-zA-Z0-9]\([0-9]\{2,3\}\)[ \t]*[Hh][Zz].*/\1/p' $tmp_ddcprobe_output | sort -nr|sed -n 1p`
fi
- highest_res_line_count=` echo $highest_resolution | sed -n 's/x[0-9]*//p'`
+ highest_res_line_count=` echo $highest_resolution | sed -n 's/.*[0-9]*x//p'`
[ -n "$DEBUG" ] && echo " # of lines in highest res.: $highest_res_line_count"
- horiz_freq_khz=$(( $highest_res_line_count * $freq_for_highest_res /1000))
+ horiz_freq_khz=$(( $highest_res_line_count * $freq_for_highest_res / 950)) # 950 = 0,95 * 1000 (invisible range * Kilohertz)
[ -n "$DEBUG" ] && echo " Assumed Horizontal Frequency: $horiz_freq_khz"
}
function determine_recommended_crt_modes()
@@ -168,18 +168,12 @@ if [ -n "$DEBUG" ];then
echo " ($tft_probability)"
fi
-########################################
-
# Find the lines with two times 3 to 4 digits delimited by an x. Print with the two values reverted, so sort sorts w.r.t the 2nd value. Then swap back
screen_resolutions=`sed -n '/edid/I,$s/.*[ \t]\([0-9]\{3,4\}\) *x *\([0-9]\{3,4\}\).*/\2 x \1/p' ${tmp_ddcprobe_output}| sort -rn | sort -rnu | sed -n 's/\([0-9]\{3,4\}\) x \([0-9]\{3,4\}\).*/"\2x\1"/p' `
screen_resolutions=`echo $screen_resolutions`
echo "Supported Screen Modes: $screen_resolutions"
-if [ $tft_probability -lt 50 ]; then
- determine_recommended_crt_modes;
-fi
-echo "Recommended Screen Modes: $screen_resolutions"
######## Vertical and horizontal frequency ranges #########
# find a line with the word range and and numbers with a minus in the middle (e.g 123-321)
@@ -191,6 +185,15 @@ if [ -z "$frequency_ranges" ]; then
horiz_freq_range="31.5-$horiz_freq_khz"
else horiz_freq_range=$1
fi
+########################################
+
+
+if [ $tft_probability -lt 50 ]; then
+ determine_recommended_crt_modes;
+fi
+
+echo "Recommended Screen Modes: $screen_resolutions"
+
#Fixme: How to Calculate the Vertical Refresh rate?
echo "Horizontal Frequency Range (kHz): $horiz_freq_range"
echo "Vertical Frequency Range (Hz): $2"