diff mbox series

[08/11] edid-decode: output full frequencies for 4:2:0

Message ID 20210914121129.51451-9-joevt@shaw.ca (mailing list archive)
State New, archived
Headers show
Series edid-decode: bug fixes, additions, changes | expand

Commit Message

joevt Sept. 14, 2021, 12:11 p.m. UTC
Don't half hfreq for 4:2:0 timings - the character clock is halved, but the number of characters per line is also halved (two luminance values per character for 4:2:0), so there's no change in hfreq.
Don't half pixel clock because it looks weird. Character clock is halved but the number of pixels remains the same (two luminance values per character for 4:2:0).
Continue to use the half hfreq and half pixel clock for the ranges calculations because some non-HDMI 2.0 displays have max pixel clock halved when they have 4:2:0 modes and because other reasons that lead to adding this code in the first place?

Signed-off-by: Joe van Tunen <joevt@shaw.ca>
---
 edid-decode.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/edid-decode.cpp b/edid-decode.cpp
index 6aa93fb..0c83e0e 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -513,6 +513,7 @@  bool edid_state::print_timings(const char *prefix, const struct timings *t,
 	if (t->interlaced)
 		vact /= 2;
 
+	double out_hor_freq_khz = hor_freq_khz;
 	if (t->ycbcr420)
 		hor_freq_khz /= 2;
 
@@ -558,6 +559,7 @@  bool edid_state::print_timings(const char *prefix, const struct timings *t,
 		dtd_max_vsize_mm = t->vsize_mm;
 	if (!s.empty())
 		s = " (" + s + ")";
+	unsigned out_pixclk_khz = t->pixclk_khz;
 	unsigned pixclk_khz = t->pixclk_khz / (t->ycbcr420 ? 2 : 1);
 
 	char buf[10];
@@ -568,8 +570,8 @@  bool edid_state::print_timings(const char *prefix, const struct timings *t,
 	       t->hact, buf,
 	       refresh,
 	       t->hratio, t->vratio,
-	       hor_freq_khz,
-	       pixclk_khz / 1000.0,
+	       out_hor_freq_khz,
+	       out_pixclk_khz / 1000.0,
 	       s.c_str());
 
 	unsigned len = strlen(prefix) + 2;