From patchwork Thu Apr 19 15:41:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10351079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 44E81602B7 for ; Thu, 19 Apr 2018 15:47:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3606B28AD0 for ; Thu, 19 Apr 2018 15:47:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 305EE28AB2; Thu, 19 Apr 2018 15:47:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E25C28B00 for ; Thu, 19 Apr 2018 15:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752743AbeDSPov (ORCPT ); Thu, 19 Apr 2018 11:44:51 -0400 Received: from mail.bootlin.com ([62.4.15.54]:42530 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753230AbeDSPnw (ORCPT ); Thu, 19 Apr 2018 11:43:52 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id C8505208C0; Thu, 19 Apr 2018 17:43:50 +0200 (CEST) Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 56D6220824; Thu, 19 Apr 2018 17:43:50 +0200 (CEST) From: Paul Kocialkowski To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Pawel Osciak , Marek Szyprowski , Kyungmin Park , Hans Verkuil , Sakari Ailus , Philipp Zabel , Arnd Bergmann , Alexandre Courbot , Tomasz Figa , Paul Kocialkowski Subject: [PATCH v2 04/10] media: vim2m: Implement media request complete op to schedule m2m run Date: Thu, 19 Apr 2018 17:41:18 +0200 Message-Id: <20180419154124.17512-5-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180419154124.17512-1-paul.kocialkowski@bootlin.com> References: <20180419154124.17512-1-paul.kocialkowski@bootlin.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds an implementation of the media request complete operation for the vim2m driver, that ensures that the driver will try to schedule a m2m run whenever a request was completed. Without this operation, no m2m device run will be scheduled in many scenarios. Signed-off-by: Paul Kocialkowski --- drivers/media/platform/vim2m.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c index 2dcf0ea85705..08c4c5566614 100644 --- a/drivers/media/platform/vim2m.c +++ b/drivers/media/platform/vim2m.c @@ -453,6 +453,17 @@ static void device_isr(struct timer_list *t) schedule_work(&vim2m_dev->work_run); } +static void request_complete(struct media_request *req) +{ + struct vim2m_ctx *curr_ctx; + + curr_ctx = (struct vim2m_ctx *) vb2_core_request_find_buffer_priv(req); + if (curr_ctx == NULL) + return; + + v4l2_m2m_try_schedule(curr_ctx->fh.m2m_ctx); +} + /* * video ioctls */ @@ -1025,6 +1036,7 @@ static const struct v4l2_m2m_ops m2m_ops = { static const struct media_device_ops m2m_media_ops = { .req_queue = vb2_request_queue, + .req_complete = request_complete, }; static int vim2m_probe(struct platform_device *pdev)