Skip to content

Commit 40c5030

Browse files
committed
edid: prefer standard timings
Windows guests using the "Basic Display Adapter" don't parse the "Established timings III" block. They also don't parse any edid extension. So prefer the "Standard Timings" block to store the display resolutions in edid_fill_modes(). Also reorder the mode list, so more exotic resolutions (specifically the ones which are not supported by vgabios) are moved down and the remaining ones have a better chance to get one of the eight slots in the "Standard Timings" block. Signed-off-by: Gerd Hoffmann <[email protected]> Message-Id: <[email protected]>
1 parent 181b4bb commit 40c5030

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

hw/display/edid-generate.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,20 @@ static const struct edid_mode {
2525
{ .xres = 1920, .yres = 1080, .dta = 31 },
2626

2727
/* additional standard timings 3 (all @ 60Hz) */
28-
{ .xres = 1920, .yres = 1440, .xtra3 = 11, .bit = 5 },
2928
{ .xres = 1920, .yres = 1200, .xtra3 = 10, .bit = 0 },
30-
{ .xres = 1856, .yres = 1392, .xtra3 = 10, .bit = 3 },
31-
{ .xres = 1792, .yres = 1344, .xtra3 = 10, .bit = 5 },
3229
{ .xres = 1600, .yres = 1200, .xtra3 = 9, .bit = 2 },
3330
{ .xres = 1680, .yres = 1050, .xtra3 = 9, .bit = 5 },
34-
{ .xres = 1440, .yres = 1050, .xtra3 = 8, .bit = 1 },
3531
{ .xres = 1440, .yres = 900, .xtra3 = 8, .bit = 5 },
36-
{ .xres = 1360, .yres = 768, .xtra3 = 8, .bit = 7 },
3732
{ .xres = 1280, .yres = 1024, .xtra3 = 7, .bit = 1 },
3833
{ .xres = 1280, .yres = 960, .xtra3 = 7, .bit = 3 },
3934
{ .xres = 1280, .yres = 768, .xtra3 = 7, .bit = 6 },
4035

36+
{ .xres = 1920, .yres = 1440, .xtra3 = 11, .bit = 5 },
37+
{ .xres = 1856, .yres = 1392, .xtra3 = 10, .bit = 3 },
38+
{ .xres = 1792, .yres = 1344, .xtra3 = 10, .bit = 5 },
39+
{ .xres = 1440, .yres = 1050, .xtra3 = 8, .bit = 1 },
40+
{ .xres = 1360, .yres = 768, .xtra3 = 8, .bit = 7 },
41+
4142
/* established timings (all @ 60Hz) */
4243
{ .xres = 1024, .yres = 768, .byte = 36, .bit = 3 },
4344
{ .xres = 800, .yres = 600, .byte = 35, .bit = 0 },
@@ -109,13 +110,13 @@ static void edid_fill_modes(uint8_t *edid, uint8_t *xtra3, uint8_t *dta,
109110

110111
if (mode->byte) {
111112
edid[mode->byte] |= (1 << mode->bit);
112-
} else if (mode->xtra3 && xtra3) {
113-
xtra3[mode->xtra3] |= (1 << mode->bit);
114113
} else if (std < 54) {
115114
rc = edid_std_mode(edid + std, mode->xres, mode->yres);
116115
if (rc == 0) {
117116
std += 2;
118117
}
118+
} else if (mode->xtra3 && xtra3) {
119+
xtra3[mode->xtra3] |= (1 << mode->bit);
119120
}
120121

121122
if (dta && mode->dta) {

0 commit comments

Comments
 (0)