Received: by 10.213.65.68 with SMTP id h4csp989956imn; Wed, 14 Mar 2018 06:29:10 -0700 (PDT) X-Google-Smtp-Source: AG47ELuqqWf5XTSI5LE5jtclF8GUzu6ALBa7fRwIJncP5LTmZhQ63liBdmntWuZDWRkEckzjV397 X-Received: by 2002:a17:902:9a8d:: with SMTP id w13-v6mr4129153plp.136.1521034150625; Wed, 14 Mar 2018 06:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521034150; cv=none; d=google.com; s=arc-20160816; b=TjhUvuPXQQZ3HFXbAkA5S86Ef3q334cB3ftIKC3fJdI7D53dNMT+TrQmaEi6W2BncL ZVFjtZnWorGICWf/1xI+g2raj9PROExEahzF6glfCqmJr8YYTIMKGXCGz7HrxbFBUEWd 1AFMPDD82UrKHYQotkQEhykGyprfOWWTKmTcJSgPqdDWArQVSS6K/4TdWb1WnMPlafl9 bAJ+59xl7JAAqHbggV5/12jNXwk2mr8fQZ4rYx3IRytpc39uKGhyqAuSnC+lYb5C6hE3 AUOjkB4FO09Kry40u1NV8D1RwyqErm2lxx87mFrY6xJ3CjflwqZDHiJ03hDj+Xm2hlid MVow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:references :in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=7XWqceUXVMjnjwwnBAttEioNk6tj1bjxpBhkgQt0/3w=; b=Jk3I3ldIXqFkf0BYOw4eNlE5F/luX00fZMSXu1mEtorXFSE2XJ7nBJ5sjN8d+KEqqJ A8pXuXz7506lOmnlu1pHRR/ZCYPLH9qNJpb7fcRKED2/SKxlVrBi0Hr32f1E78sAv+dr o74ZN7PF9/oS2z4qYwwAyi6EQOOR2l5ks+yWyI3ZrxjArlgCkfrfa1LGQSQl52+XxZM1 t9daFML+Vc7er6bO9zF5ZmuLZtn0/KuEZa8pdVN8Lgw4jX/YJ6KQeTEci6I6l9xTgNlf RVPGsEdeHbg0Eq/fX5LC3+j8NX3rtVR4nwb3GoqlMkrqdEai3go9DLqm+57D+g4VT+bc hoTg== 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 e67si1827833pgc.274.2018.03.14.06.28.55; Wed, 14 Mar 2018 06:29:10 -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 S1752108AbeCNN1T (ORCPT + 99 others); Wed, 14 Mar 2018 09:27:19 -0400 Received: from mail.bootlin.com ([62.4.15.54]:52449 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478AbeCNN1S (ORCPT ); Wed, 14 Mar 2018 09:27:18 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id EC1E220755; Wed, 14 Mar 2018 14:27:13 +0100 (CET) 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 aptenodytes (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 708CF207F4; Wed, 14 Mar 2018 14:27:03 +0100 (CET) Message-ID: <1521033957.1130.5.camel@bootlin.com> Subject: Re: [RFCv4,19/21] media: vim2m: add request support From: Paul Kocialkowski To: Alexandre Courbot Cc: Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Pawel Osciak , Marek Szyprowski , Tomasz Figa , Sakari Ailus , Gustavo Padovan , Linux Media Mailing List , LKML , Maxime Ripard Date: Wed, 14 Mar 2018 14:25:57 +0100 In-Reply-To: References: <20180220044425.169493-20-acourbot@chromium.org> <1520440654.1092.15.camel@bootlin.com> <1520606128.15946.22.camel@bootlin.com> Organization: Bootlin Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-kKPa2jGKCmzG1Wx2TdNo" X-Mailer: Evolution 3.26.5 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-kKPa2jGKCmzG1Wx2TdNo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Tue, 2018-03-13 at 19:24 +0900, Alexandre Courbot wrote: > On Fri, Mar 9, 2018 at 11:35 PM, Paul Kocialkowski > wrote: > > Hi, > >=20 > > On Thu, 2018-03-08 at 22:48 +0900, Alexandre Courbot wrote: > > > Hi Paul! > > >=20 > > > Thanks a lot for taking the time to try this! I am also working on > > > getting it to work with an actual driver, but you apparently found > > > rough edges that I missed. > > >=20 > > > On Thu, Mar 8, 2018 at 1:37 AM, Paul Kocialkowski > > > wrote: > > > > On Tue, 2018-02-20 at 13:44 +0900, Alexandre Courbot wrote: [...] > > > > > +static int vim2m_request_submit(struct media_request *req, > > > > > + struct media_request_entity_data > > > > > *_data) > > > > > +{ > > > > > + struct v4l2_request_entity_data *data; > > > > > + > > > > > + data =3D to_v4l2_entity_data(_data); > > > >=20 > > > > We need to call v4l2_m2m_try_schedule here so that m2m > > > > scheduling > > > > can > > > > happen when only 2 buffers were queued and no other action was > > > > taken > > > > from usespace. In that scenario, m2m scheduling currently > > > > doesn't > > > > happen. > > >=20 > > > I don't think I understand the sequence of events that results in > > > v4l2_m2m_try_schedule() not being called. Do you mean something > > > like: > > >=20 > > > * > > > * QBUF on output queue with request set > > > * QBUF on capture queue > > > * SUBMIT_REQUEST > > >=20 > > > ? > > >=20 > > > The call to vb2_request_submit() right after should trigger > > > v4l2_m2m_try_schedule(), since the buffers associated to the > > > request > > > will enter the vb2 queue and be passed to the m2m framework, which > > > will then call v4l2_m2m_try_schedule(). Or maybe you are thinking > > > about a different sequence of events? > >=20 > > This is indeed the sequence of events that I'm seeing, but the > > scheduling call simply did not happen on vb2_request_submit. I > > suppose I will need to investigate some more to find out exactly > > why. > >=20 > > IIRC, the m2m qbuf function is called (and fails to schedule) when > > the > > ioctl happens, not when the task is submitted. > >=20 > > This issue is seen with vim2m as well as the rencently-submitted > > sunxi- > > cedrus driver (with the in-driver calls to v4l2_m2m_try_schedule > > removed, obviously). If needs be, I could provide a standalone test > > program to reproduce it. >=20 > If you have a standalone program that can reproduce this on vim2m, > then I would like to see it indeed, if only to understand what I have > missed. You can find the test file for this use case at: https://gist.github.com/paulkocialkowski/4cfa350e1bbe8e3bf714480bba83ea72 Cheers! --=20 Paul Kocialkowski, Bootlin (formerly Free Electrons) Embedded Linux and kernel engineering https://bootlin.com --=-kKPa2jGKCmzG1Wx2TdNo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAlqpIuUACgkQ3cLmz3+f v9FDWQf7BtBZSTrUfQdirubgIqDKOoTvi9oc+HCcKeojGitjab05rVnb9URxuvdN n3+sCRegHw3zOYZpjUFegoSF+jobD7Y+mFjgPrZ+FI+GFbG9zlnIyfwXY4sYeq2l +sdusBZxvI8GftkHB2AsLvOOcKf843rxuDI7f6opSWThxojEZtTmrCv+AV1eGfMD tz2fu9cgZlPzFzqEg7grHK2AlzVwIvpOHL1B87goTMcAoV6VesyW/xtJM+4ilZEC gHXZZUTw/grK2tJYijg97Wi24fMSpuybRq3znMBQQ2tkigWgBDgHsU4tU/9g6KO7 ZE7UpkzjdZbKabmS68kvWfFwQ7tG5Q== =XD47 -----END PGP SIGNATURE----- --=-kKPa2jGKCmzG1Wx2TdNo--