Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1000381imw; Tue, 5 Jul 2022 01:57:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sUxr0jEJAMOM0JvHjIJRTZWGdADbYAkIVCIjA9/YJrF8gAG918VYdcHFXXFZr99hr16svJ X-Received: by 2002:aa7:df83:0:b0:43a:4b96:f126 with SMTP id b3-20020aa7df83000000b0043a4b96f126mr14403838edy.309.1657011430429; Tue, 05 Jul 2022 01:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657011430; cv=none; d=google.com; s=arc-20160816; b=T6BP+KXKxOgNoOYBiGN8m4ERInyLcsf6mTqoRam2cjjxs4VqL3nIZXibxxGX9caLoP MbbJVoKnV690z7tPv1Fd/hUs/mSjLmxLtqyn3DaOmg1pgYfyiCNqlsa+PTvvBRScOoZc UD6SOYqHjAGzNBQ1FA9OuzZ5l0AJQyX5kU6cKQteWcmhm5ZvnieF1WrKh0oIcsrHG9Ye aQj8gWPkhiFV5K6GCcXLyRUZXO7OD1Q4/mxWrDE0Qq3elOTpi9XxY14cGVtIBT8Oc1+c s8tTWkLDH16vV5Xt1qt5kKkGApoLhzx1KdXtxtYEFXEx9s/G80UervsaH4/MCLc7yN7o Milg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+ggN6RrsvQ67FU7qSP+FNDwIoju+AN2C0wG38CVcBsY=; b=dEsa0fhHkURI546N0R3rg0O7xXUgt7z4apH6JGXpCEdj9RXBybaOVxJ59k47kef0co T/vYI5/e+nQm7HUs7gv3UYf4NQLQvMev1Wa8VlY0DrU8hCEbNwcdkR1i6Q5Hon0PiZuN JXgYHZu1/5jJqasbGseV/ZPMKin7z4kgN4nCBWoU2AocYa/QSNc/BlzYkJ7kSCjXgOhP 9CN778M4QRf/31Q/5T82SPz/+1wk/Btc9sMcNUGsY7QOwBg2VnVyNLF+QBE4f4X7XHvA tqxHPpwrkIknP5nnydKeuFzFx2MRAoHxoAsFSxYl9+TmrE0FeN7TK1ri4tcR8grRhRL1 juGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dKgZved5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw9-20020a170907a0c900b0072abb81b5f5si9454447ejc.537.2022.07.05.01.56.44; Tue, 05 Jul 2022 01:57:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dKgZved5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231423AbiGEIzD (ORCPT + 99 others); Tue, 5 Jul 2022 04:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbiGEIyj (ORCPT ); Tue, 5 Jul 2022 04:54:39 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39E7912750; Tue, 5 Jul 2022 01:54:36 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:6610:ee84:2ba:7917]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id EEBA266019BB; Tue, 5 Jul 2022 09:54:33 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657011274; bh=dtO6lMDwvQckB4oc1V7swMFQk+mFZSHxrvREIABIok8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dKgZved56ZYiXpqTNP/HkKVSSmXvBkf5hmso6ajLiGzHNilCSG0REbKiIpNKpEriN EZ9f6N2hOombvbl13FrkwGyyhcdC1qj+bzXHZoh4nxfYar11ZRlybWD8PXLkU0OYWm NICK0GpjZc95ChKpOPbHcqXRYIIKKFmw9BrSVeA7vlKXDUSCbFYU6aChJlbeeRhmxO BN7quwVYX/tlJyaKrFWaPDZgwBGZq1ns7wdEUihNJt19BJU80wJVOU38oPpKNU3X8/ xF5ZrGqF9qC0Kn1LijNxan+VY1Et8ecLm1O4P6xAaeGkaMj/IgtJwdX5cHC8hEyIiX SbWetIdGzggkw== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v10 09/17] media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS as a dynamic array Date: Tue, 5 Jul 2022 10:54:12 +0200 Message-Id: <20220705085420.272912-10-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220705085420.272912-1-benjamin.gaignard@collabora.com> References: <20220705085420.272912-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Make explicit that V4L2_CID_STATELESS_HEVC_SLICE_PARAMS control is a dynamic array control type. Some drivers may be able to receive multiple slices in one control to improve decoding performance. Signed-off-by: Benjamin Gaignard Acked-by: Nicolas Dufresne Tested-by: Jernej Skrabec --- version 9: - Add comment about current driver dynamic limitation to 1 - Remove unused define Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 2 ++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + drivers/staging/media/sunxi/cedrus/cedrus.c | 2 ++ include/media/hevc-ctrls.h | 3 +++ 4 files changed, 8 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index eeb60c9a1af4..db0df7d9f27c 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -2986,6 +2986,8 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - These bitstream parameters are defined according to :ref:`hevc`. They are described in section 7.4.7 "General slice segment header semantics" of the specification. + This control is a dynamically sized 1-dimensional array, + V4L2_CTRL_FLAG_DYNAMIC_ARRAY flag must be set when using it. .. c:type:: v4l2_ctrl_hevc_slice_params diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 9f55503cd3d6..d594efbcbb93 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1510,6 +1510,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, break; case V4L2_CID_STATELESS_HEVC_SLICE_PARAMS: *type = V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS; + *flags |= V4L2_CTRL_FLAG_DYNAMIC_ARRAY; break; case V4L2_CID_STATELESS_HEVC_SCALING_MATRIX: *type = V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX; diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index 87be975a72b6..b12219123a6b 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -178,6 +178,8 @@ static const struct cedrus_control cedrus_controls[] = { { .cfg = { .id = V4L2_CID_STATELESS_HEVC_SLICE_PARAMS, + /* The driver can only handle 1 entry per slice for now */ + .dims = { 1 }, }, .codec = CEDRUS_CODEC_H265, }, diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h index 57053cfa099b..341fc795d550 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h @@ -314,6 +314,9 @@ struct v4l2_hevc_pred_weight_table { /** * struct v4l2_ctrl_hevc_slice_params - HEVC slice parameters * + * This control is a dynamically sized 1-dimensional array, + * V4L2_CTRL_FLAG_DYNAMIC_ARRAY flag must be set when using it. + * * @bit_size: size (in bits) of the current slice data * @data_bit_offset: offset (in bits) to the video data in the current slice data * @nal_unit_type: specifies the coding type of the slice (B, P or I) -- 2.32.0