mirror of
https://github.com/akatrevorjay/edid-generator.git
synced 2026-01-15 23:50:28 +01:00
Update edid.S from latest mainline kernel
This commit is contained in:
6
edid.S
6
edid.S
@@ -59,9 +59,9 @@
|
||||
/* Fixed header pattern */
|
||||
header: .byte 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00
|
||||
|
||||
mfg_id: .word swap16(mfgname2id(MFG_LNX1, MFG_LNX2, MFG_LNX3))
|
||||
mfg_id: .hword swap16(mfgname2id(MFG_LNX1, MFG_LNX2, MFG_LNX3))
|
||||
|
||||
prod_code: .word 0
|
||||
prod_code: .hword 0
|
||||
|
||||
/* Serial number. 32 bits, little endian. */
|
||||
serial_number: .long SERIAL
|
||||
@@ -177,7 +177,7 @@ std_vres: .byte (XY_RATIO<<6)+VFREQ-60
|
||||
|
||||
descriptor1:
|
||||
/* Pixel clock in 10 kHz units. (0.-655.35 MHz, little-endian) */
|
||||
clock: .word CLOCK/10
|
||||
clock: .hword CLOCK/10
|
||||
|
||||
/* Horizontal active pixels 8 lsbits (0-4095) */
|
||||
x_act_lsb: .byte XPIX&0xff
|
||||
|
||||
@@ -21,7 +21,7 @@ template-S() {
|
||||
local -i vdisp="$1" vsyncstart="$2" vsyncend="$3" vtotal="$4"; shift 4
|
||||
|
||||
local -i hsync_polarity=0 vsync_polarity=0 dpi=96 vfreq_hz=60
|
||||
local edid_version="1.3" ratio="16:9" # TODO calc ratio
|
||||
local edid_version="1.3" ratio="compute" # TODO calc ratio
|
||||
|
||||
local arg
|
||||
for arg in "$@"; do
|
||||
@@ -36,6 +36,30 @@ template-S() {
|
||||
esac
|
||||
done
|
||||
|
||||
case "$ratio" in
|
||||
compute)
|
||||
find-closest-ratio() {
|
||||
local x=$1 y=$2 default=$3; shift 3
|
||||
[ $# -gt 0 ] || set -- 16:10 16:9 4:3 5:4 # supported already in edid.S
|
||||
|
||||
local -A vals=()
|
||||
local r
|
||||
for r in "$@"; do
|
||||
local -i rx=${ratio%%:*} ry=${ratio#*:}
|
||||
local v=$(( abs( $x / $rx - $y / $ry ) ))
|
||||
vals[$v]=$
|
||||
done
|
||||
echo $(( $hdisp / 16 ))
|
||||
}
|
||||
ratio="16:9"
|
||||
if [[ $(( $hdisp / 16 - $vdisp / 9 )) -lt $(( h )) ]]; then
|
||||
local -a vals=($(( $hdisp / 4 - $vdisp / 3 )))
|
||||
for
|
||||
if [[ $(()) ]]
|
||||
;;
|
||||
esac
|
||||
|
||||
esac
|
||||
local -A defines
|
||||
defines=(
|
||||
TIMING_NAME "${(qqq)name}"
|
||||
|
||||
Reference in New Issue
Block a user