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-ctl: fix random cec stress test: check if msg status is OK
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Wed Nov 29 09:33:48 2023 +0100

When transmitting GIVE_DEVICE_POWER_STATUS during the
--stress-test-random-standby-wakeup-cycle stress test, you have to
check if the reply was properly received using cec_msg_status_is_ok().

That was missing, so even if the display would not reply, the test
would just continue as if nothing was wrong.

Add this check.

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/cec-ctl/cec-ctl.cpp | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=df0c5e6c5c1d2f9c18273d229c9fa9125a12c613
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index adeff1f9d29b..400e013c5ed1 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -2000,12 +2000,16 @@ static void 
stress_test_random_standby_wakeup_cycle(const struct node &node, uns
                        printf("Transmit Give Device Power Status from LA %s: 
", cec_la2s(from));
                        ret = transmit_msg_retry(node, msg);
                        if (!ret) {
-                               __u8 pwr;
+                               if (cec_msg_status_is_ok(&msg)) {
+                                       __u8 pwr;
 
-                               cec_ops_report_power_status(&msg, &pwr);
-                               printf("%s\n", power_status2s(pwr));
-                               if (pwr == CEC_OP_POWER_STATUS_ON)
-                                       goto done;
+                                       cec_ops_report_power_status(&msg, &pwr);
+                                       printf("%s\n", power_status2s(pwr));
+                                       if (pwr == CEC_OP_POWER_STATUS_ON)
+                                               goto done;
+                               } else {
+                                       printf("%s\n", 
cec_status2s(msg).c_str());
+                               }
                        } else {
                                printf("%s\n", strerror(ret));
                        }
@@ -2032,6 +2036,8 @@ static void stress_test_random_standby_wakeup_cycle(const 
struct node &node, uns
                        ret = transmit_msg_retry(node, msg);
                        if (ret) {
                                printf("%s\n", strerror(ret));
+                       } else if (!cec_msg_status_is_ok(&msg)) {
+                               printf("%s\n", cec_status2s(msg).c_str());
                        } else {
                                __u8 pwr;
 

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

Reply via email to