[git:edid-decode/master] edid-decode: fix OVT bugs

2022-05-25 Thread Hans Verkuil
This is an automatic generated email to let you know that the following patch 
were queued:

Subject: edid-decode: fix OVT bugs
Author:  Hans Verkuil 
Date:Wed May 25 11:27:29 2022 +0200

Fix the use of a wrong index (i instead of rate_index), and in the
preparse code the EDID offset calculation was missing a " + i".

Signed-off-by: Hans Verkuil 

 parse-cta-block.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

---

diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index 1e4a0c829eff..bbbec2c6ae1b 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -714,13 +714,13 @@ void edid_state::cta_vfdb(const unsigned char *x, 
unsigned n)
 rids[vfd.rid].vact,
 rids[vfd.rid].hratio,
 rids[vfd.rid].vratio,
-vf_rate_values[i]);
+
vf_rate_values[rate_index]);
char type[16];
sprintf(type, "RID %u@%up", rid, 
vf_rate_values[rate_index]);
print_timings("", &t, type);
-   if (rid_to_vic(vfd.rid, i))
+   if (rid_to_vic(vfd.rid, rate_index))
fail("%s not allowed since it maps to VIC 
%u.\n",
-rid_to_vic(vfd.rid, i));
+type, rid_to_vic(vfd.rid, rate_index));
}
}
 }
@@ -2565,7 +2565,7 @@ void edid_state::preparse_cta_block(const unsigned char 
*x)
case 0x06:
if (!(x[i] & 0x1f) || cta.preparsed_first_vfd.rid)
break;
-   cta.preparsed_first_vfd = cta_parse_vfd(x + 2, (x[i + 
1] & 3) + 1);
+   cta.preparsed_first_vfd = cta_parse_vfd(x + i + 2, (x[i 
+ 1] & 3) + 1);
break;
case 0x07:
if (x[i + 1] == 0x0d)

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[git:edid-decode/master] edid-decode: add test/cta-timings.test

2022-05-25 Thread Hans Verkuil
This is an automatic generated email to let you know that the following patch 
were queued:

Subject: edid-decode: add test/cta-timings.test
Author:  Hans Verkuil 
Date:Wed May 25 11:52:12 2022 +0200

New test EDID containing the latest CTA-861 video timings:
DisplayID Type VII, VIII and X, and an OVT timing.

Also uses these in the VFPDB and in the new Native Video
Resolution Data Block.

Signed-off-by: Hans Verkuil 

 test/README   |   5 -
 test/cta-timings.test | Bin 0 -> 512 bytes
 2 files changed, 4 insertions(+), 1 deletion(-)

---

diff --git a/test/README b/test/README
index 978491bf1ac7..afbb3b1c1390 100644
--- a/test/README
+++ b/test/README
@@ -10,7 +10,7 @@ xorg.test: an EDID as logged by xorg in /var/log/Xorg.0.log.
 xrandr.test: an EDID as reported by 'xrandr --props'.
 
 
-Five hand-crafted EDIDs to test rarely seen EDID extensions or data blocks:
+Six hand-crafted EDIDs to test rarely seen EDID extensions or data blocks:
 
 cta-vesa.test: has VESA Display Transfer Characteristics Data Block and
VESA Video Display Device Data Block in the CTA-861 block.
@@ -26,6 +26,9 @@ blockmap-255.test: has two Block Map extensions and a total of
 
 256-blocks.test: has the maximum number of 256 blocks.
 
+cta-timings.test: contains various DisplayID and OVT timings in the
+   CTA Extension Block.
+
 
 Examples of old EDID versions:
 
diff --git a/test/cta-timings.test b/test/cta-timings.test
new file mode 100644
index ..acb785d21d07
Binary files /dev/null and b/test/cta-timings.test differ

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[git:edid-decode/master] edid-decode: update test/cta-timings.test

2022-05-25 Thread Hans Verkuil
This is an automatic generated email to let you know that the following patch 
were queued:

Subject: edid-decode: update test/cta-timings.test
Author:  Hans Verkuil 
Date:Wed May 25 12:30:54 2022 +0200

The first preferred timing in the VFPDB should match the native
resolution in the NVRDB.

Signed-off-by: Hans Verkuil 

 test/cta-timings.test | Bin 512 -> 512 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

---

diff --git a/test/cta-timings.test b/test/cta-timings.test
index acb785d21d07..a29c82e36a85 100644
Binary files a/test/cta-timings.test and b/test/cta-timings.test differ

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[git:edid-decode/master] edid-decode: improve preferred/native video timing reporting

2022-05-25 Thread Hans Verkuil
This is an automatic generated email to let you know that the following patch 
were queued:

Subject: edid-decode: improve preferred/native video timing reporting
Author:  Hans Verkuil 
Date:Wed May 25 12:31:34 2022 +0200

Depending on which CTA-861 version the EDID parser of the Sink is
based on, the results for preferred and native video timing might well
be different. Report the various possibilities depending on which
CTA-861 version is used in the parser.

Signed-off-by: Hans Verkuil 

 edid-decode.cpp | 37 +++-
 edid-decode.h   |  8 +++--
 parse-cta-block.cpp | 99 +
 3 files changed, 111 insertions(+), 33 deletions(-)

---

diff --git a/edid-decode.cpp b/edid-decode.cpp
index b7fe57ad8474..b3c6c088f4cb 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -1216,6 +1216,15 @@ void edid_state::print_preferred_timings()
print_timings("  ", *iter, true, false);
}
 
+   if (!cta.preferred_timings_vfpdb.empty()) {
+   printf("\n\n");
+   printf("\nPreferred Video Timing%s if Block 0 and CTA-861 
Blocks are parsed with VFPDB support:\n",
+  cta.preferred_timings_vfpdb.size() > 1 ? "s" : "");
+   for (vec_timings_ext::iterator iter = 
cta.preferred_timings_vfpdb.begin();
+iter != cta.preferred_timings_vfpdb.end(); ++iter)
+   print_timings("  ", *iter, true, false);
+   }
+
if (!dispid.preferred_timings.empty()) {
printf("\n\n");
printf("\nPreferred Video Timing%s if Block 0 and DisplayID 
Blocks are parsed:\n",
@@ -1230,7 +1239,7 @@ void edid_state::print_native_res()
 {
typedef std::pair resolution;
typedef std::set resolution_set;
-   resolution_set native_prog, native_int;
+   resolution_set native_prog, native_int, native_nvrdb;
unsigned native_width = 0, native_height = 0;
unsigned native_width_int = 0, native_height_int = 0;
 
@@ -1286,6 +1295,24 @@ void edid_state::print_native_res()
}
}
 
+   for (vec_timings_ext::iterator iter = cta.native_timing_nvrdb.begin();
+iter != cta.native_timing_nvrdb.end(); ++iter) {
+   if (iter->t.interlaced) {
+   fail("Interlaced native timing in NVRDB.\n");
+   } else {
+   native_nvrdb.insert(std::pair(iter->t.hact, iter->t.vact));
+   if (!native_width) {
+   native_width = iter->t.hact;
+   native_height = iter->t.vact;
+   native_mismatch = true;
+   } else if (native_width &&
+  (iter->t.hact != native_width ||
+   iter->t.vact != native_height)) {
+   native_mismatch = true;
+   }
+   }
+   }
+
if (diagonal) {
if (image_width) {
double w = image_width;
@@ -1359,6 +1386,14 @@ void edid_state::print_native_res()
printf("  %ux%ui\n", iter->first, iter->second);
}
 
+   if (!cta.native_timing_nvrdb.empty()) {
+   printf("\n\n");
+   printf("\nNative Video Resolution if Block 0 and CTA-861 Blocks 
are parsed with NVRDB support:\n");
+   for (resolution_set::iterator iter = native_nvrdb.begin();
+iter != native_nvrdb.end(); ++iter)
+   printf("  %ux%u\n", iter->first, iter->second);
+   }
+
if (dispid.native_width) {
printf("\n\n");
printf("\nNative Video Resolution if the DisplayID Blocks are 
parsed:\n");
diff --git a/edid-decode.h b/edid-decode.h
index bdc6ab67c752..e075c83d7220 100644
--- a/edid-decode.h
+++ b/edid-decode.h
@@ -169,7 +169,8 @@ struct edid_state {
 
// CTA-861 block state
cta.has_vic_1 = cta.first_svd_might_be_preferred = cta.has_sldb 
=
-   cta.has_hdmi = cta.has_vcdb = cta.has_vfpdb = 
cta.has_cdb = false;
+   cta.has_hdmi = cta.has_vcdb = cta.has_vfpdb = 
cta.has_cdb =
+   cta.has_nvrdb = false;
cta.previous_cta_tag = 0xfff;
cta.have_hf_vsdb = cta.have_hf_scdb = false;
cta.image_width = cta.image_height = 0;
@@ -271,12 +272,14 @@ struct edid_state {
vec_timings_ext vec_vtdbs;
cta_vfd preparsed_first_vfd;
vec_timings_ext preferred_timings;
+   vec_timings_ext preferred_timings_vfpdb;
bool preparsed_has_t8vtdb;
// Keep track of the found Tag/Extended Tag pairs.
// The unsigned value is equal to: (tag)