From patchwork Fri Jan 15 00:21:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 12021123 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 X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C977C433E6 for ; Fri, 15 Jan 2021 00:23:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40E6423A9D for ; Fri, 15 Jan 2021 00:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731232AbhAOAXF (ORCPT ); Thu, 14 Jan 2021 19:23:05 -0500 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:37270 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731271AbhAOAXF (ORCPT ); Thu, 14 Jan 2021 19:23:05 -0500 X-Halon-ID: bced8b5b-56c7-11eb-b73f-0050569116f7 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de [79.202.36.88]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id bced8b5b-56c7-11eb-b73f-0050569116f7; Fri, 15 Jan 2021 01:22:24 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Jacopo Mondi Subject: [PATCH v2 3/4] rcar-vin: Stop stream when subdevice signal EOS Date: Fri, 15 Jan 2021 01:21:47 +0100 Message-Id: <20210115002148.4079591-4-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115002148.4079591-1-niklas.soderlund+renesas@ragnatech.se> References: <20210115002148.4079591-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org When a subdevice signals end of stream stop the VIN in addition to informing user-space of the event. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 457a65bf6b664f05..176eae2dd5151ac9 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -969,9 +969,23 @@ void rvin_v4l2_unregister(struct rvin_dev *vin) static void rvin_notify_video_device(struct rvin_dev *vin, unsigned int notification, void *arg) { + const struct v4l2_event *event; + switch (notification) { case V4L2_DEVICE_NOTIFY_EVENT: - v4l2_event_queue(&vin->vdev, arg); + event = arg; + + switch (event->type) { + case V4L2_EVENT_EOS: + rvin_stop_streaming(vin); + v4l2_info(&vin->v4l2_dev, + "Subdevice signaled end of stream, stopping.\n"); + break; + default: + break; + } + + v4l2_event_queue(&vin->vdev, event); break; default: break;