From patchwork Tue Jun 28 18:00:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Rodin X-Patchwork-Id: 12898627 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3DD8C43334 for ; Tue, 28 Jun 2022 18:01:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233834AbiF1SBd (ORCPT ); Tue, 28 Jun 2022 14:01:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbiF1SBb (ORCPT ); Tue, 28 Jun 2022 14:01:31 -0400 Received: from hi1smtp01.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5AB912AF1; Tue, 28 Jun 2022 11:01:30 -0700 (PDT) Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hi1smtp01.de.adit-jv.com (Postfix) with ESMTPS id 9AA65520D1E; Tue, 28 Jun 2022 20:01:29 +0200 (CEST) Received: from vmlxhi-182.adit-jv.com (10.72.92.119) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 28 Jun 2022 20:01:29 +0200 From: Michael Rodin To: Mauro Carvalho Chehab , =?utf-8?q?Niklas_S=C3=B6derl?= =?utf-8?q?und?= , , , CC: Michael Rodin , , Subject: [PATCH 3/3] media: rcar-vin: Allow userspace to subscribe to V4L2_EVENT_XFER_ERROR Date: Tue, 28 Jun 2022 20:00:22 +0200 Message-ID: <20220628180024.451258-4-mrodin@de.adit-jv.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220628180024.451258-1-mrodin@de.adit-jv.com> References: <20220628180024.451258-1-mrodin@de.adit-jv.com> MIME-Version: 1.0 X-Originating-IP: [10.72.92.119] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org 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 --- drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c | 2 ++ 1 file changed, 2 insertions(+) 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); }