Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3182729imd; Mon, 29 Oct 2018 03:08:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5cA+0XY/x/PziPqbruOm1wefw4xXtKKCUeTQYVdL4rlJ5ly25UKQQlR7lx0VWhs7xARJJ4k X-Received: by 2002:a62:5c03:: with SMTP id q3-v6mr14845777pfb.182.1540807722828; Mon, 29 Oct 2018 03:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540807722; cv=none; d=google.com; s=arc-20160816; b=HJgpZswgefz6BiFVLU0AckN5EeZglM9tRHmFizGP2l4nUZyOO3pU5EjOy9FSv03ha7 fO620PD3QpY+8N30garJPpqiyuqk4/NW5g4PkOBmYlqccTVQlXmhFX+9NIwEJGKq8VTg v8Uhgk/0m6SJPVLNK7NOQw9x9UhgUkRkRVSQud+2UX8gbiFtbUhWWjjeK+EfOB8nXUHi 2sWf4iEJojFJ7AxSIyha3O7C8ID38IdFNfMI14fZpb6LILw2hIclzGKPlMN4lgC1D634 AZlJPvgaIqt1ME7tmn7vzsGm83UH+GDeUFrxIBSe1QKdlCeGQPqv9CXOSLd7Wf7NvLUp IYAA== 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=w2RWIn01tCANsFJiceyKomFM9E7X+6lpkQBp7E0wQ1Y=; b=f3FIbh5lSMdkMO3ROKSoVlneKLSxYt7CHPDA/qx/zTJtyKUApUwbnRga16HQhywjg6 mLUxDz4vRz5LkwooYwN/5O6wzQSU3cWUNpssX1fjNIZfAN9nTqBA6w0hafaMdNEKRrgd ISqTsaCfbENfEh9j/gWGn5nL8ApbwZWNE6QPUBYB4kKxYBcn/HtGkHLjNG/RdOkEbsR+ 3pT9guWckgIIPSOHjvJYUJprdlrP9Y0jLhG5dwj46Wj+3h9NxbW1MmnQfvACJGIfK9SD 1vIob4kVa6z/ckU/XXhWOyHUDW/NbZEX29VPCvxfdc/hIglfx34+2Ogrk+YST0HWcXvd 8Bpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NNRQppay; 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 e17-v6si18804504pgj.272.2018.10.29.03.08.26; Mon, 29 Oct 2018 03:08:42 -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=NNRQppay; 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 S1729636AbeJ2Syo (ORCPT + 99 others); Mon, 29 Oct 2018 14:54:44 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:46312 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729487AbeJ2Syo (ORCPT ); Mon, 29 Oct 2018 14:54:44 -0400 Received: by mail-yb1-f194.google.com with SMTP id f15-v6so2672291ybq.13 for ; Mon, 29 Oct 2018 03:06:45 -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=w2RWIn01tCANsFJiceyKomFM9E7X+6lpkQBp7E0wQ1Y=; b=NNRQppay6NVttO+mF8JHjbaCh/ZUwJ8C/mdC5YMBbGP5r/U7E62cijGgVwcawLu7KN i09eeYJKMltdyrhVjH6HmibTIyW+tMK0uO6FgNk2vNymgow6cjQAmezny/+DEi1gH770 JxEkZs5VK/1gAePJidn8YRp0B9Je+z/8evR1A= 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=w2RWIn01tCANsFJiceyKomFM9E7X+6lpkQBp7E0wQ1Y=; b=n0NbN6UpRUH3Sk8CLrFPn3XefAhk3gIsqQjGXss/L9ZaiH83k62Czgjso50EVzD7kj im2lX13libB2mMKFPjYs5fxHOTQh7D8tCOXl4FYu2eP+fltq7WhM2cM1B0cU8JpznGBJ 6PoIER3MmNyUlYmyEXAvn+jGQKfW6g9kBjN4i6ZuuU7vRjK4Rd36WtpKLyQ8wKfYyDHG 3mtZSmm/tt3wHrcwefW+BTlILRvoNzPF2lKlv4dfNZ5C7byCufbBC4TCkJTudDkz0x+s eeLSYD9l/MwPJx2/acOlyofG0bq1M7TsE6VZTTwgoUlDWxBWWME2LoV+sHv/ULN2zB9d /UPg== X-Gm-Message-State: AGRZ1gJO9MhH5yM36dS+ue34NtmCqlGv2C5kS35n4nHcQJjNoQPQeCmU mbYuPpwCy++km3WrwNHuaCZIoQhsL1I= X-Received: by 2002:a25:2104:: with SMTP id h4-v6mr10457570ybh.220.1540807604909; Mon, 29 Oct 2018 03:06:44 -0700 (PDT) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com. [209.85.219.169]) by smtp.gmail.com with ESMTPSA id v19-v6sm6970180ywv.19.2018.10.29.03.06.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 03:06:43 -0700 (PDT) Received: by mail-yb1-f169.google.com with SMTP id w16-v6so3171503ybp.3 for ; Mon, 29 Oct 2018 03:06:43 -0700 (PDT) X-Received: by 2002:a25:cb53:: with SMTP id b80-v6mr12945265ybg.303.1540807603143; Mon, 29 Oct 2018 03:06:43 -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: <31c175d6-b1e9-f8d7-0b8b-821271a59a70@linaro.org> From: Tomasz Figa Date: Mon, 29 Oct 2018 19:06:30 +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 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 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=C3=BCsseldorf. The de facto Codec API that > > originated at those events was later implemented by the drivers we alre= ady > > 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 | 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/Documentati= on/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 r= esolution > > + 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 th= at > > + contains meaningful picture data (visible area); width and h= eight > > + 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``; read= -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 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