Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3189898imd; Mon, 29 Oct 2018 03:15:54 -0700 (PDT) X-Google-Smtp-Source: AJdET5e08OihST+d/9Y8sM31BkOGNUdFjYi3gJU7thLRiVY8RwTkdXCCyi+o3irOOzQLn9nBltb+ X-Received: by 2002:a63:b218:: with SMTP id x24mr12695157pge.223.1540808154712; Mon, 29 Oct 2018 03:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540808154; cv=none; d=google.com; s=arc-20160816; b=0m6nO8TjI4KsIFnVODWez+Pvh1LUC3zcIXQ6Hbi5bUdtKGKYyp7xVRBE8qAw9lZupg MvqOHWO/y+iSWAj4SCX1fx0e6KsororsGlIicqZ6XWeY2P95bnC2tU0jh3PoWF0YbiUj TziYQqgPzAHsXd7AejaBPcOsTCmD8hBE97VCMQ2aBcMY659hpOnzOPZN7jF6O8aNwdnm yqZWjRINx1DiA4ymTcKv+ENCCwsgriK0hCjb7wtCRcH/8SKsAC0CktLae3rSStoyDntL Ijwn7nDVTv2VJWawO2Z0xb6q4OUmCAeZLqirrd3FtT1Y1p0ZqkOK+Uk3u34Hb51jI6s4 RemQ== 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=m1eha819Xo7LMAtL+qtdXUQuW+ObsunwcOkkGdiQWfQ=; b=cJSbXEtDERqqINNZ60mhqq2UNxBJ9wUGI5eYVcBkRCFrbMucagUXNr6ljwAh82h+LW kbnJhA8S6LB1GOmJLrrC0RXCvqeHiSzSBxaWFhzrqlcHT77pTYdLvpNzlwFOBKE+PecB Du/233PWJeKs2B5MbFrbMNS0lteUL8tSYyuRoxHa3/Bud+ZpJ8/0IaGENSpBgPWkDez3 4MEf7wfpc+3LypxReHFYeEwT6wc/daIsz3IIJ5mbJl6DBayW8P4+rqIDhxCwrqHSNRQk qDe7ooBmFvx6144yQbFsF3YIhng23kA+dh+BuSb0kFkfAJ4PASexTVM12Dq9VGtZtz0N EPGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="gqR0v/Mn"; 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 j2-v6si19279314plk.24.2018.10.29.03.15.38; Mon, 29 Oct 2018 03:15:54 -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="gqR0v/Mn"; 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 S1729793AbeJ2TBi (ORCPT + 99 others); Mon, 29 Oct 2018 15:01:38 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:37706 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729631AbeJ2TBi (ORCPT ); Mon, 29 Oct 2018 15:01:38 -0400 Received: by mail-yw1-f67.google.com with SMTP id v77-v6so3112202ywc.4 for ; Mon, 29 Oct 2018 03:13:37 -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:content-transfer-encoding; bh=m1eha819Xo7LMAtL+qtdXUQuW+ObsunwcOkkGdiQWfQ=; b=gqR0v/Mn5To1bUI389UKNgs5MKlnlCBbeKgbOg+uISI22PS0L702lh45wrDvcd6Jxg jRIVzrumGW4rOzSvzqH8j63x+7jFHkiXWIlDvupUaJMVu7I3/oyN0pRJvaZT+A3+EVpf 6lLSnhcwe+fOe9y1cL7K/JPshlVY7NpKKEVRA= 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=m1eha819Xo7LMAtL+qtdXUQuW+ObsunwcOkkGdiQWfQ=; b=O5I5bJC2FHrizESi5RSLCAO/8puOm77hYJJOBjUHFOZ+59vNbIuqaKieewqOyKGX0Z pzmn5gb1ULbCaGwQdCsVGsG0wXNdQYoDWLVNYiYFdsco2eNTyzl32g24oV4UcgtEju1L 6qSee4onXDd5i1US4F9a0NahLqofFud910j2rPceapxQSO5goz7YAfPIm1mfD25OYIUa 0CRZQb7TAGuBbg22XFHcqBRfSta1BA4RHf2MSrQVo09peCQ3DXxEUcMTfEJ8T43/sahy PC/fVHAXwjU5i2ErDNTFE1MGtkc76DtAB0LkG23rBVTWj7uDzYvstoAwoR5BkVT1zaSw /aIg== X-Gm-Message-State: AGRZ1gKh0raDtbW3V1eBnDCT1R5yKy+pDoBrSCeVwXFfTxRYdqB5isVN GGGxCTvPAESgvOtODA/NxPeHuELiqH9C8w== X-Received: by 2002:a0d:f9c5:: with SMTP id j188-v6mr13115041ywf.286.1540808016963; Mon, 29 Oct 2018 03:13:36 -0700 (PDT) Received: from mail-yw1-f43.google.com (mail-yw1-f43.google.com. [209.85.161.43]) by smtp.gmail.com with ESMTPSA id a189-v6sm4917262ywf.49.2018.10.29.03.13.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 03:13:36 -0700 (PDT) Received: by mail-yw1-f43.google.com with SMTP id v199-v6so3121000ywg.1 for ; Mon, 29 Oct 2018 03:13:36 -0700 (PDT) X-Received: by 2002:a81:8144:: with SMTP id r65-v6mr12765784ywf.403.1540807651941; Mon, 29 Oct 2018 03:07:31 -0700 (PDT) MIME-Version: 1.0 References: <20181022144901.113852-1-tfiga@chromium.org> <20181022144901.113852-2-tfiga@chromium.org> <31c175d6-b1e9-f8d7-0b8b-821271a59a70@linaro.org> In-Reply-To: From: Tomasz Figa Date: Mon, 29 Oct 2018 19:07:19 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] media: docs-rst: Document memory-to-memory video decoder interface To: Stanimir Varbanov Cc: Linux Media Mailing List , Linux Kernel Mailing List , 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 , 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 Mon, Oct 29, 2018 at 7:06 PM Tomasz Figa wrote: > > Hi Stanimir, > > On Mon, Oct 29, 2018 at 6:45 PM Stanimir Varbanov > wrote: > > > > Hi Tomasz, > > > > On 10/22/2018 05:48 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 call= s > > > 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=C3=BCsseldorf. The de facto Codec API tha= t > > > originated at those events was later implemented by the drivers we al= ready > > > 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 o= f > > > the Codec API. > > > > > > Signed-off-by: Tomasz Figa > > > --- > > > Documentation/media/uapi/v4l/dev-decoder.rst | 1082 +++++++++++++++= ++ > > > Documentation/media/uapi/v4l/devices.rst | 1 + > > > Documentation/media/uapi/v4l/pixfmt-v4l2.rst | 5 + > > > Documentation/media/uapi/v4l/v4l2.rst | 10 +- > > > .../media/uapi/v4l/vidioc-decoder-cmd.rst | 40 +- > > > Documentation/media/uapi/v4l/vidioc-g-fmt.rst | 14 + > > > 6 files changed, 1137 insertions(+), 15 deletions(-) > > > create mode 100644 Documentation/media/uapi/v4l/dev-decoder.rst > > > > > > diff --git a/Documentation/media/uapi/v4l/dev-decoder.rst b/Documenta= tion/media/uapi/v4l/dev-decoder.rst > > > new file mode 100644 > > > index 000000000000..09c7a6621b8e > > > --- /dev/null > > > +++ b/Documentation/media/uapi/v4l/dev-decoder.rst > > > > > > > > > +Capture setup > > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > + > > > > > > > > > + > > > +2. **Optional.** Acquire the visible resolution via > > > + :c:func:`VIDIOC_G_SELECTION`. > > > + > > > + * **Required fields:** > > > + > > > + ``type`` > > > + a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE`` > > > + > > > + ``target`` > > > + set to ``V4L2_SEL_TGT_COMPOSE`` > > > + > > > + * **Return fields:** > > > + > > > + ``r.left``, ``r.top``, ``r.width``, ``r.height`` > > > + the visible rectangle; it must fit within the frame buffer= resolution > > > + returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``. > > > + > > > + * The following selection targets are supported on ``CAPTURE``: > > > + > > > + ``V4L2_SEL_TGT_CROP_BOUNDS`` > > > + corresponds to the coded resolution of the stream > > > + > > > + ``V4L2_SEL_TGT_CROP_DEFAULT`` > > > + the rectangle covering the part of the ``CAPTURE`` buffer = that > > > + contains meaningful picture data (visible area); width and= height > > > + will be equal to the visible resolution of the stream > > > + > > > + ``V4L2_SEL_TGT_CROP`` > > > + the rectangle within the coded resolution to be output to > > > + ``CAPTURE``; defaults to ``V4L2_SEL_TGT_CROP_DEFAULT``; re= ad-only on > > > + hardware without additional compose/scaling capabilities > > > > Hans should correct me if I'm wrong but V4L2_SEL_TGT_CROP_xxx are > > applicable over OUTPUT queue type? > > There is no such restriction. CROP selection targets of an OUTPUT > queue apply to the video stream read from the buffers, COMPOSE targets > of an OUTPUT queue apply to the output of the queue and input to the > processing block (hardware) in case of mem2mem devices, then CROP > targets of a CAPTURE queue apply to the output of the processing and > SELECTION targets of a CAPTURE queue apply to the stream written to I mean, COMPOSE targets. Sorry for the noise. > the buffers. > > For a decoder, the OUTPUT stream is just a sequence of bytes, so > selection API doesn't apply to it. The processing (decoding) produces > a video stream and so the necessary selection capabilities are exposed > on the CAPTURE queue. > > Best regards, > Tomasz