Message ID | 20230111165931.753763-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 p1csp3431605wrt; Wed, 11 Jan 2023 09:01:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXv0G6aM7utyZE1vsN0U0ASKPjXUA3O4jrr3wWqiDxrHE+JjVJ0Xk7xtrIcCjVwymznop8aK X-Received: by 2002:a17:906:5a71:b0:84d:4a2b:73b9 with SMTP id my49-20020a1709065a7100b0084d4a2b73b9mr8853350ejc.59.1673456517357; Wed, 11 Jan 2023 09:01:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673456517; cv=none; d=google.com; s=arc-20160816; b=S0LYG9hqnJXqosenUjUxQyVNFcoNIpjpn28oDB+sTWDhmQ8GEIXcwJmz+qeh2BvjGP xtTk78zRrgsrq8kfdplthreuCAp6fUiPfoZeMXgjdUehafgsW4rLRnyqX3otfC9eF5hC IO9BgQjs3ISKjwTq60sLP8jzDx2Y3FXEV0+mP2cD/L0bJdHQK5iOJogXvaoMvNit7WRl p1jNMi8jrPkwDivOQrqq3ljqd2+10+fx/im616aoXWq2+B75tgAozm1K53PQWYQaTj5F 4Ex7Wi8rM5UdsMsJpThSTW+p2snu6ap6zjOGu7JisgtDYPQSr6WZClqSjMw/3COjRgZe Tvwg== 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=yog3jjMR2PSz2Vho0v3IG+xXysd+17+ERZ4aWeUdcDK+r6Mc97LJ3mxpXHEuV8zBCb JzAWsKclLsqI7glyZfeO4LlClupknWMf7vRXP5VddIbUdhed2CXBhq9esOEcvkg3WUOP VLj0h2FDfbFExofD0SkJV3hQbuqaX5ZegyVvgNTN59zkOfQndMHtDjeaEcvoZe/lUZSS GDfi4y3TkXvqMJ+33dRQzalG9FMFs9du4l2UAplLHiBL3n7d5phKV9UZ2scanhx+11Xj peF2au+Ur5Svp32Eo0abgmdwogAuKolJQmV4ffvpJRnVp+uZXuuE6YiAeRHtxEgvOqqJ 2Tzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=WUupMmD0; 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 wt2-20020a170906ee8200b0084d3a7b6a04si11768566ejb.576.2023.01.11.09.01.30; Wed, 11 Jan 2023 09:01:57 -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=WUupMmD0; 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 S239328AbjAKRAQ (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Wed, 11 Jan 2023 12:00:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238088AbjAKQ7p (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Jan 2023 11:59:45 -0500 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 5BA66164AC; Wed, 11 Jan 2023 08:59:44 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:1ee3:efce:e4f6:17a3]) (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 C1CE26602DB0; Wed, 11 Jan 2023 16:59:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1673456383; bh=hK5ho7sqz6YdWfEyVAdpQFOjW5xXjqXVPgQmWV4hD5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WUupMmD0USWPH8l4dwOOX27F/rCX3XPLArZxjvDlfPRP1OI7ybEfsoYIG3C7EVHPY DT/K2DMFq7X7rTaBGtXWSK8iuYNliiIlHpFYJAEaulYUvbvMtV1a7m0FvXHkv0BSBr zDXyCz15qYIKx7Jj9tBb/+wihcn2JPCDiFK9pmVJfuwB2X7fkrn8BP5QdiM/xi0vbj tKbu3LJU12GMxjBD1UfbQ4ivmfjP6meb1wX6citVIKeTY5CE5fQSUnLFv/aq2V6mHv mJxBb9/9ItympTVX0Ir8BnIzwiPo70liB61ZWyeUkyBQ7mhzpXzRoEsC18NXJsVazV wIbGnUXwNEtBQ== 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 v3 07/13] media: verisilicon: Check AV1 bitstreams bit depth Date: Wed, 11 Jan 2023 17:59:25 +0100 Message-Id: <20230111165931.753763-8-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230111165931.753763-1-benjamin.gaignard@collabora.com> References: <20230111165931.753763-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?1754746341091771849?= X-GMAIL-MSGID: =?utf-8?q?1754746341091771849?= |
Series |
AV1 stateless decoder for RK3588
|
|
Commit Message
Benjamin Gaignard
Jan. 11, 2023, 4:59 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-rc3 next-20230112] [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/20230112-010155 base: git://linuxtv.org/media_tree.git master patch link: https://lore.kernel.org/r/20230111165931.753763-8-benjamin.gaignard%40collabora.com patch subject: [PATCH v3 07/13] media: verisilicon: Check AV1 bitstreams bit depth config: hexagon-randconfig-r011-20230110 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 8d9828ef5aa9688500657d36cd2aefbe12bbd162) 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 # https://github.com/intel-lab-lkp/linux/commit/64e086ae4e3c168e190fc87fcd19ca73346fee2e 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/20230112-010155 git checkout 64e086ae4e3c168e190fc87fcd19ca73346fee2e # 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=hexagon olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon 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 error/warnings (new ones prefixed by >>): In file included from drivers/media/platform/verisilicon/hantro_drv.c:23: In file included from include/media/v4l2-mem2mem.h:16: In file included from include/media/videobuf2-v4l2.h:16: In file included from include/media/videobuf2-core.h:18: In file included from include/linux/dma-buf.h:16: In file included from include/linux/iosys-map.h:10: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from drivers/media/platform/verisilicon/hantro_drv.c:23: In file included from include/media/v4l2-mem2mem.h:16: In file included from include/media/videobuf2-v4l2.h:16: In file included from include/media/videobuf2-core.h:18: In file included from include/linux/dma-buf.h:16: In file included from include/linux/iosys-map.h:10: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from drivers/media/platform/verisilicon/hantro_drv.c:23: In file included from include/media/v4l2-mem2mem.h:16: In file included from include/media/videobuf2-v4l2.h:16: In file included from include/media/videobuf2-core.h:18: In file included from include/linux/dma-buf.h:16: In file included from include/linux/iosys-map.h:10: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ >> 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)) ^~~~~ 7 warnings and 3 errors generated. 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
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;