Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp218152imm; Wed, 22 Aug 2018 02:59:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxfBXJeWHIdktXoJsZUiLAwEpVbajfaRsxDPhUTa6xzpEtGpVfR5/MDUn5wAjSzLap7cMzx X-Received: by 2002:a62:54c7:: with SMTP id i190-v6mr56797534pfb.155.1534931986776; Wed, 22 Aug 2018 02:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534931986; cv=none; d=google.com; s=arc-20160816; b=Yj/SLDOnD5jHhzQxB8AcdZ6cTPnzJWKHD4WxDgzDYYmgP9CbP6jTRnxQleNMn7gxOz cggIheS7valnykmsjy6ccu01x/hHz36mJDIqKGLnwWYw7U3VgorFALCSzanN+2R3Ef1n H4zrn5JRY1V2h7bAeTrmHHdhuXEIiQEPKOnYKpLJhAK0rZTAHTFwICN+it8wc0zlO/9U KSSNlH67DVqb0JQbY813b90VNs6uI+Og9rsLJD85JGXz0md8+jx9NWyuJepUIHF0PTKl RNZ/pS1Ch66rWqtQP1HQytGGlU5xIO3vxFh7CXi6f56fbBZ6Jjg4WQYqQvWBEIch8IJt mxeQ== 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 :arc-authentication-results; bh=a8prYhNMOmxr2ycjF9aVI5QZ2m9k9f+piYIS4OvF9K4=; b=J+k1Xskkl2ML9Vrwuyo8kw7/3rtg/fD+c/ogphRxWUZkqllmy71r6NwVFGqfGtj2nE 8TzMDEmjixnNRR1nRL+pJpq6PThpsWo3lAJDErR1UnpOXS1Ar2lVN+S2TfUhWEmFV2BA JS6dF2nUyKqIbK5hn4wLsuZYnrUVW+a5mxH6VYQ4V28lYGYT+xkC5z/TmuaNzG1KmqjQ vUock9WBV4hbnlukWLf1mIRQWUqk1rgFglFe5kBglsFhls/YWuJQpfyW2LsWTCVoE7cg uZVGvADghdxFTAlEwHq8B3t9S8pU6+t5+5351FQlMdci/jmOVZOjUyCN3Gtj1kEIY9Nu c9mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZnamOM9g; 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 h69-v6si1321356pge.13.2018.08.22.02.59.31; Wed, 22 Aug 2018 02:59:46 -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=ZnamOM9g; 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 S1728572AbeHVNSx (ORCPT + 99 others); Wed, 22 Aug 2018 09:18:53 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:44455 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728226AbeHVNSx (ORCPT ); Wed, 22 Aug 2018 09:18:53 -0400 Received: by mail-yb0-f195.google.com with SMTP id l16-v6so442719ybk.11 for ; Wed, 22 Aug 2018 02:54:42 -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=a8prYhNMOmxr2ycjF9aVI5QZ2m9k9f+piYIS4OvF9K4=; b=ZnamOM9g7KhuNs0dYm4YtvyDEhG+e/nId7mTRVP0Hr9BuYJMdimC7dXLIDeOcHhm21 psqvKzEN1CazvbxpUNdUYjdKJUAILVSOpDQ7YLVYH9sInDsUcM0sT9JdZK0xuxZ8dQ9w vuFH19aHad3h2hcQwK2UDeM1SYbO2xGZG7S8s= 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=a8prYhNMOmxr2ycjF9aVI5QZ2m9k9f+piYIS4OvF9K4=; b=eMQQbybung127fBi6Vyz4H1fhompv4G3Yq/DaUdEFIIQNHdFQ6BngZXbDqQInpfuMf IWgkRAZDG5SKoqlcEQAlM0e0ujrqu2vHynhf48+jfNVOC/4tTFDZjnJivttMetOFkAvf XgPvHghR428+Hz8jAN8xO8jCLJ1PvHKZzreiE7pWzxDZA74sUTYyCCzaICKUtyBaHBVH jQ7sD9k9FQriav/kAOahzd26Zu+vRj4fcXhtXUoM7zCQSatJ9mddGXIzrTddzblI5C67 XXHL4jeA1EMr8ihnvh6ZzrVmz/W024Lk/fRX8eYdbKeJT1Cew8FGgXl0AjW224AM13Yp F/jQ== X-Gm-Message-State: AOUpUlGrfD/oCtrQ8YNYk9BEkqevrX+DaNsOe9whvVd7rAlAjAaTVg5d 03890ZvtsiGabGvY5Jzu5C3bWU5lNuKPCA== X-Received: by 2002:a25:cb54:: with SMTP id b81-v6mr29205632ybg.90.1534931681586; Wed, 22 Aug 2018 02:54:41 -0700 (PDT) Received: from mail-yb0-f169.google.com (mail-yb0-f169.google.com. [209.85.213.169]) by smtp.gmail.com with ESMTPSA id d6-v6sm476674ywa.85.2018.08.22.02.54.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 02:54:38 -0700 (PDT) Received: by mail-yb0-f169.google.com with SMTP id z12-v6so446516ybg.9 for ; Wed, 22 Aug 2018 02:54:38 -0700 (PDT) X-Received: by 2002:a25:9347:: with SMTP id g7-v6mr7822619ybo.293.1534931677558; Wed, 22 Aug 2018 02:54:37 -0700 (PDT) MIME-Version: 1.0 References: <20180613140714.1686-1-maxime.ripard@bootlin.com> <20180613140714.1686-2-maxime.ripard@bootlin.com> <80e1d9cb49c6df06843e49332685f2b401023292.camel@collabora.com> <20180822091557.gtnlgoebyv6yttzf@flea> In-Reply-To: <20180822091557.gtnlgoebyv6yttzf@flea> From: Tomasz Figa Date: Wed, 22 Aug 2018 18:54:23 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/9] CHROMIUM: v4l: Add H264 low-level decoder API compound controls. To: Maxime Ripard Cc: Ezequiel Garcia , Pawel Osciak , Paul Kocialkowski , Hans Verkuil , Alexandre Courbot , Sakari Ailus , Laurent Pinchart , Chen-Yu Tsai , Linux Kernel Mailing List , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux Media Mailing List , Nicolas Dufresne , jenskuske@gmail.com, linux-sunxi@googlegroups.com, thomas.petazzoni@bootlin.com, groeck@chromium.org 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 Wed, Aug 22, 2018 at 6:16 PM Maxime Ripard wrote: > > Hi, > > On Tue, Aug 21, 2018 at 01:58:38PM -0300, Ezequiel Garcia wrote: > > On Wed, 2018-06-13 at 16:07 +0200, Maxime Ripard wrote: > > > From: Pawel Osciak > > > > > > Signed-off-by: Pawel Osciak > > > Reviewed-by: Wu-cheng Li > > > Tested-by: Tomasz Figa > > > [rebase44(groeck): include linux/types.h in v4l2-controls.h] > > > Signed-off-by: Guenter Roeck > > > Signed-off-by: Maxime Ripard > > > --- > > > > > [..] > > > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > > > index 242a6bfa1440..4b4a1b25a0db 100644 > > > --- a/include/uapi/linux/videodev2.h > > > +++ b/include/uapi/linux/videodev2.h > > > @@ -626,6 +626,7 @@ struct v4l2_pix_format { > > > #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */ > > > #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */ > > > #define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */ > > > +#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */ > > > > As pointed out by Tomasz, the Rockchip VPU driver expects start codes [1], so the userspace > > should be aware of it. Perhaps we could document this pixel format better as: > > > > #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices with start codes */ > > I'm not sure this is something we want to do at that point. libva > doesn't give the start code, so this is only going to make the life of > the sane controllers more difficult. And if you need to have the start > code and parse it, then you're not so stateless anymore. I might not remember correctly, but Rockchip decoder does some slice parsing on its own (despite not doing any higher level parsing). Probably that's why it needs those start codes. I wonder if libva is the best reference here. It's been designed almost entirely by Intel for Intel video hardware. We want something that could work with a wide range of devices and avoid something like a need to create a semi-stateless API few months later. In fact, hardware from another vendor, we're working with, also does parsing of slice headers internally. Moreover, we have some weird kind-of-stateful decoders, which cannot fully deal with bitstream on its own, e.g. cannot parse formats, cannot handle resolution changes, need H264 bitstream NALUs split into separate buffers, etc. As I suggested some time ago, having the full bitstream in the buffer, with offsets of particular units included in respective controls, would be the most scalable thing. If really needed, we could add flags telling the driver that particular units are present, so one's implementation of libva could put only raw slice data in the buffers. But perhaps it's libva which needs some amendment? Best regards, Tomasz