Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp632868imm; Wed, 10 Oct 2018 01:35:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV63DEVAgacyh24PqZYOEKEjWSbC6YRvWII98bQSMlmbLcgwW9H3rsvgN3f3MsICNFpCdCflo X-Received: by 2002:a62:cc0e:: with SMTP id a14-v6mr33500218pfg.131.1539160557611; Wed, 10 Oct 2018 01:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539160557; cv=none; d=google.com; s=arc-20160816; b=0F04lxBgYsAJI9ZaTUrHyPRw0YUo61/MRld4fgs1lEXFCHITPRYfzOgZffufp5D88J Wh13YS01/E/3D2v4GYZJ91BFjPBPQqGdwLbYPzh0iaMqqUJEi28XhP6czkQr/vOvbwKK 8iqvH79y7QittQFMYKK5IRYYGvYuWoOZbk7Y6AcPczwZ1lHVOIfA+vpi+pUjae7l6def jvzU7+XNzvJ1L+itBQ4HCiI4eX84mW4PJLoSkEBs6n10JxtbOCm1+anr/o06QLUkUCUp SVruTh1/ZBe5fmYNVxFdnMmd5i+K+lbSguOWF1X/XDJ+qvkLQg986dgfiPi8yrDl3pXX ANHQ== 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; bh=/D54NYkwSD4yjpNi2rPABFvSi4zTQPWtZmsvl3VrBMI=; b=LDD5i+nHlZHP3QsC12uaWmvt6Rf82edyFVhQnSPqOehAfZhFG+cRWbwSB02d6LciR0 2u9bhXY6uffnQAZZS8YAf1XdtS86ruR6ZZltLn77s9oX7PmxTB5+6zUZdxWaZO7R7UQ2 Ff5RLpamuruOlg05t5OAs9vUjInvQRtlOuFm8x1o5uwE/mkT/rYnijqNXFqEHAeacg2/ liEu6u8GShnMgYwqHpy10ehfiCR0ExIpUIwJ+SNyxJELdzgp37cb7Rpsp7p15rn9xd4s 5dshZemH63dyLO7pI8I/IiMNEhGA6epOqQM8fb+6G/pT1RKM7xmtshrmEpFnjzGx+KJ6 Whnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EvDBTT7n; 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 b13-v6si26929536plm.275.2018.10.10.01.35.42; Wed, 10 Oct 2018 01:35:57 -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=EvDBTT7n; 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 S1727033AbeJJPzM (ORCPT + 99 others); Wed, 10 Oct 2018 11:55:12 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:37671 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbeJJPzM (ORCPT ); Wed, 10 Oct 2018 11:55:12 -0400 Received: by mail-yb1-f195.google.com with SMTP id h1-v6so1867645ybm.4 for ; Wed, 10 Oct 2018 01:34:06 -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=/D54NYkwSD4yjpNi2rPABFvSi4zTQPWtZmsvl3VrBMI=; b=EvDBTT7nWnL5qHpRiF/PrDWVXyj1j0geetXoRsh7RYHhZSwQUsg2hAJiP/f8eCwM1f NQLlOGEgQY+twva4PEamWGZy18lgU1A+L/hMcf35S/PAl78osvh+KxEkJBSYrknq4JcH JJ1CmGwVZZdqOxw+uDOxDGItrDLx7XeEV6SbE= 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=/D54NYkwSD4yjpNi2rPABFvSi4zTQPWtZmsvl3VrBMI=; b=Na0NCmgr002qp9xNl6e0ihtmj/+nuRhHiFJupupDEpTEC7yxa1+9wwmql61hmp5o2z 5InMcUsiMaLopwFfK2xXSR5XuhmpzkQ0hddC4Ykru7v9a9EEk9OIjUXALOt+Bil8+Tdm vuH+hBzynHReeOPp3rU0+7w3/Rj6GrkxOx4EyXdyFcmRZkVguf40v0giQgK3l93gwoN/ REl2ezNIU14Xwp5i4TFbez2/2MF4WLk2tNQ8VdfTuZ7bthBUO6s7AIO80iaDyAJCH6kg OoZgKWvAdg76bDl17O2nY7wrZFl3bIH+TkxlRw2qgFP7pJDANDV5imPXhqu3NL8JxEdy GBPQ== X-Gm-Message-State: ABuFfojUM3qjCEZZ7BoliDrxfREHH3MufIkpXSxfyMTWqpdbsqexdZ/2 ohTyMSrqGlmJOl6h/FkCSfQX+k7ixj0dzw== X-Received: by 2002:a25:4155:: with SMTP id o82-v6mr17318877yba.310.1539160445449; Wed, 10 Oct 2018 01:34:05 -0700 (PDT) Received: from mail-yw1-f47.google.com (mail-yw1-f47.google.com. [209.85.161.47]) by smtp.gmail.com with ESMTPSA id o195-v6sm8282403ywd.82.2018.10.10.01.34.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 01:34:04 -0700 (PDT) Received: by mail-yw1-f47.google.com with SMTP id y14-v6so1844614ywa.4 for ; Wed, 10 Oct 2018 01:34:04 -0700 (PDT) X-Received: by 2002:a0d:fdc6:: with SMTP id n189-v6mr17980009ywf.443.1539160443877; Wed, 10 Oct 2018 01:34:03 -0700 (PDT) MIME-Version: 1.0 References: <20180828080240.10982-1-paul.kocialkowski@bootlin.com> <20180828080240.10982-2-paul.kocialkowski@bootlin.com> In-Reply-To: <20180828080240.10982-2-paul.kocialkowski@bootlin.com> From: Tomasz Figa Date: Wed, 10 Oct 2018 17:33:52 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] media: v4l: Add definitions for the HEVC slice format and controls To: Paul Kocialkowski Cc: Linux Media Mailing List , Linux Kernel Mailing List , devel@driverdev.osuosl.org, "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Mauro Carvalho Chehab , Maxime Ripard , Greg KH , Chen-Yu Tsai , thomas.petazzoni@bootlin.com, linux-sunxi@googlegroups.com, ayaka , Hans Verkuil , Ezequiel Garcia , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus 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 Hi Paul, On Tue, Aug 28, 2018 at 5:02 PM Paul Kocialkowski wrote: > > This introduces the required definitions for HEVC decoding support with > stateless VPUs. The controls associated to the HEVC slice format provide > the required meta-data for decoding slices extracted from the bitstream. > Sorry for being late to the party. Please see my comments inline. Only high level, because I don't know too much about HEVC. [snip] > +``V4L2_CID_MPEG_VIDEO_HEVC_SPS (struct)`` > + Specifies the Sequence Parameter Set fields (as extracted from the > + bitstream) for the associated HEVC slice data. > + The bitstream parameters are defined according to the ISO/IEC 23008-2 and > + ITU-T Rec. H.265 specifications. > + > +.. c:type:: v4l2_ctrl_hevc_sps > + > +.. cssclass:: longtable > + > +.. flat-table:: struct v4l2_ctrl_hevc_sps > + :header-rows: 0 > + :stub-columns: 0 > + :widths: 1 1 2 > + > + * - __u8 > + - ``chroma_format_idc`` > + - Syntax description inherited from the specification. I wonder if it wouldn't make sense to instead document this in C code using kernel-doc and then have the kernel-doc included in the sphinx doc. It seems to be possible, according to https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html . Such approach would have the advantage of the person looking through C cross reference being able to actually see the documentation of the struct in question and also making it easier to ensure the relevant C code and documentation are in sync. (Although this is UAPI so it would be unlikely to change too often or at all.) [snip] > +``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS (struct)`` > + Specifies various slice-specific parameters, especially from the NAL unit > + header, general slice segment header and weighted prediction parameter > + parts of the bitstream. > + The bitstream parameters are defined according to the ISO/IEC 23008-2 and > + ITU-T Rec. H.265 specifications. In the Chromium H.264 controls, we define this as an array control, so that we can include multiple slices in one buffer and each entry of the array has an offset field pointing to the part of the buffer that contains corresponding slice data. I've mentioned this in the discussion on Alex's stateless decoder interface documentation, so let's keep the discussion there, though. [snip] > @@ -1696,6 +1708,11 @@ static int std_validate(const struct v4l2_ctrl *ctrl, u32 idx, > case V4L2_CTRL_TYPE_H264_DECODE_PARAMS: > return 0; > > + case V4L2_CTRL_TYPE_HEVC_SPS: > + case V4L2_CTRL_TYPE_HEVC_PPS: > + case V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS: > + return 0; > + I wonder to what extent we should be validating this. I can see 3 options: 1) Defer validation to drivers completely. - Potentially error prone and leading to a lot of code duplication? 2) Validate completely. - Might need solving some interesting problems, e.g. validating reference frame indices in DPB against current state of respective VB2 queue... 3) Validate only what we can easily do, defer more complicated validation to the drivers. - Potentially a good middle ground? Best regards, Tomasz