diff mbox series

[3/3] media: rcar-vin: Allow userspace to subscribe to V4L2_EVENT_XFER_ERROR

Message ID 20220628180024.451258-4-mrodin@de.adit-jv.com (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series Improve error handling in the rcar-vin driver | expand

Commit Message

Michael Rodin June 28, 2022, 6 p.m. UTC
Userspace should be able to subscribe to V4L2_EVENT_XFER_ERROR in order to
implement recovery from possible transfer errors. We can set the event
queue size to 1, since only the timestamp of the latest transfer error is
relevant to determine if a recovery is needed for the current streaming
session.

Signed-off-by: Michael Rodin <mrodin@de.adit-jv.com>
---
 drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
index 2e2aa9d746ee..8118c8d41a66 100644
--- a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
@@ -648,6 +648,8 @@  static int rvin_subscribe_event(struct v4l2_fh *fh,
 	switch (sub->type) {
 	case V4L2_EVENT_SOURCE_CHANGE:
 		return v4l2_event_subscribe(fh, sub, 4, NULL);
+	case V4L2_EVENT_XFER_ERROR:
+		return v4l2_event_subscribe(fh, sub, 1, NULL);
 	}
 	return v4l2_ctrl_subscribe_event(fh, sub);
 }