Message ID | 20230103170058.810597-8-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4723171wrt; Tue, 3 Jan 2023 09:06:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXvMOdLKNhZTAsPIvjlcZHZKmnmwPu2nv+yYdvSCh5wXyEuW2CMe9GtOf8B+WH1BoJXWZaCu X-Received: by 2002:a17:906:ad93:b0:7c1:100d:331a with SMTP id la19-20020a170906ad9300b007c1100d331amr39744874ejb.70.1672765569797; Tue, 03 Jan 2023 09:06:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672765569; cv=none; d=google.com; s=arc-20160816; b=YwKqiHogAyeWOnHfpyDi9WAZnGK8+/BFEZG6pn3qYm1D1io19S02gWY9QoF9pmUCnA fgFvFDTtxDi8M7VYK2oBfY9pB55Sf/N5b37uPhYKZ2HtrPPQURN5zMQqG1sfZWIaPoUF KkCvLqK3fJnQv63awVhQZlCRyviebV+TSTr9HT/mjY/klWPnQAwwfdMxxEg62Z4m0zYH ZmaXAxoM+j1zAGoOIpbUOEE6coYax4l9oV0dXwRGTkzQMbygNMKzYfLUyTqTfgZM+RXd uTYz+KlGqFGO4t/yvXZbDWO1znQNZWkzN+fYcv4jX7QjsTgG4ZJmUkD+PlGj2/UyralN fA8g== 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=PCh5eUW/bBJ+GCMPgywusyxqfVN1vOsr7kKCkpgBOMY=; b=ArWMAUBSZ1mbT4QqcPsEKp+BwpkaW9ur5Zmosjff26yanjsc05Azb9Xb59NBMEY0yT kb+5R5hxm/S99/+Gb1/HSKRyawu4imwYs8vWDUCAowW0FKzyJW4i4a8TgU7LYp0zhtFe 4Bs2pXVC4uZysKCkNe+VPXs54iMVtgwDOslgyh43G3Ap8MntY04cdWG502/RXFpV9NDR QmEhKctiA2YbTwANujI7kA/Xq0Y9l9FgRBLEPc3S1skQUN3hn7PDlDgMSDY2NNHuL8SH f2IayT+ZknU0XeC9z2GlA6i4mcq9HEkgxswn0pJ5ILb8sxssihL5X5zDmcS5/f+RyITt xTtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="Twcm4g/c"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du1-20020a17090772c100b007c11805a849si28410896ejc.341.2023.01.03.09.05.46; Tue, 03 Jan 2023 09:06:09 -0800 (PST) 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="Twcm4g/c"; 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 S238488AbjACRFO (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Tue, 3 Jan 2023 12:05:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238388AbjACRE2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 3 Jan 2023 12:04:28 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76EA113F37; Tue, 3 Jan 2023 09:01:26 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:abfa:cf23:1e4e:2b14]) (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 B43AE6602D0C; Tue, 3 Jan 2023 17:01:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1672765273; bh=hK5ho7sqz6YdWfEyVAdpQFOjW5xXjqXVPgQmWV4hD5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Twcm4g/cthJVoXyWksbRiX7y8N/ltFrn0H2WTwgaY8wpg2XggffZHTU8Rz/VX/ywZ cnabJ/peXL36mzZE72/YW6PO7ENGu5GW1TU5NEo1pMoRLRRceO7FPF8gZEcIZHv9SD DgMeW79FUJp3sGOhrQhl9pTp0FK+VD40SwjjBHArfZb0Ka2AVCp3vbm57SIeQC8476 R70tH4aTi1OZfMqPBTvioseq830oZFGAQCnw0TCv70te/LXp5yUH5leeHZ4m6PhMzZ w0ALoSgZ0VyIYf0lwaPuWDStazCO4F3oKGzlTvtm5Vfp130EdtCq2rp7BVwbuM2Jb2 dl8MLLvsJ6Aaw== From: Benjamin Gaignard <benjamin.gaignard@collabora.com> To: ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, daniel.almeida@collabora.com, nicolas.dufresne@collabora.co.uk Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Benjamin Gaignard <benjamin.gaignard@collabora.com> Subject: [PATCH v2 07/13] media: verisilicon: Check AV1 bitstreams bit depth Date: Tue, 3 Jan 2023 18:00:52 +0100 Message-Id: <20230103170058.810597-8-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230103170058.810597-1-benjamin.gaignard@collabora.com> References: <20230103170058.810597-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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754021829970354164?= X-GMAIL-MSGID: =?utf-8?q?1754021829970354164?= |
Series |
AV1 stateless decoder for RK3588
|
|
Commit Message
Benjamin Gaignard
Jan. 3, 2023, 5 p.m. UTC
The driver supports 8 and 10 bits bitstreams, make sure to discard
other cases.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
drivers/media/platform/verisilicon/hantro_drv.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
Comments
Hi Benjamin, I love your patch! Yet something to improve: [auto build test ERROR on media-tree/master] [also build test ERROR on rockchip/for-next linus/master v6.2-rc2 next-20221226] [cannot apply to pza/reset/next pza/imx-drm/next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Benjamin-Gaignard/dt-bindings-media-rockchip-vpu-Add-rk3588-vpu-compatible/20230104-010906 base: git://linuxtv.org/media_tree.git master patch link: https://lore.kernel.org/r/20230103170058.810597-8-benjamin.gaignard%40collabora.com patch subject: [PATCH v2 07/13] media: verisilicon: Check AV1 bitstreams bit depth config: riscv-randconfig-r006-20230103 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 7a8cb6cd4e3ff8aaadebff2b9d3ee9e2a326d444) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install riscv cross compiling tool for clang build # apt-get install binutils-riscv-linux-gnu # https://github.com/intel-lab-lkp/linux/commit/e7673f182caea24871db793ac95b666468cf58bb git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Benjamin-Gaignard/dt-bindings-media-rockchip-vpu-Add-rk3588-vpu-compatible/20230104-010906 git checkout e7673f182caea24871db793ac95b666468cf58bb # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/media/platform/verisilicon/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/media/platform/verisilicon/hantro_drv.c:342:3: error: expected expression int bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; ^ >> drivers/media/platform/verisilicon/hantro_drv.c:345:26: error: use of undeclared identifier 'bit_depth' if (ctx->bit_depth != bit_depth) ^ drivers/media/platform/verisilicon/hantro_drv.c:348:20: error: use of undeclared identifier 'bit_depth' ctx->bit_depth = bit_depth; ^ drivers/media/platform/verisilicon/hantro_drv.c:1039:46: warning: implicit conversion from 'unsigned long long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion] vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~ include/linux/dma-mapping.h:76:40: note: expanded from macro 'DMA_BIT_MASK' #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) ^~~~~ 1 warning and 3 errors generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE Depends on [n]: IOMMU_SUPPORT [=y] && (ARM || ARM64 || COMPILE_TEST [=y] && !GENERIC_ATOMIC64 [=y]) Selected by [y]: - IPMMU_VMSA [=y] && IOMMU_SUPPORT [=y] && (ARCH_RENESAS [=y] || COMPILE_TEST [=y] && !GENERIC_ATOMIC64 [=y]) vim +342 drivers/media/platform/verisilicon/hantro_drv.c 332 333 static int hantro_av1_s_ctrl(struct v4l2_ctrl *ctrl) 334 { 335 struct hantro_ctx *ctx; 336 337 ctx = container_of(ctrl->handler, 338 struct hantro_ctx, ctrl_handler); 339 340 switch (ctrl->id) { 341 case V4L2_CID_STATELESS_AV1_SEQUENCE: > 342 int bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; 343 344 if (vb2_is_streaming(v4l2_m2m_get_src_vq(ctx->fh.m2m_ctx))) > 345 if (ctx->bit_depth != bit_depth) 346 return -EINVAL; 347 348 ctx->bit_depth = bit_depth; 349 break; 350 default: 351 return -EINVAL; 352 } 353 354 return 0; 355 } 356
Hi Benjamin, Thanks for the patch. On Tue, Jan 3, 2023 at 2:01 PM Benjamin Gaignard <benjamin.gaignard@collabora.com> wrote: > > The driver supports 8 and 10 bits bitstreams, make sure to discard > other cases. > > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> > --- > drivers/media/platform/verisilicon/hantro_drv.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c > index 8e93710dcfed..16539e89935c 100644 > --- a/drivers/media/platform/verisilicon/hantro_drv.c > +++ b/drivers/media/platform/verisilicon/hantro_drv.c > @@ -282,7 +282,13 @@ static int hantro_try_ctrl(struct v4l2_ctrl *ctrl) > /* We only support profile 0 */ > if (dec_params->profile != 0) > return -EINVAL; > + } else if (ctrl->id == V4L2_CID_STATELESS_AV1_SEQUENCE) { > + const struct v4l2_ctrl_av1_sequence *sequence = ctrl->p_new.p_av1_sequence; > + > + if (sequence->bit_depth != 8 && sequence->bit_depth != 10) > + return -EINVAL; > } > + > return 0; > } > > @@ -333,7 +339,13 @@ static int hantro_av1_s_ctrl(struct v4l2_ctrl *ctrl) > > switch (ctrl->id) { > case V4L2_CID_STATELESS_AV1_SEQUENCE: > - ctx->bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; > + int bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; > + > + if (vb2_is_streaming(v4l2_m2m_get_src_vq(ctx->fh.m2m_ctx))) > + if (ctx->bit_depth != bit_depth) > + return -EINVAL; > + Please use the v4l2_ctrl_grab API. Can you send a separate series to address this for the other codecs? Thanks a lot! Ezequiel > + ctx->bit_depth = bit_depth; > break; > default: > return -EINVAL; > -- > 2.34.1 >
Le 04/01/2023 à 20:33, Ezequiel Garcia a écrit : > Hi Benjamin, > > Thanks for the patch. > > On Tue, Jan 3, 2023 at 2:01 PM Benjamin Gaignard > <benjamin.gaignard@collabora.com> wrote: >> The driver supports 8 and 10 bits bitstreams, make sure to discard >> other cases. >> >> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> >> --- >> drivers/media/platform/verisilicon/hantro_drv.c | 14 +++++++++++++- >> 1 file changed, 13 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c >> index 8e93710dcfed..16539e89935c 100644 >> --- a/drivers/media/platform/verisilicon/hantro_drv.c >> +++ b/drivers/media/platform/verisilicon/hantro_drv.c >> @@ -282,7 +282,13 @@ static int hantro_try_ctrl(struct v4l2_ctrl *ctrl) >> /* We only support profile 0 */ >> if (dec_params->profile != 0) >> return -EINVAL; >> + } else if (ctrl->id == V4L2_CID_STATELESS_AV1_SEQUENCE) { >> + const struct v4l2_ctrl_av1_sequence *sequence = ctrl->p_new.p_av1_sequence; >> + >> + if (sequence->bit_depth != 8 && sequence->bit_depth != 10) >> + return -EINVAL; >> } >> + >> return 0; >> } >> >> @@ -333,7 +339,13 @@ static int hantro_av1_s_ctrl(struct v4l2_ctrl *ctrl) >> >> switch (ctrl->id) { >> case V4L2_CID_STATELESS_AV1_SEQUENCE: >> - ctx->bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; >> + int bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; >> + >> + if (vb2_is_streaming(v4l2_m2m_get_src_vq(ctx->fh.m2m_ctx))) >> + if (ctx->bit_depth != bit_depth) >> + return -EINVAL; >> + > Please use the v4l2_ctrl_grab API. Can you send a separate series to address > this for the other codecs? I have tried to use v4l2_ctrl_grab API but when you grab a control you can set it anymore and V4L2_CID_STATELESS_AV1_SEQUENCE is send for each frame so it blocks everything. Benjamin > > Thanks a lot! > Ezequiel > >> + ctx->bit_depth = bit_depth; >> break; >> default: >> return -EINVAL; >> -- >> 2.34.1 >>
diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 8e93710dcfed..16539e89935c 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -282,7 +282,13 @@ static int hantro_try_ctrl(struct v4l2_ctrl *ctrl) /* We only support profile 0 */ if (dec_params->profile != 0) return -EINVAL; + } else if (ctrl->id == V4L2_CID_STATELESS_AV1_SEQUENCE) { + const struct v4l2_ctrl_av1_sequence *sequence = ctrl->p_new.p_av1_sequence; + + if (sequence->bit_depth != 8 && sequence->bit_depth != 10) + return -EINVAL; } + return 0; } @@ -333,7 +339,13 @@ static int hantro_av1_s_ctrl(struct v4l2_ctrl *ctrl) switch (ctrl->id) { case V4L2_CID_STATELESS_AV1_SEQUENCE: - ctx->bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; + int bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; + + if (vb2_is_streaming(v4l2_m2m_get_src_vq(ctx->fh.m2m_ctx))) + if (ctx->bit_depth != bit_depth) + return -EINVAL; + + ctx->bit_depth = bit_depth; break; default: return -EINVAL;