diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-02-15 13:44:44 +0100 |
---|---|---|
committer | Hans Verkuil <hans.verkuil@cisco.com> | 2018-02-15 13:44:44 +0100 |
commit | 432d9ebfcea65337647fd4e458f76b0417ea1c2f (patch) | |
tree | e90a238879b8b59b068cabb642bdd83cdbe123ef | |
parent | 28226e65f233166b84f0452419d8024c7e4d8b4c (diff) |
v4l2-compliance: ignore colorspace tests for passthu subdevs
If the subdevice just passes through colorspace information from
source to sink, then do not test if this information is valid since
they will accept anything.
Note: this would be wrong for subdevs that do actual colorspace
conversion. We would have to test this in that case, but we probably
need properties first so we can create specific functions for this.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r-- | utils/v4l2-compliance/v4l2-compliance.cpp | 11 | ||||
-rw-r--r-- | utils/v4l2-compliance/v4l2-compliance.h | 1 | ||||
-rw-r--r-- | utils/v4l2-compliance/v4l2-test-subdevs.cpp | 18 |
3 files changed, 23 insertions, 7 deletions
diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index d8858dd5..f6699b3a 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -852,9 +852,20 @@ void testNode(struct node &node, struct node &expbuf_node, media_type type, /* Sub-device ioctls */ if (node.is_subdev()) { + bool has_source = false; + bool has_sink = false; + node.frame_interval_pad = -1; node.enum_frame_interval_pad = -1; for (unsigned pad = 0; pad < node.entity.pads; pad++) { + if (node.pads[pad].flags & MEDIA_PAD_FL_SINK) + has_sink = true; + if (node.pads[pad].flags & MEDIA_PAD_FL_SOURCE) + has_source = true; + } + node.is_passthrough_subdev = has_source && has_sink; + + for (unsigned pad = 0; pad < node.entity.pads; pad++) { printf("Sub-Device ioctls (%s Pad %u):\n", (node.pads[pad].flags & MEDIA_PAD_FL_SINK) ? "Sink" : "Source", pad); diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h index e29ca33b..00d341a2 100644 --- a/utils/v4l2-compliance/v4l2-compliance.h +++ b/utils/v4l2-compliance/v4l2-compliance.h @@ -100,6 +100,7 @@ struct base_node { media_link_desc *links; media_v2_topology *topology; v4l2_subdev_frame_interval_enum subdev_ival; + bool is_passthrough_subdev; __u8 has_subdev_enum_code; __u8 has_subdev_enum_fsize; __u8 has_subdev_enum_fival; diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp index e1d660d4..2715be40 100644 --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp @@ -302,13 +302,17 @@ static int checkMBusFrameFmt(struct node *node, struct v4l2_mbus_framefmt &fmt) fail_on_test(fmt.height == 0 || fmt.height == ~0U); fail_on_test(fmt.code == 0 || fmt.code == ~0U); fail_on_test(fmt.field == ~0U); - fail_on_test(fmt.colorspace == ~0U); - //TBD fail_on_test(!fmt.colorspace); - fail_on_test(fmt.ycbcr_enc == 0xffff); - fail_on_test(fmt.quantization == 0xffff); - fail_on_test(fmt.xfer_func == 0xffff); - fail_on_test(!fmt.colorspace && - (fmt.ycbcr_enc || fmt.quantization || fmt.xfer_func)); + if (!node->is_passthrough_subdev) { + // Passthrough subdevs just copy this info, they don't validate + // it. TODO: this does not take colorspace converters into account! + fail_on_test(fmt.colorspace == ~0U); + //TBD fail_on_test(!fmt.colorspace); + fail_on_test(fmt.ycbcr_enc == 0xffff); + fail_on_test(fmt.quantization == 0xffff); + fail_on_test(fmt.xfer_func == 0xffff); + fail_on_test(!fmt.colorspace && + (fmt.ycbcr_enc || fmt.quantization || fmt.xfer_func)); + } return 0; } |