[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210311122040.1264410-11-ribalda@chromium.org>
Date: Thu, 11 Mar 2021 13:20:39 +0100
From: Ricardo Ribalda <ribalda@...omium.org>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Tomasz Figa <tfiga@...omium.org>, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org, senozhatsky@...omium.org
Cc: Ricardo Ribalda <ribalda@...omium.org>
Subject: [PATCH 09/10] media: uvcvideo: Do not create initial events for class ctrls
V4L2_CTRL_TYPE_CTRL_CLASS do not generate events.
Fixes v4l2-compliance:
Control ioctls (Input 0):
fail: v4l2-test-controls.cpp(844): found event for control class 'User Controls'
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
---
drivers/media/usb/uvc/uvc_ctrl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 273eccc136b8..433342efc63f 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -1456,6 +1456,7 @@ static void uvc_ctrl_send_events(struct uvc_fh *handle,
}
}
+static const u8 uvc_ctrl_class_guid[16] = UVC_GUID_CTRL_CLASS;
static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems)
{
struct uvc_fh *handle = container_of(sev->fh, struct uvc_fh, vfh);
@@ -1474,7 +1475,8 @@ static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems)
}
list_add_tail(&sev->node, &mapping->ev_subs);
- if (sev->flags & V4L2_EVENT_SUB_FL_SEND_INITIAL) {
+ if ((sev->flags & V4L2_EVENT_SUB_FL_SEND_INITIAL) &&
+ memcmp(ctrl->info.entity, uvc_ctrl_class_guid, 16)) {
struct v4l2_event ev;
u32 changes = V4L2_EVENT_CTRL_CH_FLAGS;
s32 val = 0;
--
2.31.0.rc2.261.g7f71774620-goog
Powered by blists - more mailing lists