Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2921938yba; Tue, 16 Apr 2019 00:25:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpogG5CXUZ6uddMzs4R0EPLcTeAyiDz2bHlzPlFYP0VECm2KSYrhTw4hqQ+W8N8luzdbw9 X-Received: by 2002:a17:902:7206:: with SMTP id ba6mr81464418plb.301.1555399541259; Tue, 16 Apr 2019 00:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555399541; cv=none; d=google.com; s=arc-20160816; b=g7t9DqcI7h5beudlGlIG4dkIEeN2whtI5T+oK0Id1qN6SiaaRzqtnXEBZpbm22xuli 7rlFH6gE3PeqeLBteuWpTpMdBhL1ylnjmhKUOXv4r409l7cDRoNSYCMoZTjvuUANXpY4 zR5jtHgdXSBAwVokGme/gQ+saLUWLtNHD9rLXb8GbJAtNyY4rfwnm579zMzT9jzuw4KV Vrx/GMijtvo1qd0diA1BX5aZBT8nfoIlIftZXq1K8+jV6J3KHjYLtKX17i73eztWA5s8 n1ftpDWQ8drKDTADvT6UQG9HR7hX8m3PzjFNBceNTsVRWw9ZyiajTYW/yLhpwfl7ojLj jQbg== 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=GfJbj3592HFAwS7sdfwgYwNJSeaElGORqUj9VQPS7Yc=; b=YM1xy9Es/6J60xd/R2FRQNpAHzHWIusd5yd7ghvwWVs6FZ7egi9rjvk0xdBa98c2rE WqTrVO0opA2+1OB3gEiCqGU4RLkqy1zGlIGmpywk76PC65LD2Im/wYRGMRbLuvb0pskp IIcA+s46vo7pFP1pjybxkZCYjQCipz6CsfDckQetFaLhMvrHjJs6he+I7LcKmnps1kmc MDhN37XRMsorKaeBuGVvEXEKI2XAQYPVs+447XxAWkgzYxyawxoPPAwYmDj8tCeunPAV 158UUT9o/6APpGkyhES4Jb0lxOO+NIVvDQ/Nwmd/qqY0UNJzlQwsmAJtY94NFJoJX5bF yNPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FM5V4Py8; 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 r11si42368172pgm.353.2019.04.16.00.25.25; Tue, 16 Apr 2019 00:25:41 -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=FM5V4Py8; 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 S1728513AbfDPHYu (ORCPT + 99 others); Tue, 16 Apr 2019 03:24:50 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:40549 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727828AbfDPHYu (ORCPT ); Tue, 16 Apr 2019 03:24:50 -0400 Received: by mail-ot1-f66.google.com with SMTP id t8so16746634otp.7 for ; Tue, 16 Apr 2019 00:24:49 -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=GfJbj3592HFAwS7sdfwgYwNJSeaElGORqUj9VQPS7Yc=; b=FM5V4Py8RkZJGeFFHn6B/aweYNJj0IZn6J4x5pKCTEqYobR2ZiIVwa7CGqqMPoLvQy FtRSkcnwY3aFDLVjJy/ByhOPFWptPIPutAc7gnB/bGJJOx/ifAppTL2QAupL/NsWIRSp X/b+VKIiAHHwFIJAYOIZmi45AJ+ZYUkjiwYaM= 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=GfJbj3592HFAwS7sdfwgYwNJSeaElGORqUj9VQPS7Yc=; b=kl7zd0P0lRauic7TryDMPkYu+/llYhtqy6rdFMFd/Vq2tl12FFlYPkEGBOXly8Vh+O UkxLTRUKViINrEQJ3YjLRVyPaYnEBePomYHx9ychEcViVxwlF8hCHPCY0XJEMIWfTBFt U8nLT1ex3TW3jmBdskE4twUH+lFYc7wdyIrdvqVJBsAohsWSpXvYXFDAYoi83AygPSyY ThjSY7cBtNFgq0LWr9kYcYyZPCgXXaqMzMVlts7y1ZIDtgAo1eZjQCx4uxiRftQ6ak9c ipde899FP5prLSLyJg8qqpkzOrbh2U9d4eZWQGN0tXpZqiQG4Dc3V3sV1kdoM4YTnkP5 u/fQ== X-Gm-Message-State: APjAAAVFfiXltDHPp2FNf0NiMT+1eGAL1YiKhCTAWSBgf7C6UFBaIH2a nm6b6Ip6i0sfZ7vfdeWQDooXR3Otfkc= X-Received: by 2002:a9d:6187:: with SMTP id g7mr49148720otk.2.1555399489203; Tue, 16 Apr 2019 00:24:49 -0700 (PDT) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com. [209.85.210.52]) by smtp.gmail.com with ESMTPSA id q9sm20359305oti.78.2019.04.16.00.24.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 00:24:49 -0700 (PDT) Received: by mail-ot1-f52.google.com with SMTP id o74so16761988ota.3 for ; Tue, 16 Apr 2019 00:24:48 -0700 (PDT) X-Received: by 2002:a9d:57c2:: with SMTP id q2mr48272947oti.313.1555399021608; Tue, 16 Apr 2019 00:17:01 -0700 (PDT) MIME-Version: 1.0 References: <7cd913545cfc80fa9999839c62c4bf7b354a7904.1554380738.git-series.maxime.ripard@bootlin.com> <20190405151552.biesirbs35uivk7d@flea> <05078223a4098c96f6260f77e9ef2a01b966daa6.camel@collabora.com> <20190411155749.crdpidehjxa6edya@flea> In-Reply-To: <20190411155749.crdpidehjxa6edya@flea> From: Tomasz Figa Date: Tue, 16 Apr 2019 16:16:50 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RESEND v7 1/2] media: uapi: Add H264 low-level decoder API compound controls. To: Maxime Ripard , Nicolas Dufresne Cc: Chen-Yu Tsai , Hans Verkuil , Alexandre Courbot , Sakari Ailus , Laurent Pinchart , Pawel Osciak , Paul Kocialkowski , Linux Kernel Mailing List , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux Media Mailing List , Jens Kuske , Jernej Skrabec , Jonas Karlman , Ezequiel Garcia , linux-sunxi , Thomas Petazzoni , Guenter Roeck 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 Fri, Apr 12, 2019 at 12:57 AM Maxime Ripard wrote: > > Hi, > > On Fri, Apr 05, 2019 at 12:27:48PM -0400, Nicolas Dufresne wrote: > > Le vendredi 05 avril 2019 =C3=A0 17:15 +0200, Maxime Ripard a =C3=A9cri= t : > > > Hi Nicolas, > > > > > > On Thu, Apr 04, 2019 at 11:41:13AM -0400, Nicolas Dufresne wrote: > > > > > > > + * - __u16 > > > > > > > + - ``pic_width_in_mbs_minus1`` > > > > > > > + - > > > > > > > + * - __u16 > > > > > > > + - ``pic_height_in_map_units_minus1`` > > > > > > > + - > > > > > > > > > > > > We recently had some reflection with Alex that this is redundan= t with > > > > > > the width and height in the OUTPUT format. It may also apply to= some > > > > > > other fields in these structs. I feel like they should be remov= ed and > > > > > > passed via corresponding generic V4L2 properties - format, sele= ction, > > > > > > etc. > > > > > > > > > > > > The same problem is also present in the MPEG2 controls. In fact= , there > > > > > > was a patch already which used some fields from the controls to > > > > > > calculate the destination buffer strides, rather than bytesperl= ine in > > > > > > the format. > > > > > > > > > > > > Since we're in staging, it could be done with a follow-up patch= , though. > > > > > > > > > > Just my two cents. I played with some codecs a while back. IIRC s= ome > > > > > specify a "codec" size in addition to the actual picture size, li= ke > > > > > when the encoder does padding to fit the requirements of the code= c > > > > > (spec). Is this needed anywhere? > > > > > > > > With state-less encoders, the headers, which contains the crop > > > > information is created by userspace and for state less decoder, the > > > > headers that contains this information is parsed by userspace. So I > > > > believe that in theory, the accelerator does not strictly need to b= e > > > > aware of the cropped dimensions. > > > > > > > > Another thing, is that there is not guarantied matches between e.g. > > > > depth of the chrome/luma and the final image buffers. Some hardware= may > > > > have bandwidth limitation or internal converter and could possibly > > > > decode 10bit data into 8bit buffers. > > > > > > > > A third reason why I would not try and encode this header informati= on > > > > is that there can be multiple PPS/SPS at the same time, and I think > > > > it's confusing if the relevant information to differentiate them is > > > > removed. > > > > > > Sorry if that sounds a bit dumb, but it's not really clear to me if > > > you're arguing for the removal of the data as Tomasz suggests, or if > > > you want to keep them. > > > > > > The first paragrah seems to advocate for the former, but the two > > > others for the latter. > > > > I think the data should stay. As I said, there can be multiple SPS/PPS, > > while there is only one format. That being said, how does SPS/PPS > > activation works ? How do you tell the driver about all the SPS/PPS and > > which one is being activated ? > > The current way of dealing with this is that the _SLICE_PARAMS control > actually takes an array of SPS's. And same thing for PPS. > > There's no difference between activated and deactivated ones > though. What is the use case for this? Uhm, there is only one format, but so there is only one active SPS/PPS, isn't it? An alternative would be to just make the OUTPUT format a function of the currently set controls, so that it would always match the active PPS/SPS, without the ability for the application to change it. I just want to avoid the case when the OUTPUT format can be set randomly to something different than in the stream and also drivers reading randomly the format-related information sometimes from the controls and sometimes from the format state. Best regards, Tomasz