From patchwork Mon Dec 19 15:56:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 34635 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2469122wrn; Mon, 19 Dec 2022 08:00:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4j6vM5j8uUzaqz7+EN7ns5xYNZt9cTgJs8xbjMdZoXi6aRAmJwGMmo8ex50izMtuNRY/7E X-Received: by 2002:a05:6a20:cc60:b0:af:5125:bcdd with SMTP id hq32-20020a056a20cc6000b000af5125bcddmr20956100pzb.55.1671465607798; Mon, 19 Dec 2022 08:00:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671465607; cv=none; d=google.com; s=arc-20160816; b=nvfvgz/epDqj+Bb52DZj/1N9AutTqy6Sr8Su5poNvSpK0rr/9LSOeYE7XU7ASThwSP PbKX3QuLhaUMKskO9koN/9E32ovmI+tce9vWdfiIKkkoTNONyZudnDuEHy+J1tdxyLA4 ovN+R7N9G27soGWG0fkakZg+zE4yCJN1Ra2rgJxztnvKE9hxzKNRc8fajSDgJxP3dD40 do16ojxU0v4lstbLKfrx/1i/NPzGYpeVce0NQwzZcOh1Lo5Jizwjbnp7YYo5HNmSsmX3 QKF0mFCUtge42LKdn8xd23KAVd08X0mSFi24IOAX1+1E9Hhpq/SvxTsl81QtIC2fA34L SwYA== 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=FSwn9xKcE6F9KygvhG6migDlbDj8fR3UeKI1n5p+6+4=; b=O6y4asFZ05fg7Nk5rxvHVb8EMJ+aWNd+FfGDCbrcuVBeYN6bmx4fLMV+h/oEEoa3Z+ TX0MVbJWpT3cvMMhHKBn12UaQSZuh2HdOwgshMCuDH9+Pr3N/Z3feE12GUa8PZhcVfDx oao166HfcDiiz3zJiG9bo337+X0s0Xwdf09QTXTjKL7cUODGVThsVnP6a86+/xk52QkI ybHgva39U9w1MmkD+Ftuy8jBIcY6qr0hl+Z/Q56GVxR+ViCLtwK/MOFY+dq3Nbxn6Mwz qeSKhB5Etuv4xW0GaWa1zWHzyEp2VYUZIjDech5kP51KNdL+QdlYqa3ATSmG6D1BDHEX KEfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ERhshhQa; 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 i32-20020a632220000000b0047920de4969si11136371pgi.354.2022.12.19.07.59.55; Mon, 19 Dec 2022 08:00:07 -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=ERhshhQa; 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 S232349AbiLSP4n (ORCPT + 99 others); Mon, 19 Dec 2022 10:56:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232012AbiLSP42 (ORCPT ); Mon, 19 Dec 2022 10:56:28 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC4BE656A; Mon, 19 Dec 2022 07:56:27 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:f69c:5603:d4ce:7aa2]) (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 855BC6602C9B; Mon, 19 Dec 2022 15:56:25 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1671465385; bh=clrb85uBLZrtq/eiKowGtGKaTSUfChoOlR8wUbgxMps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ERhshhQa3OMjKETsx63bhrPVufqu1a3ezfVAAB8P6RuiUzaxA8pn03ZeycG5zrbae aA/oBkgg59k52dHVxUPbY2+YMHJXbK+chjaHiFdwXcs5q3/yzWowWzFp2Pt3lB1C4h qiH6hJ4JXgtbgH/CW81R3VLedEORdBC2perbghUSFF6gZvmBGgeYN1aF7/FyP17ItB q+boacas9RyIUOv3FlXt15AFLX1/Pf9cbB2if6Ki4jCVw97wVldmCCCTP19Z5+IEfW Jq7WNilJSP2NlSx32Nr7mpg+QzhQpVLatzDTHIckfGrhvm31+8zSyF7jI5fezTIJgF xIaqrF64LnLrQ== From: Benjamin Gaignard 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 Subject: [PATCH v1 4/9] media: verisilicon: Check AV1 bitstreams bit depth Date: Mon, 19 Dec 2022 16:56:11 +0100 Message-Id: <20221219155616.848690-5-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221219155616.848690-1-benjamin.gaignard@collabora.com> References: <20221219155616.848690-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752658721435428217?= X-GMAIL-MSGID: =?utf-8?q?1752658721435428217?= The driver supports 8 and 10 bits bitstreams, make sure to discard other cases. Signed-off-by: Benjamin Gaignard --- drivers/media/platform/verisilicon/hantro_drv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 8e93710dcfed..e10fc59634dd 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; }