tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PING sys/dev/videomode: latest DMT and complete Established Timings



Since there are some infelicities in the handling of the resolution of
the framebuffer (10.0_BETA doesn't behave as 9.3), I have started to
review the code, starting from the end: the monitor.

The monitor being the reference, I have replaced the modelines, derived
from XFree86, with the reference: the latest VESA DMT (v 1.0, Rev. 13)
---that is ahead compared to:
/usr/xsrc/external/mit/xorg-server/dist/hw/xfree86/common/vesamodes.

This file is: "dmt".

I have also put modes not found in VESA DMT, but referenced in the
Established Timings, so in VESA EDID, in a file "extradmt".

XFree86 modelines can be easily computed from the DMT. The reverse is
not true. Furthermore there are various VESA identifiers (one, two or
three bytes) that will be used in the future.

It is interesting to note, too, that there are discrepancies between
what is found in the XFree86 modelines and what can be found in the
modelines in the Linux framebuffer code---for one Established Timing
mode, I had to resort to the Linux parameters since what is found in
the XFree86 (at least 10.0 xsrc) is not accurate.

"dmt" replaces "modelines"
"extradmt" is new.
"dmt2c.awk" replaces "modelines2c.awk"

"videomode.c" has to be regenerated using Makefile.videomode.

The remaining diff is adjustements for the new parameters.

For ergonomy and consistancy, I have replaced strings like "800x600x60"
by "800x600@60Hz".

There are now 93 modes instead of 46 (the double scan entries and the
related code weren't used; and this is not used in the present code
either).

For safety, not knowing if this has hardware implications, the new
"reduced blanking" entries are skipped.

This is only a first step and does not solve the problem I see.

The next step will be reviewing and perhaps updating the edid code.
And I will follow the track until I find why the preferences are
not handled correctly from what is passed by the monitor.

Note: this one infelicity, for me, is not severe enough to hinder, per
se, the release of 10.0.
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C
# $NetBSD$
# These values were typed by Thierry Laronde <tlaronde%polynum.com@localhost>,
# 2023-02-27, from:
# 
# ----------
# VESA and Industry Standards and Guidelines
# for Computer Display Monitor Timing (DMT)
# Version 1.0, Rev. 13
# February 8, 2013
# Copyright 1994--2013 Video Electronics Standards Association. All
# other rights reserved.
# ----------
# 
# In brief the document above states: USE AT YOUR OWN RISKS.
# 
# This master file has only values as given in the specification
# identified above.
# 
# The values should have been taken as is. From these values, others can
# be derived and there is even some redundancy (see the processing
# script for the computations). The records are in the same order as in
# the document: first line corresponds to page 18; last line to page
# 105. There hence should be 88 different records here.
# 
# In this file, empty or blank lines or lines beginning with a '#' are
# ignored.
#
# Remaining are a sequence of line terminated records, with the
# following blank separated fields:
# 
# Timing_Name /* Hor_Pixels 'x' Ver_Pixels '@' Refresh_Rate 'Hz' suffix */
# Ids /* DMT_Id ',' STD_Id ',' CVT_Id (1 hexabyte, [2h] , [3h]) */
# Hor_Pixels
# Ver_Pixels
# Pixel_Clock /* MHz */
# Character_Width
# Flags /* Scan_Type ('I' | 'N') ',' Reduced_Blanking ('RB' | 'N') */
# Hor_Sync_Polarity /* '+' | '-' */
# Ver_Sync_Polarity /* '+' | '-' */
# H_Right_Border
# H_Front_Porch
# Hor_Sync_Time
# H_Back_Porch
# H_Left_Border
# V_Bottom_Border
# V_Front_Porch
# Ver_Sync_Time
# V_Back_Porch
# V_Top_Border
# 
640x350@85Hz 01,, 640 350 31.500 8 N,N + - 0 4 8 12 0 0 32 3 60 0
640x400@85Hz 02,3119, 640 400 31.500 8 N,N - + 0 4 8 12 0 0 1 3 41 0
720x400@85Hz 03,, 720 400 35.500 9 N,N - + 0 4 8 12 0 0 1 3 42 0
640x480@60Hz 04,3140, 640 480 25.175 8 N,N - - 1 1 12 5 1 8 2 2 25 8
640x480@72Hz 05,314C, 640 480 31.500 8 N,N - - 1 2 5 15 1 8 1 3 20 8
640x480@75Hz 06,314F, 640 480 31.500 8 N,N - - 0 2 8 15 0 0 1 3 16 0
640x480@85Hz 07,3159, 640 480 36.000 8 N,N - - 0 7 7 10 0 0 1 3 25 0
800x600@56Hz 08,, 800 600 36.000 8 N,N + + 0 3 9 16 0 0 1 2 22 0
800x600@60Hz 09,4540, 800 600 40.000 8 N,N + + 0 5 16 11 0 0 1 4 23 0
800x600@72Hz 0A,454C, 800 600 50.000 8 N,N + + 0 7 15 8 0 0 37 6 23 0
800x600@75Hz 0B,454F, 800 600 49.500 8 N,N + + 0 2 10 20 0 0 1 3 21 0
800x600@85Hz 0C,4559, 800 600 56.250 8 N,N + + 0 4 8 19 0 0 1 3 27 0
800x600@120Hz_rb 0D,, 800 600 73.25 8 N,RB + - 0 6 4 10 0 0 3 4 29 0
848x480@60Hz 0E,, 848 480 33.750 8 N,N + + 0 2 14 14 0 0 6 8 23 0
1024x768@43Hz_i 0F,, 1024 768 44.900 8 I,N + + 0 1 22 7 0 0 0 4 20 0
1024x768@60Hz 10,6140, 1024 768 65.000 8 N,N - - 0 3 17 20 0 0 3 6 29 0
1024x768@70Hz 11,614A, 1024 768 75.000 8 N,N - - 0 3 17 18 0 0 3 6 29 0
1024x768@75Hz 12,614F, 1024 768 78.750 8 N,N + + 0 2 12 22 0 0 1 3 28 0
1024x768@85Hz 13,6159, 1024 768 94.500 8 N,N + + 0 6 12 26 0 0 1 3 36 0
1024x768@120Hz_rb 14,, 1024 768 115.500 8 N,RB + - 0 6 4 10 0 0 3 4 38 0
1152x864@75Hz 15,714F, 1152 864 108.000 8 N,N + + 0 8 16 32 0 0 1 3 32 0
1280x720@60Hz 55,81C0, 1280 720 74.250 1 N,N + + 0 110 40 220 0 0 5 5 20 0
1280x768@60Hz_rb 16,,7F1C21 1280 768 68.250 8 N,RB + - 0 6 4 10 0 0 3 7 12 0
1280x768@60Hz 17,,7F1C28 1280 768 79.500 8 N,N - + 0 8 16 24 0 0 3 7 20 0
1280x768@75Hz 18,,7F1C44 1280 768 102.250 8 N,N - + 0 10 16 26 0 0 3 7 27 0
1280x768@85Hz 19,,7F1C62 1280 768 117.500 8 N,N - + 0 10 17 27 0 0 3 7 31 0
1280x768@120Hz_rb 1A,, 1280 768 140.250 8 N,RB + - 0 6 4 10 0 0 3 7 35 0
1280x800@60Hz_rb 1B,,8F1821 1280 800 71.000 8 N,RB + - 0 6 4 10 0 0 3 6 14 0
1280x800@60Hz 1C,8100,8F1828 1280 800 83.500 8 N,N - + 0 9 16 25 0 0 3 6 22 0
1280x800@75Hz 1D,810F,8F1844 1280 800 106.500 8 N,N - + 0 10 16 26 0 0 3 6 29 0
1280x800@85Hz 1F,8119,8F1862 1280 800 122.500 8 N,N - + 0 10 17 27 0 0 3 6 34 0
1280x800@120Hz_rb 1F,, 1280 800 146.250 8 N,RB + - 0 6 4 10 0 0 3 6 38 0
1280x960@60Hz 20,8140, 1280 960 108.000 8 N,N + + 0 12 14 39 0 0 1 3 36 0
1280x960@85Hz 21,8159, 1280 960 148.500 8 N,N + + 0 8 20 28 0 0 1 3 47 0
1280x960@120Hz_rb 22,, 1280 960 175.500 8 N,RB + - 0 6 4 10 0 0 3 4 50 0
1280x1024@60Hz 23,8180, 1280 1024 108.000 8 N,N + + 0 6 14 31 0 0 1 3 38 0
1280x1024@75Hz 24,818F, 1280 1024 135.000 8 N,N + + 0 2 18 31 0 0 1 3 38 0
1280x1024@85Hz 25,8199, 1280 1024 157.500 8 N,N + + 0 8 20 28 0 0 1 3 44 0
1280x1024@120Hz_rb 26,, 1280 1024 187.250 8 N,RB + - 0 6 4 10 0 0 3 7 50 0
1360x768@60Hz 27,, 1360 768 85.500 8 N,N + + 0 8 14 32 0 0 3 6 18 0
1360x768@120Hz_rb 28,, 1360 768 148.250 8 N,RB + - 0 6 4 10 0 0 3 5 37 0
1366x768@60Hz 51,, 1366 768 85.500 1 N,N + + 0 70 143 213 0 0 3 3 24 0
1366x768@60Hz_rb 56,, 1366 768 72.000 1 N,RB + + 0 14 56 64 0 0 1 3 28 0
1400x1050@60Hz_rb 29,,0C2021 1400 1050 101.000 8 N,RB + - 0 6 4 10 0 0 3 4 23 0
1400x1050@60Hz 2A,9040,0C2028 1400 1050 121.750 8 N,N - + 0 11 18 29 0 0 3 4 32 0
1400x1050@75Hz 2B,904F,0C2044 1400 1050 156.000 8 N,N - + 0 13 18 31 0 0 3 4 42 0
1400x1050@85Hz 2C,9059,0C2062 1400 1050 179.500 8 N,N - + 0 13 19 32 0 0 3 4 48 0
1400x1050@120Hz_rb 2D,, 1400 1050 208.000 8 N,RB + - 0 6 4 10 0 0 3 4 55 0
1440x900@60Hz_rb 2E,,C11821 1440 900 88.750 8 N,RB + - 0 6 4 10 0 0 3 6 17 0
1440x900@60Hz 2F,9500,C11828 1440 900 106.500 8 N,N - + 0 10 19 29 0 0 3 6 25 0
1440x900@75Hz 30,950F,C11844 1440 900 136.750 8 N,N - + 0 12 19 31 0 0 3 6 33 0
1440x900@85Hz 31,9519,C11868 1440 900 157.000 8 N,N - + 0 13 19 32 0 0 3 6 39 0
1440x900@120Hz_rb 32,, 1440 900 182.750 8 N,RB + - 0 6 4 10 0 0 3 6 44 0
1600x900@60Hz_rb 53,A9C0, 1600 900 108.000 8 N,RB + + 0 3 10 12 0 0 1 3 96 0
1600x1200@60Hz 33,A940, 1600 1200 162.000 8 N,N + + 0 8 24 38 0 0 1 3 46 0
1600x1200@65Hz 34,A945, 1600 1200 175.500 8 N,N + + 0 8 24 38 0 0 1 3 46 0
1600x1200@70Hz 35,A94A, 1600 1200 189.000 8 N,N + + 0 8 24 38 0 0 1 3 46 0
1600x1200@75Hz 36,A94F, 1600 1200 202.500 8 N,N + + 0 8 24 38 0 0 1 3 46 0
1600x1200@85Hz 37,A959, 1600 1200 229.500 8 N,N + + 0 8 24 38 0 0 1 3 46 0
1600x1200@120Hz_rb 38,, 1600 1200 268.250 8 N,RB + - 0 6 4 10 0 0 3 4 64 0
1680x1050@60Hz_rb 39,,0C2821 1680 1050 119.000 8 N,RB + - 0 6 4 10 0 0 3 6 21 0
1680x1050@60Hz 3A,B300,0C2828 1680 1050 146.250 8 N,N - + 0 13 22 35 0 0 3 6 30 0
1680x1050@75Hz 3B,B30F,0C2844 1680 1050 187.000 8 N,N - + 0 15 22 37 0 0 3 6 40 0
1680x1050@85Hz 3C,B319,0C2868 1680 1050 214.750 8 N,N - + 0 16 22 38 0 0 3 6 46 0
1680x1050@120Hz_rb 3D,, 1680 1050 245.500 8 N,RB + - 0 6 4 10 0 0 3 6 53 0
1792x1344@60Hz 3E,C140, 1792 1344 204.750 8 N,N - + 0 16 25 41 0 0 1 3 46 0
1792x1344@75Hz 3F,C14F, 1792 1344 261.000 8 N,N - + 0 12 27 44 0 0 1 3 69 0
1792x1344@120Hz_rb 40,, 1792 1344 333.250 8 N,RB + - 0 6 4 10 0 0 3 4 72 0
1856x1392@60Hz 41,C940, 1856 1392 218.250 8 N,N - + 0 12 28 44 0 0 1 3 43 0
1856x1392@75Hz 42,C94F, 1856 1392 288.000 8 N,N - + 0 16 28 44 0 0 1 3 104 0
1856x1392@120Hz_rb 43,, 1856 1392 356.500 8 N,RB + - 0 6 4 10 0 0 3 4 75 0
1920x1080@60Hz 52,D1C0, 1920 1080 148.500 4 N,N + + 0 22 11 37 0 0 4 5 36 0
1920x1200@60Hz_rb 44,,572821 1920 1200 154.000 8 N,RB + - 0 6 4 10 0 0 3 6 26 0
1920x1200@60Hz 45,D100,572828 1920 1200 193.250 8 N,N - + 0 17 25 42 0 0 3 6 36 0
1920x1200@75Hz 46,D10F,572844 1920 1200 245.250 8 N,N - + 0 17 26 43 0 0 3 6 46 0
1920x1200@85Hz 47,D119,572862 1920 1200 281.250 8 N,N - + 0 18 26 44 0 0 3 6 53 0
1920x1200@120Hz_rb 48,, 1920 1200 317.000 8 N,RB + - 0 6 4 10 0 0 3 6 62 0
1920x1440@60Hz 49,D140, 1920 1440 234.000 8 N,N - + 0 16 26 43 0 0 1 3 56 0
1920x1440@75Hz 4A,D14F, 1920 1440 297.000 8 N,N - + 0 18 28 44 0 0 1 3 56 0
1920x1440@120Hz_rb 4B,, 1920 1440 380.500 8 N,RB + - 0 6 4 10 0 0 3 4 78 0
2048x1152@60Hz 54,E1C0, 2048 1152 162.000 1 N,N + + 0 26 80 96 0 0 1 3 44 0
2560x1600@60Hz_rb 4C,,1F3821 2560 1600 268.500 8 N,RB + - 0 6 4 10 0 0 3 6 37 0
2560x1600@60Hz 4D,,1F3828 2560 1600 348.500 8 N,N - + 0 24 35 59 0 0 3 6 49 0
2560x1600@75Hz 4E,,1F3844 2560 1600 443.250 8 N,N - + 0 26 35 61 0 0 3 6 63 0
2560x1600@85Hz 4F,,1F3862 2560 1600 505.250 8 N,N - + 0 26 35 61 0 0 3 6 73 0
2560x1600@120Hz_rb 50,, 2560 1600 552.750 8 N,RB + - 0 6 4 10 0 0 3 6 85 0
4096x2160@60Hz_rb2 57,, 4096 2160 556.744 1 N,RB2 + - 0 8 32 40 0 0 48 8 6 0
4096x2160@59.94Hz_rb2 58,, 4096 2160 556.188 1 N,RB2 + - 0 8 32 40 0 0 48 8 6 0
# $NetBSD$
# Typed by Thierry Laronde <tlaronde%polynum.com@localhost> on 2023-02-27.
#
# The format shall be the same as the one described in the file "dmt"
# (see this file for reference).
#
# These values are just the VESA EDID Established timings that are not
# given in VESA DMT.
#
# They are derived from XFree86:
# xsrc/external/mit/xorg-server/dist/hw/xfree86/modes/xf86EdidModes.c
#
# For one value, the XFree86 file "xf86EdidModes.c" uses 1152x864@75Hz
# instead of the specified 1152x870@75Hz. We derive our parameters,
# instead, for the specified 1152x870@75Hz from the Linux file:
#
# drivers/video/fbdev/macmodes.c
#
# It must be noted that XFree86 and the Linux kernel, at least for
# the other Mac modes, do not agree...
#
# Since the values given do not specify the margins, for a line or a
# frame, and since the GTF doesn't apply (none of the parameters found
# from the above sources correspond to a GTF timing), all margins
# are taken as 0 and the blanking time is all in the porch times.
#
# This does mean that the "specifications" below are definitively _not_
# authoritative and should be taken for what they are worth.
#

# 832x624@75Hz Apple, Mac II
832x624@75Hz ,, 832 624 57.284 8 N,N - - 0 4 8 28 0 0 1 3 21 0

# 720x400@70Hz IBM, VGA
# VGA 80 x 25 with characters sized 9x16 pixels (and generally fonts
# with 8 pixels glyphes, the 9th pixel being the 8th pixel repeated,
# leading to a better separation of characters).
# There is a discrepancy in the dot clocks: the VGA dot clocks seems
# to have been fixed 25.175MHz and this is not what is given here...
#
720x400@70Hz ,, 720 400 28.320 9 N,N - + 0 2 12 6 0 0 12 2 35 0

# 720x400@88Hz IBM, XGA2
720x400@88Hz ,, 720 400 35.500 9 N,N - - 0 2 12 6 0 0 21 2 26 0

# 640x480@67Hz Apple, Mac II
640x480@67Hz ,, 640 480 30.240 8 N,N - - 0 8 8 12 0 0 3 3 39 0

# 1152x870@75Hz Apple, Mac II
1152x870@75Hz ,, 1152 870 100.000 8 N,N + + 0 6 16 16 0 0 3 3 39 0

# These are for documentation only (not "established"; but since I found
# the information on the Internet while searching for the established
# ones, these, unused, are saved here):
#
# 640x350@70Hz ,, 640 350 25.175 8 N,N + - 1 1 12 5 1 6 31 2 54 6
# 640x400@70Hz ,, 640 400 25.175 8 N,N - + 1 1 12 5 1 7 5 2 28 7
#! /usr/bin/awk -f
#	$NetBSD: modelines2c.awk,v 1.5 2011/03/21 19:32:26 jdc Exp $
#
# Copyright (c) 2023 Thierry Laronde <tlaronde%polynum.com@localhost>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#      This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
BEGIN {
	printf "/*\t$NetBSD" "$\t*/\n\n"
	printf "/*\n"
	printf " * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.\n"
	printf " *\n"
	printf " * generated from: %s\n", DMTSOURCES
	printf " */\n\n"

	printf "#include <sys/cdefs.h>\n"
	printf "#include <dev/videomode/videomode.h>\n\n"

	printf "/*\n"
	printf " * These macros improve readability.\n"
	printf " */\n"
	printf "#define HP VID_PHSYNC\n"
	printf "#define HN VID_NHSYNC\n"
	printf "#define VP VID_PVSYNC\n"
	printf "#define VN VID_NVSYNC\n"
	printf "#define I VID_INTERLACE\n"
	printf "#define RB VID_REDUCEDBLANKING\n"
	printf "\n"

	printf "const struct videomode videomode_list[] = {\n"

	nmodes = 0;
}
{
	if ($0 ~ /^#/ || $0 ~ /^[[:blank:]]*$/) next; # skip comments or empty lines

	# In a nutshell: everything is given according to the dot clock i.e.
	# is expressed in dots.
	#
	# One must know how long to draw; how long to wait before sending
	# the Hor Sync signal; how long to send the sync signal; how long to
	# wait before starting to draw again. So these, below, are actually
	# times, taking into account that the specification handles chars
	# as a unit for horizontal lines, that are eventually defined as a
	# number of pixels (dots):
	#
	# hdisplay: the line addressable length i.e. the H resolution
	# hsync_start: hdisplay + H_Right_Border + H_Front_Porch
	# hsync_end: hsync_start + Hor_Sync_Time
	# htotal: hsync_end + H_Back_Porch + H_Left_Border.
	#
	# Vertical is not considering lines, but frames. This is homologous:
	#
	# vdisplay: the vertical addressable length i.e. the V resolution
	# vsync_start: vdisplay + V_Bottom_Border + V_Front_Porch
	# vsync_end: vsync_start + Ver_Sync_Time
	# vtotal: vsync_end + V_Back_Porch + V_Top_Border.
	#
	# So from the definitions above, per direction, the numbers
	# increase.

	printf "\t{"
	printf " %d", int($5 * 1000) # dot clock in kHz

	# Horizontal specification:
	printf ", %d", $3
	printf ", %d", $3 + ($10 + $11) * $6 
	printf ", %d", $3 + ($10 + $11 + $12) * $6
	printf ", %d", $3 + ($10 + $11 + $12 + $13 + $14) * $6

	# Vertical specification:
	printf ", %d", $4
	printf ", %d", $4 + $15 + $16
	printf ", %d", $4 + $15 + $16 + $17
	printf ", %d", $4 + $15 + $16 + $17 + $18 + $19

	if ($8 == "+")
		flags = "HP"
	else
		flags = "HN"
	if ($9 == "+")
		flags = flags "|" "VP"
	else
		flags = flags "|" "VN"

	split($7, flag, ",")
	if (flag[1] == "I") flags = flags "|" "I"
	if (flag[2] == "RB" || flag[2] == "RB2") flags = flags "|" "RB"

	printf ", %s", flags

	printf ", \"%s\"", $1

	printf " },\n"
	++nmodes
}

END {
	printf "};\n\n"
	printf "const int videomode_count = %d;\n", nmodes
}
Index: sys/dev/videomode/Makefile.videomode
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/dev/videomode/Makefile.videomode,v
retrieving revision 1.2
diff -u -r1.2 Makefile.videomode
--- sys/dev/videomode/Makefile.videomode	19 Oct 2008 22:05:23 -0000	1.2
+++ sys/dev/videomode/Makefile.videomode	27 Feb 2023 11:07:10 -0000
@@ -2,16 +2,22 @@
 #
 # As per tron%NetBSD.org@localhost, the proper procedure is
 #
-# 1.) Change "src/sys/dev/videomode/modelines".
-# 2.) Commit "src/sys/dev/videomode/modelines".
+# 1.) Change "src/sys/dev/videomode/dmt" and/or
+#   "src/sys/dev/videomode/extradmt".
+# 2.) Commit the above files changed.
 # 3.) Execute "make -f Makefile.videomode" in "src/sys/dev/videomode".
 # 4.) Commit "src/sys/dev/videomode/videomode.c"
 
 .include <bsd.own.mk>
 
-videomode.c: modelines modelines2c.awk
+# We put the extra modes first simply because they are Established
+# timings: let them be found the more rapidly. No other sorting done.
+#
+DMTSOURCES = extradmt dmt
+
+videomode.c: dmt extradmt dmt2c.awk
 	/bin/rm -f videomode.c
-	${TOOL_AWK} -f modelines2c.awk modelines > videomode.c
+	/bin/cat $(DMTSOURCES) | ${TOOL_AWK} -v DMTSOURCES="$(DMTSOURCES)" -f dmt2c.awk > videomode.c
 
 test: videomode.c videomode.h test.c
 	${CC} -I ../../ -o test test.c videomode.c
Index: sys/dev/videomode/edid.c
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/dev/videomode/edid.c,v
retrieving revision 1.18
diff -u -r1.18 edid.c
--- sys/dev/videomode/edid.c	25 Sep 2022 21:27:39 -0000	1.18
+++ sys/dev/videomode/edid.c	27 Feb 2023 11:07:10 -0000
@@ -58,22 +58,22 @@
 
 /* These are reversed established timing order */
 static const char *_edid_modes[] =  {
-	"1280x1024x75",
-	"1024x768x75",
-	"1024x768x70",
-	"1024x768x60",
-	"1024x768x87i",
-	"832x624x74",	/* rounding error, 74.55 Hz aka "832x624x75" */
-	"800x600x75",
-	"800x600x72",
-	"800x600x60",
-	"800x600x56",
-	"640x480x75",
-	"640x480x72",
-	"640x480x67",
-	"640x480x60",
-	"720x400x87",	/* rounding error, 87.85 Hz aka "720x400x88" */
-	"720x400x70",
+	"1280x1024@75Hz", 
+	"1024x768@75Hz",
+	"1024x768@70Hz",
+	"1024x768@60Hz",
+	"1024x768@87Hz_i", /* not VESA */
+	"832x624@75Hz", /* not VESA */
+	"800x600@75Hz",
+	"800x600@72Hz",
+	"800x600@60Hz",
+	"800x600@56Hz",
+	"640x480@75Hz",
+	"640x480@72Hz",
+	"640x480@67Hz", /* not VESA */
+	"640x480@60Hz", /* not VESA */
+	"720x400@88Hz", /* not VESA */
+	"720x400@70Hz", /* not VESA */
 };
 
 #ifdef	EDIDVERBOSE
@@ -359,7 +359,7 @@
 	f = EDID_STD_TIMING_VFREQ(data);
 
 	/* first try to lookup the mode as a DMT timing */
-	snprintf(name, sizeof(name), "%dx%dx%d", x, y, f);
+	snprintf(name, sizeof(name), "%dx%d@%dHz", x, y, f);
 	if ((lookup = edid_mode_lookup_list(name)) != NULL) {
 		*vmp = *lookup;
 	} else {
Index: sys/dev/videomode/pickmode.c
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/dev/videomode/pickmode.c,v
retrieving revision 1.4
diff -u -r1.4 pickmode.c
--- sys/dev/videomode/pickmode.c	9 Apr 2011 20:53:39 -0000	1.4
+++ sys/dev/videomode/pickmode.c	27 Feb 2023 11:07:10 -0000
@@ -51,6 +51,10 @@
 	    height, dotclock);
 	for (i = 0; i < videomode_count; i++) {
 		this = &videomode_list[i];
+
+		/* For now, skip Reduced Blanking entries [TL] */
+		if (this->flags & VID_REDUCEDBLANKING) continue;
+
 		if ((this->hdisplay != width) || (this->vdisplay != height) ||
 		    (this->dot_clock > dotclock))
 			continue;
@@ -77,6 +81,10 @@
 	for (i = 0; i < videomode_count; i++) {
 
 		this = &videomode_list[i];
+
+		/* For now, skip Reduced Blanking entries [TL] */
+		if (this->flags & VID_REDUCEDBLANKING) continue;
+
 		mref = this->dot_clock * 1000 / (this->htotal * this->vtotal);
 		diff = abs(mref - refresh);
 		if ((this->hdisplay != width) || (this->vdisplay != height))
Index: sys/dev/videomode/videomode.h
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/dev/videomode/videomode.h,v
retrieving revision 1.3
diff -u -r1.3 videomode.h
--- sys/dev/videomode/videomode.h	9 Apr 2011 18:22:31 -0000	1.3
+++ sys/dev/videomode/videomode.h	27 Feb 2023 11:07:10 -0000
@@ -62,6 +62,7 @@
 #define VID_PIXMUX	0x1000
 #define VID_DBLCLK	0x2000
 #define VID_CLKDIV2	0x4000
+#define VID_REDUCEDBLANKING	0x8000
 
 extern const struct videomode videomode_list[];
 extern const int videomode_count;


Home | Main Index | Thread Index | Old Index