Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3919017imm; Mon, 30 Jul 2018 05:53:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDpAV77cfRjpoPiVJidPmHD7hIjD4UV9b0cDO5l82tnZm0AQRxsSjjOgadFS6vZtMdZULI X-Received: by 2002:a17:902:b58b:: with SMTP id a11-v6mr16116167pls.34.1532955227137; Mon, 30 Jul 2018 05:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532955227; cv=none; d=google.com; s=arc-20160816; b=GFfL19ZQqR+jzmXNPYa1AItShQQfWEk3sOl68nEGN/PCmOJhqAAVUZCqHEhHdMrAkh uxd2UgEszxO2YMFCN5sfYgHP2nAivTHYiSY3NWqn9o3q5U7yx78cg3qgz6tgl3d/+h6F WS2UxTDoYmiM55gCdERtiWO9DECeePgGZI5m+VPatw4Y4XY9lztfTa7B2D7onVRiI29B PhMUmaPocHJK5Rmv6GmhARe30XB7rHQB6V12zU+FTmWO4kqJBqZs6t/E4p68h1Gluw/M RfkOF0+lLHn6lZGBgdOeBsrcXm+9WQgA4Rqaq3qkQRvx4BKGtAris0bzuBGQ6GCH70he UbxA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=a8QCvMQJ5zl9iF6iXS7pcXDlrD8cGIoxlBtXhrh6pEY=; b=z7U2pY/sMw4EUu73kPHENZipwu3kdvr06dDS3ium7hnb4qExrVy2ZMtJ8EOIQyXNDc NsRkciYg8hWTZg2steNVVnnBzobYPauD69zPSPeCGF+y3K2j33zOnvRY+SkhRrkCgt7x cSakyQjTOttUBjMsr0Pais7KPFz1Vp6UKt2LdbyoLc3ufr3KHG35l/jd8TiCHhGvpkEH zv7kroVil+s2ksVCfkgxQWnGLMGgsSE7suRugYM4odBs0c3p0dHJIPDo4kkMiy4DN9MT dXlvyKBA0D7wEwafvPdqLHYLpgit+FoGyvAA/5/NE1AOUZlN0gITXrq2Y8wyrLoVNVvu vtjg== 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 q8-v6si10474109pfh.353.2018.07.30.05.53.31; Mon, 30 Jul 2018 05:53:47 -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 S1731146AbeG3O1c (ORCPT + 99 others); Mon, 30 Jul 2018 10:27:32 -0400 Received: from lb3-smtp-cloud9.xs4all.net ([194.109.24.30]:49945 "EHLO lb3-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729104AbeG3O1b (ORCPT ); Mon, 30 Jul 2018 10:27:31 -0400 Received: from [192.168.2.10] ([212.251.195.8]) by smtp-cloud9.xs4all.net with ESMTPA id k7f6f1WV8EJtck7fAfgCgf; Mon, 30 Jul 2018 14:52:39 +0200 Subject: Re: [PATCH 1/2] media: docs-rst: Document memory-to-memory video decoder interface To: Tomasz Figa , linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Stanimir Varbanov , Mauro Carvalho Chehab , 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 , Laurent Pinchart , Dave Stevenson , ezequiel@collabora.com References: <20180724140621.59624-1-tfiga@chromium.org> <20180724140621.59624-2-tfiga@chromium.org> From: Hans Verkuil Message-ID: <318f609c-7a28-ef65-e8be-08107981b623@xs4all.nl> Date: Mon, 30 Jul 2018 14:52:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180724140621.59624-2-tfiga@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfHzjWc9vR084+TvcnSBlabLweQhy4aYCOpkGPhUh3Rg+upH9VWkYf7kZspZluhakfxf8Tp9eBpbqsJwo10FnyqT8QNth2Q1B9HeP+pEYqu/22Q4uZYKD fpEqYOeHWJj4AZ+XKxH8/W9RLX3RLyihCmGca7YY2tqvdEU9CJTuDf2sGhNSdu4Fvf50sxVM5MYssIYvFUMIJo/DQBg5YjY7ZuJhogwR3HfXmKa8e0aClQOp DoUsTH7y/lw/u7cuXe5Cr98uz4t2myPnc8zw2dhP6+Qz9zxU8rpSRdmZ6g7I3xh7h1xBcEtLls6B9Mz5V+SFSrZb/MXmGz0VD4gFkBxXS/cLyH2UfCU5BHxS MpMN2SZH9upxDzadCfbblxfGEtbyIlFeoApfiuv4wxLhYETMkJgHPfujp2Nn4BBbzPqoAIpXgtFNDb6TKSyAVI5QiJbtBcCulijA1O9z3AVviq4tzY3MUy68 i8t+fPzGxEeDYLqD+6NfSfRpkR39uTZSMoVicFMlm+yvPhBi6HtdIH08ZbOk5sXVmDtfgI3mjbRoGpwdb+uqNyZJ1OPklYZIjTpkGb9vg8EODJIkgot2WfA8 rN47VPerpCYBIcy/Fczby1Wbay4JCCJyMdhBLxiizxfOoA9eSUDZl++WS0x4drYjtWLOuWi3kgPLa5LvbXI1eYlkpW16BzzbvwnNS/1SOiwreSi6SFg3TH6y ZC5F7kMbw6I= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/24/2018 04:06 PM, Tomasz Figa wrote: > Due to complexity of the video decoding process, the V4L2 drivers of > stateful decoder hardware require specific sequences of V4L2 API calls > to be followed. These include capability enumeration, initialization, > decoding, seek, pause, dynamic resolution change, drain and end of > stream. > > Specifics of the above have been discussed during Media Workshops at > LinuxCon Europe 2012 in Barcelona and then later Embedded Linux > Conference Europe 2014 in Düsseldorf. The de facto Codec API that > originated at those events was later implemented by the drivers we already > have merged in mainline, such as s5p-mfc or coda. > > The only thing missing was the real specification included as a part of > Linux Media documentation. Fix it now and document the decoder part of > the Codec API. > > Signed-off-by: Tomasz Figa > --- > Documentation/media/uapi/v4l/dev-decoder.rst | 872 +++++++++++++++++++ > Documentation/media/uapi/v4l/devices.rst | 1 + > Documentation/media/uapi/v4l/v4l2.rst | 10 +- > 3 files changed, 882 insertions(+), 1 deletion(-) > create mode 100644 Documentation/media/uapi/v4l/dev-decoder.rst > > diff --git a/Documentation/media/uapi/v4l/dev-decoder.rst b/Documentation/media/uapi/v4l/dev-decoder.rst > new file mode 100644 > index 000000000000..f55d34d2f860 > --- /dev/null > +++ b/Documentation/media/uapi/v4l/dev-decoder.rst > @@ -0,0 +1,872 @@ > +6. This step only applies to coded formats that contain resolution > + information in the stream. Continue queuing/dequeuing bitstream > + buffers to/from the ``OUTPUT`` queue via :c:func:`VIDIOC_QBUF` and > + :c:func:`VIDIOC_DQBUF`. The driver must keep processing and returning > + each buffer to the client until required metadata to configure the > + ``CAPTURE`` queue are found. This is indicated by the driver sending > + a ``V4L2_EVENT_SOURCE_CHANGE`` event with > + ``V4L2_EVENT_SRC_CH_RESOLUTION`` source change type. There is no > + requirement to pass enough data for this to occur in the first buffer > + and the driver must be able to process any number. > + > + * If data in a buffer that triggers the event is required to decode > + the first frame, the driver must not return it to the client, > + but must retain it for further decoding. > + > + * If the client set width and height of ``OUTPUT`` format to 0, calling > + :c:func:`VIDIOC_G_FMT` on the ``CAPTURE`` queue will return -EPERM, > + until the driver configures ``CAPTURE`` format according to stream > + metadata. What about calling TRY/S_FMT on the capture queue: will this also return -EPERM? I assume so. Regards, Hans