Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8915978ybi; Wed, 10 Jul 2019 01:34:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwy8+PfM5VL/wTBMG48P66RpxYCbTJj664CjAyqo5dsIXlOXeq2+8h5eb2Aw0Te3yAJrFzu X-Received: by 2002:a17:90a:9b8a:: with SMTP id g10mr5433583pjp.66.1562747679834; Wed, 10 Jul 2019 01:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562747679; cv=none; d=google.com; s=arc-20160816; b=zLlfKfbhQ5zcRf9qT/6cszSDr9/MNQbUVcxPGocpdlwFhmQKDwAmjqFyhkRuVNEjkA RhhD6UQ6QHlJ1jLHP86Abv1jmY39sGXbbo9SMb15sdFz9zRpJtvNYx4yplXJyv5dAOOb +wtvCik/k/DNtGI2m6Yiq+cYsasuenkZxgFdFszJmyqruI5l6QdCkpH7EOLVFv5R47nq dsR4xvf3S3nURqWOXdom1e777v6ha6UlQJ1O7UqPpihGbs9Ih464IaW3DH0P3nPt9zFY GK5tWeU6YO/LLeUxnDjc9fld0Q3DJc8FsynMubugp7aSB2k5D08vg2wrCRa0AzAAC1m/ Rn2w== 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=nVtz/RtjwCEYdQFLJCW6G4ORFWnvHXCMUmZJUUl1vhA=; b=Bskff30/CeoM9moVPunukhV4jI/SUyonXhKP+uWzdC05o6IJpKV2dKyil5ZxXOjIfK fQmOFl/Vi89h9USAmWH7x7IqhOuMMaH1gasFd6OlnrKkE1c/ICwpH7Buns1LqhoG02Qg NX6pLgPm1lx1kDnylaDS3gu4LpKoYBFQQnuxWaN7o76tU2v0UYfUQ3hWww4ZPBJEMTJl XZT21B5ykM250S6nI4PiCOr/mj0ZFndwS2jElexxENQVwG9N2fx7JNse/EbcEU9blDng /0Iiv34OBQTYKN7Eo3q6wn53zhwqJy4IpN+Tt/JLrA2LZrgFsPeeyDpJR7/EZDdvAX6g 6akg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IXgXXgvX; 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 g2si1856752pfq.160.2019.07.10.01.34.23; Wed, 10 Jul 2019 01:34:39 -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=IXgXXgvX; 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 S1727555AbfGJIYJ (ORCPT + 99 others); Wed, 10 Jul 2019 04:24:09 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:44050 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727542AbfGJIYI (ORCPT ); Wed, 10 Jul 2019 04:24:08 -0400 Received: by mail-ed1-f68.google.com with SMTP id k8so1316197edr.11 for ; Wed, 10 Jul 2019 01:24:07 -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=nVtz/RtjwCEYdQFLJCW6G4ORFWnvHXCMUmZJUUl1vhA=; b=IXgXXgvXPtimF3q16gy1j+I8+arnl9Bg8UFUc7zPylYDNgUcqEsKezdXlSkr8TinyM RP3PPF87dV6otolRQcTPjk7kghAfb6pWq1K46lzseOnIq4tZl7XjeLRTMmGa5VQ/E/I2 w9tPkxOIQyi2ZWBT0spXNJI/M92dIJI5K3O34= 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=nVtz/RtjwCEYdQFLJCW6G4ORFWnvHXCMUmZJUUl1vhA=; b=AOitdTJKzz8r/FCYQ7OFMYA0Z+y2LDkhqS7GK4Nd3Gd5EFw8WP8BAOEA8zbA+wLEzT gVRaaWRfQcgWn6tLJuRPxt1FjgCs5k60B9s1PKyt0UKpVL0p0heURnW5MP8A/0Wfg8mC 2gVEtI7DZl27XnzRgBMNPYMhkiEDbC8657J7CfhncHA50tcy778BOg39IYmZQmXOdH4a 7+BW4U7WymMnZSWI52SIpqLSo5AfZTmpGuNVopHyNfVgOUeA4lY/xnhIkMgD3dZ0i3v/ sBZTiRSKFe3dAy1mLDEtHMGDMffLtHp4Y6utHwFwb2v2Dfb9M5BixZjpA1zQDl9NkszO Op4Q== X-Gm-Message-State: APjAAAVKotxCAZwfWvkaTIMMlbh2iQYF6NmppioG1NAOD/m6Wo1shZLb Qqrywq4kuqj9xGtcw5B8IWltij8EsWXQ5Q== X-Received: by 2002:a50:a5b7:: with SMTP id a52mr30385886edc.237.1562747046716; Wed, 10 Jul 2019 01:24:06 -0700 (PDT) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com. [209.85.128.47]) by smtp.gmail.com with ESMTPSA id v8sm499874edy.14.2019.07.10.01.24.04 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jul 2019 01:24:04 -0700 (PDT) Received: by mail-wm1-f47.google.com with SMTP id s3so1273636wms.2 for ; Wed, 10 Jul 2019 01:24:04 -0700 (PDT) X-Received: by 2002:a7b:c7d8:: with SMTP id z24mr4020308wmk.10.1562747044241; Wed, 10 Jul 2019 01:24:04 -0700 (PDT) MIME-Version: 1.0 References: <20190603112835.19661-1-hverkuil-cisco@xs4all.nl> <20190603112835.19661-2-hverkuil-cisco@xs4all.nl> <02da6340-3174-c03b-ffad-cc9a0a58afab@xs4all.nl> In-Reply-To: <02da6340-3174-c03b-ffad-cc9a0a58afab@xs4all.nl> From: Tomasz Figa Date: Wed, 10 Jul 2019 17:23:52 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHv4 1/2] media: docs-rst: Document memory-to-memory video decoder interface To: Hans Verkuil Cc: Linux Media Mailing List , Linux Kernel Mailing List , Alexandre Courbot , Philipp Zabel , Stanimir Varbanov , Andrew-CT Chen , Tiffany Lin , Pawel Osciak 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 Wed, Jul 10, 2019 at 5:09 PM Hans Verkuil wro= te: > > On 7/3/19 6:58 AM, Tomasz Figa wrote: > > Hi Hans, > > > > On Mon, Jun 3, 2019 at 8:28 PM Hans Verkuil = wrote: > >> > >> From: Tomasz Figa > >> > >> 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 alr= eady > >> have merged in mainline, such as s5p-mfc or coda. > >> > >> The only thing missing was the real specification included as a part o= f > >> Linux Media documentation. Fix it now and document the decoder part of > >> the Codec API. > >> > >> Signed-off-by: Tomasz Figa > >> Signed-off-by: Hans Verkuil > >> --- > >> Documentation/media/uapi/v4l/dev-decoder.rst | 1084 ++++++++++++++++= + > >> Documentation/media/uapi/v4l/dev-mem2mem.rst | 8 +- > >> Documentation/media/uapi/v4l/pixfmt-v4l2.rst | 5 + > >> Documentation/media/uapi/v4l/v4l2.rst | 10 +- > >> .../media/uapi/v4l/vidioc-decoder-cmd.rst | 41 +- > >> 5 files changed, 1132 insertions(+), 16 deletions(-) > >> create mode 100644 Documentation/media/uapi/v4l/dev-decoder.rst > >> > > > > Thanks a lot for helping with remaining changes. > > > > Just one thing inline our team member found recently. > > > > [snip] > >> +Capture setup > >> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> + > > [snip] > >> +4. **Optional.** Set the ``CAPTURE`` format via :c:func:`VIDIOC_S_FM= T` on the > >> + ``CAPTURE`` queue. The client may choose a different format than > >> + selected/suggested by the decoder in :c:func:`VIDIOC_G_FMT`. > >> + > >> + * **Required fields:** > >> + > >> + ``type`` > >> + a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. > >> + > >> + ``pixelformat`` > >> + a raw pixel format. > > > > The client should be able to set the width and height as well. It's a > > quite frequent case, especially in DMA-buf import mode, that the > > buffers are actually bigger (e.g. more alignment) than what we could > > get from the decoder by default. For sane hardware platforms it's > > reasonable to expect that such bigger buffers could be handled as > > well, as long as we update the width and height here. > > I've added this: > > ``width``, ``height`` > frame buffer resolution of the decoded stream; typically unchang= ed from > what was returned with :c:func:`VIDIOC_G_FMT`, but it may be dif= ferent > if the hardware supports composition and/or scaling. > > Is that what you were looking for? > Not sure if composition is a requirement here, but I guess it depends on how we define composition. Most of the hardware today at least support arbitrary strides (+/- some alignment), but still write the pixels at (0,0)x(w,h). In fact, there would be already some composition happening, even without arbitrary strides, because G_FMT would return values aligned in some way, but only the visible rectangle would contain meaningful pixel data. Best regards, Tomasz