Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp354106ima; Sat, 20 Oct 2018 08:42:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV63l1nYuLrRT9ZURhXyHcumCxP3J7uM6AS7hv4qwF1nX9z8pnQHMJsg7TkYaULewEd/IjUfX X-Received: by 2002:a17:902:a503:: with SMTP id s3-v6mr7239648plq.35.1540050137752; Sat, 20 Oct 2018 08:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540050137; cv=none; d=google.com; s=arc-20160816; b=uTvKUBt5ZV4urbFCeAeBvRD3B/nhlwR6Ac/ErAF8YYcX4P/xZ+0bD9yD3pm0BdAX/s kF72kuT1Ha+nyZbOworsVmgP8ogL1UfePqZVgDP0RT94OoE7IVzQDnno8IHI8jIdE7+z Dbj8wMiak96IQfigOD5M/kc7YP56fj/xZC2BZymvQIcXobLu94Kq4tR/3AkiE5nrhwaJ eWwAwXx10Uphh9ImTTnl26rkqGkrIQ8h4fBlRMS64oYZFOUsnw4FgARNM0+mO/+ifqF6 /Foyp+GhgfIfVsSHQcItwnuQZG+DeRBkyQ0vAeXte6iKYN5QfLIrKNEQs9eEJ8Oh3YZs KWhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NjudrxXxvqsbj/szpVbkWeHhVtdGnETmnnagOvEJsJU=; b=p9Ov8qd++HPKlnipVC522dV+6A6/n9v6TXZSNjWlKqOTvIKzbY+SWw0niA7uyrXl19 YTWHJajTMy12ZYAKVvPKh7b8HMbHXyrymoawMa+dH1iy+Gw2rCASHboi40ft+H6ua0Hm UqqttxTqxyF74HhNfHwREBCwf5uTAbzE6ERoyywODLW+rcFM8Ft8ew1koJ+k1d6V/TKX 9Ppf0jYxpAH/iLxCvnKozrQLm6X/RAljHUcCbtYTKp8oO4RpaZXvSJoE+tXag6kTYvHi jn63+Io+ZJ3nxLA50wZ0e8OgEyBfCLe/2FNCt5w+gWLAJSExvumgyhMmPeXonxTep76H oelw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="agzrra2/"; 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 w11-v6si26152855pfn.212.2018.10.20.08.42.02; Sat, 20 Oct 2018 08:42:17 -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; dkim=pass header.i=@chromium.org header.s=google header.b="agzrra2/"; 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 S1727610AbeJTXuu (ORCPT + 99 others); Sat, 20 Oct 2018 19:50:50 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:39197 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727584AbeJTXuu (ORCPT ); Sat, 20 Oct 2018 19:50:50 -0400 Received: by mail-yb1-f196.google.com with SMTP id j193-v6so3199033ybj.6 for ; Sat, 20 Oct 2018 08:39:58 -0700 (PDT) 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; bh=NjudrxXxvqsbj/szpVbkWeHhVtdGnETmnnagOvEJsJU=; b=agzrra2/ye1/bw8BbvAfXXkZtAc96bONszTLu7U7PfcKTa2KB+3buqsrOYdNI/ogZM OrsJje80YG3UNuQ/0RZLq68apkHeJQ0L7Omv7T/ebc7Y30HVIDs+szVJtszhGme15LNR A7H38HAKLsGVzVeOS+rdtG31+LbH621KwLsbI= 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; bh=NjudrxXxvqsbj/szpVbkWeHhVtdGnETmnnagOvEJsJU=; b=DZLe7pd5LFqmi3vzzzTuW1qTz/EyGnp3DJd1w8azyIIy5odGmQyq2G64mej7ulx38B h+NOeZuB66r6oZA2XoAvbGpkCiLiHUaUNRO66zlzXdWke5rXdxxhx0SoWEB5fGZpEGBC LPv5lFT9tOQuyHJq+tk/bteDhfp3dEICCZoyvn9keGiJYa0h+o3CzP47C3hiRK8b31lC tvIGuK0nlpLTNY3P/2UQuB5Uhstn8uGguWietvypmoiNfm/xu0ZPPgI+VwPZIiGb56q4 ozRRYF5SGTZNriqsClWueFWwHESBT8HlfOzDXQP79ub62GTG15G/GuhwF8Rg/gOhJCxU wKGQ== X-Gm-Message-State: ABuFfogJanmgxmVJoIdArKtnSACvjbO4yWZMgTxM3HkLBFMzZldCr7xq tdFIm/sEfTuFlHHuRzKBziI+ZgrKuTM= X-Received: by 2002:a25:b083:: with SMTP id f3-v6mr5129249ybj.293.1540049997164; Sat, 20 Oct 2018 08:39:57 -0700 (PDT) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com. [209.85.219.175]) by smtp.gmail.com with ESMTPSA id q1-v6sm7157877ywa.92.2018.10.20.08.39.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 08:39:55 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id k132-v6so3319029ybc.2 for ; Sat, 20 Oct 2018 08:39:54 -0700 (PDT) X-Received: by 2002:a25:24c6:: with SMTP id k189-v6mr15981307ybk.373.1540049994583; Sat, 20 Oct 2018 08:39:54 -0700 (PDT) MIME-Version: 1.0 References: <20180724140621.59624-1-tfiga@chromium.org> <20180724140621.59624-2-tfiga@chromium.org> <9696282.0ldyWdpzWo@avalon> In-Reply-To: From: Tomasz Figa Date: Sun, 21 Oct 2018 00:39:42 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] media: docs-rst: Document memory-to-memory video decoder interface To: Laurent Pinchart Cc: Linux Media Mailing List , Linux Kernel Mailing List , Stanimir Varbanov , Mauro Carvalho Chehab , Hans Verkuil , Pawel Osciak , Alexandre Courbot , kamil@wypas.org, a.hajda@samsung.com, Kyungmin Park , jtp.park@samsung.com, Philipp Zabel , =?UTF-8?B?VGlmZmFueSBMaW4gKOael+aFp+ePiik=?= , =?UTF-8?B?QW5kcmV3LUNUIENoZW4gKOmZs+aZuui/qik=?= , todor.tomov@linaro.org, nicolas@ndufresne.ca, Paul Kocialkowski , dave.stevenson@raspberrypi.org, Ezequiel Garcia Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 7:03 PM Tomasz Figa wrote: > > Hi Laurent, > > On Wed, Oct 17, 2018 at 10:34 PM Laurent Pinchart > wrote: > > > > Hi Tomasz, > > > > Thank you for the patch. > > Thanks for your comments! Please see my replies inline. > > > > > On Tuesday, 24 July 2018 17:06:20 EEST Tomasz Figa wrote: [snip] > > > The driver must also set > > > + ``V4L2_BUF_FLAG_LAST`` in :c:type:`v4l2_buffer` ``flags`` field on the > > > + buffer on the ``CAPTURE`` queue containing the last frame (if any) > > > + produced as a result of processing the ``OUTPUT`` buffers queued > > > + before ``V4L2_DEC_CMD_STOP``. If no more frames are left to be > > > + returned at the point of handling ``V4L2_DEC_CMD_STOP``, the driver > > > + must return an empty buffer (with :c:type:`v4l2_buffer` > > > + ``bytesused`` = 0) as the last buffer with ``V4L2_BUF_FLAG_LAST`` set > > > + instead. Any attempts to dequeue more buffers beyond the buffer marked > > > + with ``V4L2_BUF_FLAG_LAST`` will result in a -EPIPE error from > > > + :c:func:`VIDIOC_DQBUF`. > > > + > > > + * If the ``CAPTURE`` queue is NOT streaming, no action is necessary for > > > + ``CAPTURE`` queue and the driver must send a ``V4L2_EVENT_EOS`` > > > + immediately after all ``OUTPUT`` buffers in question have been > > > + processed. > > > > What is the use case for this ? Can't we just return an error if decoder isn't > > streaming ? > > > > Actually this is wrong. We want the queued OUTPUT buffers to be > processed and decoded, so if the CAPTURE queue is not yet set up > (initialization sequence not completed yet), handling the > initialization sequence first will be needed as a part of the drain > sequence. I've updated the document with that. I might want to take this back. The client could just drive the initialization to completion on its own and start the drain sequence after that. Let me think if it makes anything easier. For reference, I don't see any compatibility constraint here, since the existing user space already works like that. Best regards, Tomasz