This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: cec-follower: emulate features for CEC versions < CEC 2.0
Author:  Deborah Brouwer <deborahbrouwer3...@gmail.com>
Date:    Thu Jun 3 19:40:52 2021 -0700

For CEC adapters using versions < CEC 2.0, read the CEC Features
as configured in the CEC adapter and emulate the features that are
present.

Signed-off-by: Deborah Brouwer <deborahbrouwer3...@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/cec-follower/cec-follower.cpp | 42 ++++++++++++++++++++-----------------
 utils/libcecutil/cec-info.cpp       |  2 --
 2 files changed, 23 insertions(+), 21 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=c8d617cc229c5e2862bf54509405c83d3c16f89a
diff --git a/utils/cec-follower/cec-follower.cpp 
b/utils/cec-follower/cec-follower.cpp
index b7a41ac2dbfc..1f598fdf5a11 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -508,26 +508,30 @@ int main(int argc, char **argv)
 
        cec_driver_info(caps, laddrs, node.phys_addr, conn_info);
 
-       if (laddrs.cec_version >= CEC_OP_CEC_VERSION_2_0) {
-               bool is_dev_feat = false;
-
-               for (__u8 byte : laddrs.features[0]) {
-                       if (is_dev_feat) {
-                               node.source_has_arc_rx = (byte & 
CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX) != 0;
-                               node.sink_has_arc_tx = (byte & 
CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX) != 0;
-                               node.has_aud_rate = (byte & 
CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE) != 0;
-                               node.has_deck_ctl = (byte & 
CEC_OP_FEAT_DEV_HAS_DECK_CONTROL) != 0;
-                               node.has_rec_tv = (byte & 
CEC_OP_FEAT_DEV_HAS_RECORD_TV_SCREEN) != 0;
-                               node.has_osd_string = (byte & 
CEC_OP_FEAT_DEV_HAS_SET_OSD_STRING) != 0;
-                               break;
-                       }
-                       if (byte & CEC_OP_FEAT_EXT)
-                               continue;
-                       if (!is_dev_feat)
-                               is_dev_feat = true;
-                       else
-                               break;
+       /*
+        * For CEC 1.4, features of a logical address may still be
+        * filled in according to the CEC 2.0 guidelines even though
+        * the CEC framework won’t use the features in the CEC 2.0
+        * CEC_MSG_REPORT_FEATURES.
+        */
+       bool is_dev_feat = false;
+
+       for (__u8 byte : laddrs.features[0]) {
+               if (is_dev_feat) {
+                       node.source_has_arc_rx = (byte & 
CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX) != 0;
+                       node.sink_has_arc_tx = (byte & 
CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX) != 0;
+                       node.has_aud_rate = (byte & 
CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE) != 0;
+                       node.has_deck_ctl = (byte & 
CEC_OP_FEAT_DEV_HAS_DECK_CONTROL) != 0;
+                       node.has_rec_tv = (byte & 
CEC_OP_FEAT_DEV_HAS_RECORD_TV_SCREEN) != 0;
+                       node.has_osd_string = (byte & 
CEC_OP_FEAT_DEV_HAS_SET_OSD_STRING) != 0;
+                       break;
                }
+               if (byte & CEC_OP_FEAT_EXT)
+                       continue;
+               if (!is_dev_feat)
+                       is_dev_feat = true;
+               else
+                       break;
        }
        printf("\n");
 
diff --git a/utils/libcecutil/cec-info.cpp b/utils/libcecutil/cec-info.cpp
index 8b3c55e89ae0..3c76826123cd 100644
--- a/utils/libcecutil/cec-info.cpp
+++ b/utils/libcecutil/cec-info.cpp
@@ -448,8 +448,6 @@ void cec_driver_info(const struct cec_caps &caps,
                       cec_prim_type2s(laddrs.primary_device_type[i]));
                printf("\t    Logical Address Type   : %s\n",
                       cec_la_type2s(laddrs.log_addr_type[i]));
-               if (laddrs.cec_version < CEC_OP_CEC_VERSION_2_0)
-                       continue;
                printf("\t    All Device Types       : %s\n",
                       cec_all_dev_types2s(laddrs.all_device_types[i]).c_str());
 

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

Reply via email to