Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6014800pxb; Mon, 14 Feb 2022 13:10:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVQi+YbKD36rjNcHTqKw4dtJInknkhjhPAbtM5imLKka+UiHBUp7nyvk2IccucnLK7FgU+ X-Received: by 2002:a63:ed58:: with SMTP id m24mr742910pgk.33.1644873016628; Mon, 14 Feb 2022 13:10:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644873016; cv=none; d=google.com; s=arc-20160816; b=L3Jx3CPX6yP1F367DFUxSwg4z3XAPg56SY7OHGGtz/m2fx5rAMj+RSWUTa7hZvNETf yzVvWmAv99EoW8xrYkIbMAtk9NaWUmuT6+FEukgmPYF5McotgX7/hCfVK0AfWZWPANKq DGzavTBz+EWRoby0MZCluH8Uo6U3aabjyMVW//bscLBucmfmfFZB9m7jkE0z73wKFLDQ HeXX6uqwqFe8nNUO1NJVoiRheZ3fkEqutipa6lJYjrc/SIqa8r807ID+xKS8QTdz7/+4 +DjYe+TEvH7g8ZQDttK/57AqsoZPZLDq6JF/J/R1RKDbVaSp/ocEOz9gWIz0icu4J2/y K+CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jCWFsPfpDrBzbYiKklb6PeoO4p1Oig/bhAS/9UibxYg=; b=e21oCyMkJgulFJ+ce/qv9aGpJ/59ZvVEdsjoFCViiuxOTmuWB+T47TUO32wuZO3GrC ZpdWSbjAgRcMbenwr20/JRKNsiUdp+24sz9LmwcqltWKJvN1NGwTQApG8polUvn5FqmZ V83XaFVajiBaMBKCrFzDDV2KMcni590y0zGGPXsF5Kmd8LQ6MsBtDVvIlc02CU0jvjlu hP5V5tImKSnSeoGUtdifEaMoI8sshHAgdqqEauF3qRcFE451yYc88cE7oCUptUtT6keO DCUPEbKiCCCuEu2SpKur5ujTabT+D6NbOXya3AsxnQnflb7EJS1VZoRVlRiBVL2a+6pt rroA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=h5ZC0DX1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k11si8837273plk.601.2022.02.14.13.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 13:10:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=h5ZC0DX1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4062E1954FF; Mon, 14 Feb 2022 12:30:13 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357049AbiBNRZU (ORCPT + 99 others); Mon, 14 Feb 2022 12:25:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357052AbiBNRZT (ORCPT ); Mon, 14 Feb 2022 12:25:19 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C044652F5; Mon, 14 Feb 2022 09:25:06 -0800 (PST) Received: from [IPV6:2a01:e0a:120:3210:1b99:5680:6d85:c710] (unknown [IPv6:2a01:e0a:120:3210:1b99:5680:6d85:c710]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 6A6311F43D7B; Mon, 14 Feb 2022 17:25:04 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644859505; bh=jdV1152z3m5drM9712crBNhL7RePfA8EUYrTwKj1Ihk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=h5ZC0DX1y67GAbWOIqDGXj7/yYm7W1HC1Iwbe9T3exBxB84HJ+URLCdvjKItYDzuE M5H4UXbSD+2Rp0Ieop3kKsx/dJ5WYlJbva4GHQi9Vx7vZKq7oaAAZJoHGU7y/2ha7O h8uaokr1BKuv9UmP4BGvxKrnZ6zWahUyftTVU1Q6jqel3BpHwzDYB6Q7+bD41fvSPP DCmwdCBry3oNBJ9WcLqiQfOV6t1YQ9uqkL8h0oTord+ebvbzPTiL7ZDUkuzvsl2PDI 9yu3gKXZL8MJ2MxDesTKfxR1Tvjt8B6Xu5+yDtHlbtGjcxybcyyE0K1FfeN4SqFacc H1D/EJpl7rJaA== Message-ID: <903ca214-9576-33aa-8412-7c71c9d8ac09@collabora.com> Date: Mon, 14 Feb 2022 18:25:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [RFC] media: uapi: Move HEVC stateless controls out of staging Content-Language: en-US To: =?UTF-8?Q?Jernej_=c5=a0krabec?= , mchehab@kernel.org, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, hverkuil-cisco@xs4all.nl, jonas@kwiboo.se, nicolas@ndufresne.ca Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Alex Bee , jc@kynesim.co.uk References: <20220201123439.353854-1-benjamin.gaignard@collabora.com> <8038233.T7Z3S40VBb@kista> From: Benjamin Gaignard In-Reply-To: <8038233.T7Z3S40VBb@kista> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 13/02/2022 à 12:33, Jernej Škrabec a écrit : > Hi Benjamin, > > CC: Alex, John > > Sorry for late response, but I've been very busy last week. > > First of all, thank you for doing this! It's about time that HEVC moves > forward. > > Dne torek, 01. februar 2022 ob 13:34:39 CET je Benjamin Gaignard napisal(a): >> The HEVC stateless 'uAPI' was staging and marked explicitly in the >> V4L2 specification that it will change and is unstable. >> >> Note that these control IDs were never exported as a public API, >> they were only defined in kernel-local headers (hevc-ctrls.h). >> >> While moving the controls out of staging they are renamed and >> control IDs get new numbers. >> Drivers (Hantro, Cedrus) and Documentation are updated accordaly. > accordaly -> accordingly > >> Additional structures fields has been added for RKVDEC driver usage. > You should do separate patch for that, preceding this one. One patch should > only do one thing. I will do that in v2 > > I also suggest that you add additional patch for removing bit_size field in > struct v4l2_ctrl_hevc_slice_params. Similar fields were already removed from > MPEG2 and H264 structures. Bit size can be deduced from output buffer size and > it doesn't hurt if bit size in Cedrus is set to bigger value than actual slice > bit size. ok > >> Hantro dedicated control is moving to hantro-media.h >> Since hevc-ctrls.h content has been dispatched in others file, remove it. >> >> fluster tests results on IMX8MQ is 77/147 for HEVC codec. >> >> Signed-off-by: Benjamin Gaignard > Note that Cedrus still needs additional information in order to decode some > HEVC videos. Missing info is num_entry_point_offsets and list of all > entry_point_offset_minus1 (obviously, num_entry_point_offsets in size). > > I suggest that this is represented in a new control, which would use dynamic > array feature, written by Hans. While Cedrus supports max. 256 entries, it can > be much bigger in theory, but in reality, it's much smaller (like 4-8 > entries). I haven't seen yet any user for these fields but I will create a new control like #define V4L2_CID_STATELESS_HEVC_ENTRY_POINT (V4L2_CID_CODEC_STATELESS_BASE + 407) struct v4l2_ctrl_hevc_entry_point_offset { __u32 entry_point_offset_minus1; }; and add it in the documentation: ``V4L2_CID_STATELESS_HEVC_ENTRY_POINT (struct)`` Specifies the i-th entry point offset in bytes and is represented by offset_len_minus1 plus 1 bits. This control is a dynamically sized array. The number of entry point offsets is reported by the ``elems`` field. This bitstream parameter is defined according to :ref:`hevc`. They are described in section 7.4.7.1 "General slice segment header semantics" of the specification. > > Last but not least, data_bit_offset should be better defined. Currently it > points right after last header bit, just like Cedrus needs it. However, there > is padding after that, at least 1 bit and 8 bits at most, so slice data always > starts from byte aligned address. It probably make sense to rework that field > to be byte offset, not bit, just like in VA-API. Note that RPi HEVC driver also > uses byte aligned address directly. Cedrus would need some kind of workaround > and only one that works is this one: > https://github.com/bootlin/libva-v4l2-request/blob/master/src/h265.c#L191-L209 If Cedrus driver is happy with this definition I will keep it like that. When providing offset in bit is more accurate and any driver can align the value if needed, the reverse (byte -> bit) isn't possible. Regards, Benjamin > > Best regards, > Jernej > >