From patchwork Wed May 3 08:34:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 89637 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1168690vqo; Wed, 3 May 2023 01:41:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hPQcp6msJbkvj/6UINM0IdnOjq+jpsIxSeGqRt+prGC/25oNbXf2HnPD8jc+1BAgTNlAR X-Received: by 2002:a05:6a00:1884:b0:63b:8a38:b1bb with SMTP id x4-20020a056a00188400b0063b8a38b1bbmr29636347pfh.7.1683103297671; Wed, 03 May 2023 01:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683103297; cv=none; d=google.com; s=arc-20160816; b=lho2CalCsxGZgMGcBjHXGTyh3kyhFMxl+fwJAarRMZkwC1jSAQbOMNpjp2U5UADAk6 m/nWooA62o4Mzvx8/kzlWzMOkvs5pf1RkCxLbqN7lWTWHHQSMZPdY0O3hZKBh8daEJiM osUJMxtAvFDq2mSC4ARHaE61b+XynE5xQE4B37TAq9p/osQ+4tAZSMUKwIfzhyNjKP8w F+K/vyOINjv2nY5lr0GbkqxXS4OCxgmGhKPHQ9wVc5YqZLICK2gBDJv2fkWtm2roRbTE x3NtxO/G69p4Jlb1covz0fSaDzc1C16xKfUZXZUtsKqhGJNnarszvDx51plkkJrRa1qv d5pg== 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=nz5arEfJISEWHk4NHqkDbD3RXOBcw+qS9kkAtHwdUpo=; b=phW7GEv1TqhUzotpkpO8mHVkjnfcWUwYVX2fr6dc+UnzsJ9v58Icgzk6eMoh+QXK3O WKJBqwlKbTDR5Y5rcuUuJDNUBjIUdCQqJHrVtj4ZeaRHw1vw7TgwBzlYCqw/F/mK9H9k AM0Bj6VxoswQ8nqI1u0SKN0gcClzAm6orZ5NoWfN4rSc0NC7M2Hp7+hXcMwDw7Wp10YE V5TKsEaDZ+jUlymjKcdMvrtnAIidjlhYYBawGVT6BgISMTg6URqJGgGtK5/+UcTfYbyS //BptT4yvgLp8hRudM6hRlvPSxOg9/JGZfCI/W1xudHbhaIM/RbGdPONEsptKNVZ74Zg 9MNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=A10mlTZS; 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=QUARANTINE sp=QUARANTINE 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 h64-20020a625343000000b0063b356e36fesi33468898pfb.372.2023.05.03.01.41.25; Wed, 03 May 2023 01:41:37 -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=A10mlTZS; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbjECIfB (ORCPT + 99 others); Wed, 3 May 2023 04:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbjECIeu (ORCPT ); Wed, 3 May 2023 04:34:50 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DC804C1F; Wed, 3 May 2023 01:34:48 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:8234:977e:ebbe:d70b]) (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 ABDE066032BE; Wed, 3 May 2023 09:34:46 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1683102887; bh=7bTQ885Lf7fJe0LhySXOychmfiOBST4o2pY/rZ1W8Qk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A10mlTZSkoBmsfXfHU18G7LtrzrlpOxks689r7i7jeogOC8y+SKYFcIhd7UcYGCm6 eumixvdasq+TWz7cs9a63TsEiVcbocwOx10cZUQWPN/MQjGTlKln4ZGPSpf/E+Koxe cEwMQd7ME/b5fCc5e+/slGvhCoMcF6Q8/7gQqgKPw75mua/dTiV/T8Gc6bGag5r3Do yKNOEbAboVWHie2pHoPnGNqW0DtODZc6KulQzqvy5Z20dd/gCpthlAECPCi+8nJIFc YLt3iO+jOPUUzUWpjrvzbF+QIovZFz+Lv8DA4Q54oMmyMTRy1BbMPhNYBKb86rgPfd NhrkOjV1HsRjg== 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, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com 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 v7 02/13] media: AV1: Make sure that bit depth in correctly initialize Date: Wed, 3 May 2023 10:34:27 +0200 Message-Id: <20230503083438.85139-3-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503083438.85139-1-benjamin.gaignard@collabora.com> References: <20230503083438.85139-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, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764861723386926004?= X-GMAIL-MSGID: =?utf-8?q?1764861723386926004?= Make sure that bit_depth field of V4L2_CTRL_TYPE_AV1_SEQUENCE is initialized correctly before using it. Signed-off-by: Benjamin Gaignard Reviewed-by: Nicolas Dufresne --- drivers/media/v4l2-core/v4l2-ctrls-core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c index 9fd37e94db17..a662fb60f73f 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-core.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c @@ -111,6 +111,7 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx, struct v4l2_ctrl_vp9_frame *p_vp9_frame; struct v4l2_ctrl_fwht_params *p_fwht_params; struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix; + struct v4l2_ctrl_av1_sequence *p_av1_sequence; void *p = ptr.p + idx * ctrl->elem_size; if (ctrl->p_def.p_const) @@ -157,6 +158,10 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx, p_vp9_frame->flags |= V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING | V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING; break; + case V4L2_CTRL_TYPE_AV1_SEQUENCE: + p_av1_sequence = p; + p_av1_sequence->bit_depth = 8; + break; case V4L2_CTRL_TYPE_FWHT_PARAMS: p_fwht_params = p; p_fwht_params->version = V4L2_FWHT_VERSION;