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-compliance: allow S_SELECTION to return ENOTTY
Author:  Hans Verkuil <hans.verk...@cisco.com>
Date:    Thu Dec 1 10:45:52 2016 +0100

It is possible that G_SELECTION is implemented, but S_SELECTION isn't.

So update the test to allow for ENOTTY return values from S_SELECTION.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>

 utils/v4l2-compliance/v4l2-test-formats.cpp | 31 +++++++++++++++++++----------
 1 file changed, 20 insertions(+), 11 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=003f31e59f353b4aecc82e8fb1c7555964da7efa
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp 
b/utils/v4l2-compliance/v4l2-test-formats.cpp
index 6b434c31b7ec..97e551e446a4 100644
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
@@ -1289,6 +1289,8 @@ static int testBasicCrop(struct node *node, unsigned type)
        };
        struct v4l2_selection sel_def;
        struct v4l2_selection sel_bounds;
+       int s_sel_ret = EINVAL;
+       int ret;
 
        fail_on_test(doioctl(node, VIDIOC_G_SELECTION, &sel_crop));
        fail_on_test(!sel_crop.r.width || !sel_crop.r.height);
@@ -1316,19 +1318,22 @@ static int testBasicCrop(struct node *node, unsigned 
type)
                sel_crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
        else
                sel_crop.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != EINVAL);
+       ret = doioctl(node, VIDIOC_S_SELECTION, &sel_crop);
+       if (ret == ENOTTY)
+               s_sel_ret = ret;
+       fail_on_test(ret != s_sel_ret);
        // Check handling of invalid type.
        sel_crop.type = 0xff;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != s_sel_ret);
        // Check handling of invalid target.
        sel_crop.type = type;
        sel_crop.target = 0xffff;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != s_sel_ret);
        // Check handling of read-only targets.
        sel_crop.target = V4L2_SEL_TGT_CROP_DEFAULT;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != s_sel_ret);
        sel_crop.target = V4L2_SEL_TGT_CROP_BOUNDS;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_crop) != s_sel_ret);
        return 0;
 }
 
@@ -1418,6 +1423,7 @@ static int testBasicCompose(struct node *node, unsigned 
type)
        struct v4l2_selection sel_def;
        struct v4l2_selection sel_bounds;
        struct v4l2_selection sel_padded;
+       int s_sel_ret = EINVAL;
        int ret;
 
        fail_on_test(doioctl(node, VIDIOC_G_SELECTION, &sel_compose));
@@ -1454,21 +1460,24 @@ static int testBasicCompose(struct node *node, unsigned 
type)
                sel_compose.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
        else
                sel_compose.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != EINVAL);
+       ret = doioctl(node, VIDIOC_S_SELECTION, &sel_compose);
+       if (ret == ENOTTY)
+               s_sel_ret = ret;
+       fail_on_test(ret != s_sel_ret);
        // Check handling of invalid type.
        sel_compose.type = 0xff;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != 
s_sel_ret);
        // Check handling of invalid target.
        sel_compose.type = type;
        sel_compose.target = 0xffff;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != 
s_sel_ret);
        // Check handling of read-only targets.
        sel_compose.target = V4L2_SEL_TGT_COMPOSE_DEFAULT;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != 
s_sel_ret);
        sel_compose.target = V4L2_SEL_TGT_COMPOSE_BOUNDS;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != 
s_sel_ret);
        sel_compose.target = V4L2_SEL_TGT_COMPOSE_PADDED;
-       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != EINVAL);
+       fail_on_test(doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != 
s_sel_ret);
        return 0;
 }
 

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

Reply via email to