Received: by 10.192.165.156 with SMTP id m28csp864956imm; Thu, 19 Apr 2018 08:48:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4++qxKdQpzNNgkU3/u6Z+VTyky+1bUw7xbZJdOcINytb+x3lYAEembqdne49ZJSvmQ1l+Ia X-Received: by 2002:a17:902:6181:: with SMTP id u1-v6mr6568327plj.272.1524152895643; Thu, 19 Apr 2018 08:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524152895; cv=none; d=google.com; s=arc-20160816; b=kvcSZjwOtgEx2I7UZKWYBTDKiuseA9mWXkdvd9qhaHYy0UUKt63RXelGHlYA3KeQap Q3brg8T8nh5Uf0DtjpqXrC3LtSvkBsLMJUVs5hyvSnf3CaQdNkZQkJT05Od2DJQZIxaq JmP3girLUpgWJy+GrgZ4DwsI/Bz2VPMMsytTe+E99VfboMXTIQKRN58EOPwuCUl1t6/r cB85dyvn+bhQs26UJUuYhMt3V/mS4wV7X6hv0aS/TDa6gcCw+aWjpgWgo/chLUrajzzz lUn4Q9y3H0JyVwDyoB643Yseu/UHVBxd1/fNMJeH52DjcRw+QjsKVeatw43YdXVgKQHf q33w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=wbw+JyXcF7T02JbhimOoiriiHjkScaMl9RzC5/Vhq6E=; b=bMYOCOhTGRzHxrvd5nYuNDsKKUgFAmUFk5p4KvYWWchDD6U7PyJjAzo8m5Ux4T1GLL PeZ6ctRRR5nGy2BAu5cVOuYrEp0/SFqydQu3ZE+CsU5kSR8ivFw1hGxqFygnUEdh0+7k tDxUT3AwUOSf5XTYpQuSxOcjJl1Q0P3+vPPe52apUg92YSUtd8PE/hbtfIpllGZDIVGR tFo4gtEDgV3AvOKl/bF1iJUG9eLL9XogwKDG/8pkbV9G4+NYVlb/WaTOjO9zNMVK1j7O 2q3DkLoxyTx5UMPmHp8CLRsUyLvYACaACysSw8jagBAsJX6+tEjSIAoUO/eipx3FIsE/ vdWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si454212pgx.83.2018.04.19.08.48.00; Thu, 19 Apr 2018 08:48:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753231AbeDSPow (ORCPT + 99 others); Thu, 19 Apr 2018 11:44:52 -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) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.16.3