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: v4l2-ctl/compliance: read and show the subdev client capabilities Author: Hans Verkuil <hverkuil-ci...@xs4all.nl> Date: Fri Dec 15 10:58:23 2023 +0100 Report the subdev client capabilities in v4l2-ctl and v4l2-compliance. Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl> utils/common/v4l2-info.cpp | 16 +++++++++++++++- utils/common/v4l2-info.h | 6 +++++- utils/v4l2-compliance/v4l2-compliance.cpp | 6 +++++- utils/v4l2-ctl/v4l2-ctl.cpp | 11 ++++++++--- 4 files changed, 33 insertions(+), 6 deletions(-) --- http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=2b2ba7e0e86c4e33f485bfda931245e26bc04549 diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp index ffcc2e87852b..72731bad8016 100644 --- a/utils/common/v4l2-info.cpp +++ b/utils/common/v4l2-info.cpp @@ -128,7 +128,8 @@ void v4l2_info_capability(const v4l2_capability &vcap) } } -void v4l2_info_subdev_capability(const v4l2_subdev_capability &subdevcap) +void v4l2_info_subdev_capability(const v4l2_subdev_capability &subdevcap, + const v4l2_subdev_client_capability &subdevclientcap) { printf("\tDriver version : %d.%d.%d\n", subdevcap.version >> 16, @@ -136,6 +137,8 @@ void v4l2_info_subdev_capability(const v4l2_subdev_capability &subdevcap) subdevcap.version & 0xff); printf("\tCapabilities : 0x%08x\n", subdevcap.capabilities); printf("%s", subdevcap2s(subdevcap.capabilities).c_str()); + printf("\tClient Capabilities: 0x%016llx\n", subdevclientcap.capabilities); + printf("%s", subdevclientcap2s(subdevclientcap.capabilities).c_str()); } std::string fcc2s(__u32 val) @@ -873,3 +876,14 @@ std::string modulation2s(unsigned modulation) } return "Unknown"; } + +std::string subdevclientcap2s(__u64 cap) +{ + std::string s; + + if (cap & V4L2_SUBDEV_CLIENT_CAP_STREAMS) + s += "streams "; + if (cap & V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH) + s += "interval-uses-which "; + return s; +} diff --git a/utils/common/v4l2-info.h b/utils/common/v4l2-info.h index 2142952a27ff..ac227971b709 100644 --- a/utils/common/v4l2-info.h +++ b/utils/common/v4l2-info.h @@ -34,7 +34,8 @@ std::string flags2s(unsigned val, const flag_def *def); /* Print capability information */ void v4l2_info_capability(const v4l2_capability &cap); -void v4l2_info_subdev_capability(const v4l2_subdev_capability &subdevcap); +void v4l2_info_subdev_capability(const v4l2_subdev_capability &subdevcap, + const v4l2_subdev_client_capability &subdevclientcap); /* Return fourcc pixelformat string */ std::string fcc2s(__u32 val); @@ -157,4 +158,7 @@ std::string tcap2s(unsigned cap); /* Return band modulation description */ std::string modulation2s(unsigned modulation); +/* Return subdev client capabilities description */ +std::string subdevclientcap2s(__u64 cap); + #endif diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index b670b78d2c95..9e2c6983637a 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -973,6 +973,7 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_ struct node node2; struct v4l2_capability vcap = {}; struct v4l2_subdev_capability subdevcap = {}; + struct v4l2_subdev_client_capability subdevclientcap = {}; std::string driver; tests_total = tests_ok = warnings = 0; @@ -993,6 +994,9 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_ determine_codec_mask(node); } else if (node.is_subdev()) { doioctl(&node, VIDIOC_SUBDEV_QUERYCAP, &subdevcap); + subdevclientcap.capabilities = ~0ULL; + if (doioctl(&node, VIDIOC_SUBDEV_S_CLIENT_CAP, &subdevclientcap)) + subdevclientcap.capabilities = 0ULL; } else { memset(&vcap, 0, sizeof(vcap)); } @@ -1079,7 +1083,7 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_ } } else if (node.is_subdev()) { printf("Driver Info:\n"); - v4l2_info_subdev_capability(subdevcap); + v4l2_info_subdev_capability(subdevcap, subdevclientcap); } __u32 ent_id = 0; diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp index 4cd84f78e134..e195ad8e4ded 100644 --- a/utils/v4l2-ctl/v4l2-ctl.cpp +++ b/utils/v4l2-ctl/v4l2-ctl.cpp @@ -1138,6 +1138,7 @@ int main(int argc, char **argv) const char *export_device = nullptr; struct v4l2_capability vcap = {}; struct v4l2_subdev_capability subdevcap = {}; + struct v4l2_subdev_client_capability subdevclientcap = {}; std::vector<event> events; unsigned secs = 0; char short_options[26 * 2 * 3 + 1]; @@ -1354,6 +1355,9 @@ int main(int argc, char **argv) // This ioctl was introduced in kernel 5.10, so don't // exit if this ioctl returns an error. doioctl(fd, VIDIOC_SUBDEV_QUERYCAP, &subdevcap); + subdevclientcap.capabilities = ~0ULL; + if (doioctl(fd, VIDIOC_SUBDEV_S_CLIENT_CAP, &subdevclientcap)) + subdevclientcap.capabilities = 0ULL; } if (!is_subdev) { capabilities = vcap.capabilities; @@ -1460,10 +1464,11 @@ int main(int argc, char **argv) if (options[OptGetDriverInfo]) { printf("Driver Info%s:\n", options[OptUseWrapper] ? " (using libv4l2)" : ""); - if (is_subdev) - v4l2_info_subdev_capability(subdevcap); - else + if (is_subdev) { + v4l2_info_subdev_capability(subdevcap, subdevclientcap); + } else { v4l2_info_capability(vcap); + } } if (options[OptGetDriverInfo] && media_fd >= 0) mi_media_info_for_fd(media_fd, fd); _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits