aboutsummaryrefslogtreecommitdiffstats
path: root/parse-base-block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'parse-base-block.cpp')
-rw-r--r--parse-base-block.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index 174af51..048308b 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -573,7 +573,6 @@ void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns
break;
}
vact = (double)hact * vratio / hratio;
- vact = 8 * ((vact + 7) / 8);
refresh = (b2 & 0x3f) + 60;
formula.hact = hact;
@@ -605,6 +604,10 @@ void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns
min_vert_freq_hz = min(min_vert_freq_hz, refresh);
max_vert_freq_hz = max(max_vert_freq_hz, refresh);
}
+
+ // See Ref. D-8 in the EDID-1.4 spec
+ if (vact & 1)
+ warn("Standard Timing %ux%u has a dubious odd vertical resolution.\n", hact, vact);
}
void edid_state::detailed_display_range_limits(const unsigned char *x)
@@ -1439,6 +1442,8 @@ void edid_state::parse_base_block(const unsigned char *x)
printf(" Maximum image size: %u cm x %u cm\n", x[0x15], x[0x16]);
base.max_display_width_mm = x[0x15] * 10;
base.max_display_height_mm = x[0x16] * 10;
+ image_width = base.max_display_width_mm * 10;
+ image_height = base.max_display_height_mm * 10;
if (x[0x15] < 10 || x[0x16] < 10)
warn("Dubious maximum image size (%ux%u is smaller than 10x10 cm).\n",
x[0x15], x[0x16]);
@@ -1472,7 +1477,7 @@ void edid_state::parse_base_block(const unsigned char *x)
case 0x00: printf("Monochrome or grayscale display\n"); break;
case 0x08: printf("RGB color display\n"); break;
case 0x10: printf("Non-RGB color display\n"); break;
- case 0x18: printf("Undefined display color type\n");
+ case 0x18: printf("Undefined display color type\n"); break;
}
} else {
printf(" Supported color formats: RGB 4:4:4");
@@ -1698,13 +1703,16 @@ void edid_state::check_base_block()
*/
msg(!out_of_range || base.edid_minor >= 4, "%s", err.c_str());
}
- // The base block will only go up to 255x255 cm for the display size,
- // so don't fail if one or more image sizes exceeds that.
- if (!base.max_display_width_mm && !base.max_display_height_mm &&
- dtd_max_hsize_mm && dtd_max_vsize_mm &&
- dtd_max_hsize_mm <= 2559 && dtd_max_vsize_mm <= 2559) {
- fail("The DTD image sizes all fit inside 255x255cm, but no display size was set.\n");
- }
+
+ if ((image_width && dtd_max_hsize_mm >= 10 + image_width / 10) ||
+ (image_height && dtd_max_vsize_mm >= 10 + image_height / 10))
+ fail("The DTD max image size is %ux%umm, which is larger than the display size %.1fx%.1fmm.\n",
+ dtd_max_hsize_mm, dtd_max_vsize_mm,
+ image_width / 10.0, image_height / 10.0);
+ if ((!image_width && dtd_max_hsize_mm) || (!image_height && dtd_max_vsize_mm))
+ fail("The DTD max image size is %ux%umm, but the display size is not specified anywhere.\n",
+ dtd_max_hsize_mm, dtd_max_vsize_mm);
+
// Secondary GTF curves start at a specific frequency. Any legacy timings
// that have a positive hsync and negative vsync must be less than that
// frequency to avoid confusion.

Privacy Policy