Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp592571imu; Wed, 23 Jan 2019 02:03:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN4RO6+qqB3JOXMpw8DWcTyEnkGemS9r1Jx1B+kheJ/bsfnKzQ5opJtruIGNLq6cHNVOONsv X-Received: by 2002:a65:4142:: with SMTP id x2mr1381855pgp.356.1548237819689; Wed, 23 Jan 2019 02:03:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548237819; cv=none; d=google.com; s=arc-20160816; b=AdG/1W0IzY9z5LFmszKD7riuAMik3I9gjHU3gQSWel2196q/2ir2sxQov3PFBTAxo0 a1M4TDoHQWyRbRuq2icQ4bvoqBk6rSk2cdZEvzn0NTwsw2VSnAgfTBO7mSpOI8aOPc/5 mWFd2qJyXqdwVcT7VmM8fueg+t6ADwXMgFJZfdJ2EbAqH6NpqaZhqRy7XPDMpvIperma kruUzx1XWi8BH1nJD2cS6MtJYNAfj1s3QQpha9ggoTEdFxNNw2MAFieAEeaiSYHwy1EG qajilN3O3YiaCAFGnqomupSBA1ABpCMuX3CsCtJ7zM5RGW/LC7JDY2r4Tfy8pARWO6pf zrqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=77ZCzo2w78BSCMOdjec45OEgqSB0KV/7zPbxJ74wWS8=; b=UpUBrvJNci0Ir7s8oQRNEX1thKhAR0q5lrvTSOx3pm+R4b4CxbP+K4PtVXcHrWoSZA 3/kZFQ53XSPwcNW1IYGqUlZ886lS1IDL7xYbG5iDhC2aknPPP0vvDxcLoidT9YZ3+p9V mA6DwUo7YnZkeSTUu67kf2Ia7H0yrEkB8LMqdLFiIY+B3I0xhW5LUaBqnO4U/NJ8aNhA 3k/7gUpS3s1I1BuSOPF6qYQIPzqJKHPPGJhumLg9zELE/A6Lpq3i0kl3Nga3FSiqKay0 oQpr095TVeCufh9KQNf9QckjS80RkE7WBo6oBZCH7817MVmSQg5AWeNgPfBlsRmKHOy2 hfhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=g0mxfGP0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si18339896pln.430.2019.01.23.02.03.24; Wed, 23 Jan 2019 02:03:39 -0800 (PST) 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; dkim=pass header.i=@chromium.org header.s=google header.b=g0mxfGP0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727280AbfAWKBG (ORCPT + 99 others); Wed, 23 Jan 2019 05:01:06 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:33581 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbfAWKBG (ORCPT ); Wed, 23 Jan 2019 05:01:06 -0500 Received: by mail-ot1-f65.google.com with SMTP id i20so1422721otl.0 for ; Wed, 23 Jan 2019 02:01:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=77ZCzo2w78BSCMOdjec45OEgqSB0KV/7zPbxJ74wWS8=; b=g0mxfGP0Vyphud4v6VrkINWLF1dLCn4/LZtTU+dsUzEP2cSzjgt4/6ZvvuYoiujKUK HPiaBBBcahzq1Yt2laxH4z165FV1CjP+qdeDJWMw7ezntFW44H3QZca53qVKYiVQ3qlY z9/4IqO50PuRfHVnKYWDtqAtPea5rj3kkd0ZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=77ZCzo2w78BSCMOdjec45OEgqSB0KV/7zPbxJ74wWS8=; b=oDfN7pylwZUg3d0GRQh5mvv3wWJu+N+zdVZJy6/tsVvyWEl6/NZCfqFi4e3DXQI88O /+o2Kp7dh3oYvgjT2JHBKo2+jK8EAsVFxPwaTLdUeWMspt/Xs5CZ7dqp571CZB0aoMJ7 j+9Nm283c1uhhYwoCkUDuIxnp80ntSK7Xe65wfd2S8XnexCnTJao4G170hdLWlp+B8YW q6hzgMajVxN2CZc7PXrT7fOwkg0IT00am9xiFCA1HC4naXJPYvddjWHDG4B2UaawqPAA f2IctFKgOK2oFmlNedKOuhXSOwNqJJhiDfVKoHTsXNK0fhv/+2gQoOM1M54wQt5m7lHC ZEVw== X-Gm-Message-State: AJcUukecwAo126cusdbv0ZQ206KMNhG0IWQ5m/92fps3XVQEigJg2XuN RRe0RGpvYy++QqB+oFTnleNfc7yfNA0= X-Received: by 2002:a9d:6a50:: with SMTP id h16mr955982otn.95.1548237665950; Wed, 23 Jan 2019 02:01:05 -0800 (PST) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com. [209.85.210.50]) by smtp.gmail.com with ESMTPSA id c19sm7912339otl.16.2019.01.23.02.01.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 02:01:05 -0800 (PST) Received: by mail-ot1-f50.google.com with SMTP id i20so1422704otl.0 for ; Wed, 23 Jan 2019 02:01:05 -0800 (PST) X-Received: by 2002:a9d:4687:: with SMTP id z7mr1080754ote.350.1548237665228; Wed, 23 Jan 2019 02:01:05 -0800 (PST) MIME-Version: 1.0 References: <20181022144901.113852-1-tfiga@chromium.org> <20181022144901.113852-3-tfiga@chromium.org> <4cd223f0-b09c-da07-f26c-3b3f7a8868d7@xs4all.nl> <5fb0f2db44ba7aa3788b61f2aa9a30d4f4984de5.camel@ndufresne.ca> In-Reply-To: From: Tomasz Figa Date: Wed, 23 Jan 2019 19:00:54 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] media: docs-rst: Document memory-to-memory video encoder interface To: Hans Verkuil Cc: Nicolas Dufresne , Linux Media Mailing List , Linux Kernel Mailing List , Mauro Carvalho Chehab , =?UTF-8?B?UGF3ZcWCIE/Fm2NpYWs=?= , Alexandre Courbot , Kamil Debski , Andrzej Hajda , Kyungmin Park , Jeongtae Park , Philipp Zabel , Tiffany Lin , Andrew-CT Chen , Stanimir Varbanov , Todor Tomov , Paul Kocialkowski , Laurent Pinchart , dave.stevenson@raspberrypi.org, Ezequiel Garcia , Maxime Jourdan Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 17, 2018 at 8:37 PM Hans Verkuil wrote: > > On 11/17/2018 05:18 AM, Nicolas Dufresne wrote: > > Le lundi 12 novembre 2018 =C3=A0 14:23 +0100, Hans Verkuil a =C3=A9crit= : > >> On 10/22/2018 04:49 PM, Tomasz Figa wrote: [snip] > >>> + rely on it. The ``V4L2_BUF_FLAG_LAST`` buffer flag should be u= sed > >>> + instead. > >> > >> Question: should new codec drivers still implement the EOS event? > > > > I'm been asking around, but I think here is a good place. Do we really > > need the FLAG_LAST in userspace ? Userspace can also wait for the first > > EPIPE return from DQBUF. > > I'm interested in hearing Tomasz' opinion. This flag is used already, so = there > definitely is a backwards compatibility issue here. > FWIW, it would add the overhead of 1 more system call, although I don't think it's of our concern. My personal feeling is that using error codes for signaling normal conditions isn't very elegant, though. > > > >> > >>> + > >>> +3. Once all ``OUTPUT`` buffers queued before the ``V4L2_ENC_CMD_STOP= `` call and > >>> + the last ``CAPTURE`` buffer are dequeued, the encoder is stopped = and it will > >>> + accept, but not process any newly queued ``OUTPUT`` buffers until= the client > >>> + issues any of the following operations: > >>> + > >>> + * ``V4L2_ENC_CMD_START`` - the encoder will resume operation norm= ally, > >> > >> Perhaps mention that this does not reset the encoder? It's not immedia= tely clear > >> when reading this. > > > > Which drivers supports this ? I believe I tried with Exynos in the > > past, and that didn't work. How do we know if a driver supports this or > > not. Do we make it mandatory ? When it's not supported, it basically > > mean userspace need to cache and resend the header in userspace, and > > also need to skip to some sync point. > > Once we agree on the spec, then the next step will be to add good complia= nce > checks and update drivers that fail the tests. > > To check if the driver support this ioctl you can call VIDIOC_TRY_ENCODER= _CMD > to see if the functionality is supported. There is nothing here for the hardware to support. It's an entirely driver thing, since it just needs to wait for the encoder to complete all the pending frames and stop enqueuing more frames to the decoder until V4L2_ENC_CMD_START is called. Any driver that can't do it must be fixed, since otherwise you have no way to ensure that you got all the encoded output. Best regards, Tomasz