aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-08-08 10:06:30 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2014-08-08 10:06:30 +0200
commit0694075030e6290264953e48f225bc525aa6fa90 (patch)
tree04d81e5fdacddac6ae45d68a26c9afbc572dedbe
parent086994e0497ba81b79cb0c8e15020797b3cf764c (diff)
v4l2-compliance: add test for S_EDID and the E2BIG corner case
If you try to write a larger EDID than the driver/hardware can handle, the driver should return E2BIG and edid.blocks should be set to the maximum number of blocks allowed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/v4l2-compliance/v4l2-test-io-config.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-io-config.cpp b/utils/v4l2-compliance/v4l2-test-io-config.cpp
index c75ea550..d7a27f22 100644
--- a/utils/v4l2-compliance/v4l2-test-io-config.cpp
+++ b/utils/v4l2-compliance/v4l2-test-io-config.cpp
@@ -372,6 +372,12 @@ static int checkEdid(struct node *node, unsigned pad, bool is_input)
fail_on_test(!is_input);
fail_on_test(ret);
fail_on_test(check_0(edid.reserved, sizeof(edid.reserved)));
+ if (blocks == 256)
+ return 0;
+ edid.blocks = 256;
+ ret = doioctl(node, VIDIOC_S_EDID, &edid);
+ fail_on_test(ret != E2BIG);
+ fail_on_test(edid.blocks == 0 || edid.blocks >= 256);
return 0;
}

Privacy Policy