cec-compliance: fix Vendor Command With ID vivid tests
PATCH 1/1 cec-compliance: fix Vendor Command With ID vivid tests
The vivid driver handled <Vendor Command With ID> incorrectly if an unknown Vendor ID was used. This is now fixed, but as a result the adapter tests in cec-compliance also have to be fixed.
According to the spec, if the given Vendor ID is unknown, then, if it is a broadcast message, the command must be ignored, and if it is a directed message, then it should be Feature Aborted.
This patch adds a test for the case of a broadcast message, and fixes the test for a directed message, checking for Feature Abort instead of expecting it to be ignored.
Signed-off-by Hans Verkuil <[email protected]>
---
Here is the vivid patch:
https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
--- utils/cec-compliance/cec-test-adapter.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
utils/cec-compliance/cec-test-adapter.cpp +11 -2
@@ -420,8 +420,8 @@ static int testTransmit(struct node *node) const __u8 *vendor_data; __u8 vendor_cmd = 0x11; - // Test that an invalid vendor ID is ignored - cec_msg_init(&msg, la, i); + // Test that a broadcast of an invalid vendor ID is ignored + cec_msg_init(&msg, la, CEC_LOG_ADDR_BROADCAST); cec_msg_vendor_command_with_id(&msg, node->vendor_id + 1, 1, &vendor_cmd); msg.flags = CEC_MSG_FL_REPLY_VENDOR_ID; msg.reply = vendor_cmd + 2;
@@ -429,6 +429,15 @@ static int testTransmit(struct node *node) fail_on_test(!(msg.rx_status & CEC_RX_STATUS_TIMEOUT)); fail_on_test(!(msg.flags & CEC_MSG_FL_REPLY_VENDOR_ID)); + // Test that an invalid vendor ID is feature aborted + cec_msg_init(&msg, la, i); + cec_msg_vendor_command_with_id(&msg, node->vendor_id + 1, 1, &vendor_cmd); + msg.flags = CEC_MSG_FL_REPLY_VENDOR_ID; + msg.reply = vendor_cmd + 2; + fail_on_test(doioctl(node, CEC_TRANSMIT, &msg)); + fail_on_test(!(msg.rx_status & CEC_RX_STATUS_FEATURE_ABORT)); + fail_on_test(!(msg.flags & CEC_MSG_FL_REPLY_VENDOR_ID)); + // The vivid driver will reply with value vendor_cmd + 1, so // waiting for different reply must time out cec_msg_init(&msg, la, i);
Signature · 1 line
2.47.2