From patchwork Fri Feb 3 09:16:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 4926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp731514wrn; Fri, 3 Feb 2023 01:24:20 -0800 (PST) X-Google-Smtp-Source: AK7set8i2HTFDl45w4oDPNaFk+heTVUeOfSOOKMf89NR7y4GWjnzwMI8lgkQo9yNytMUCEZHKogc X-Received: by 2002:a50:c382:0:b0:49d:34ae:c7aa with SMTP id h2-20020a50c382000000b0049d34aec7aamr8233291edf.29.1675416260441; Fri, 03 Feb 2023 01:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675416260; cv=none; d=google.com; s=arc-20160816; b=XOdsHICXkaZZ7C/2s7rgp/C+qZmhQtUErI3wK90RcJruf81EAKjZKwEivme0UkTZzv nQbainSYAQ6WvJ/8hDJUnmHTZottbZPgh1UZKW7MY+TsVvWcBEGBjRF2JPisXF9mEfC2 kcgbNLUTlLVRZ/P6Wxq7tD62WqwKtPWAGx3XO+qJN1EfjHzPLpbsjPGFXDmEkJF71Lec 8x+KrxE2TKzuV/mzA/F+LIz1yeNgIIlLDe2gZi4cLqO0yryaYPwcXWzBwgp1zR3jRzRn hwICVRwmvsJYByW7HxsNIz6CddcA6H5akX36sinRkaERAz22U84IelnuKeKp/Y1G0QK+ 6dWA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=UzZYir6hfV7VuUQa7EHW5uXvUJ+N4zPtIRNp1bflJZ8=; b=KsIWT34A4Qmnv237V3OhjeMrNF2OuPFBY49WI6NrZLdCUSrEf3VmwUkTBhFySL1Dwu Bidsq4IiLiEpXQ7Uqu27H+h0nr+LmTv7rw28rusQUtvdTKreqntjD2iTxqKLT1qLzBcg GOe7VVLnvZr+8XliCJ1RUGaFH+zNd2zAR31TbgX0X5d2doWYSqA//WWrah95ULxgbRn9 FLa97U1aJYGm1z6JPJsd9MT1qClfVxw9TY3TX1cHYuD+xbZzlSaUf8fwJKKTTlTUgwx4 2G7BVZHg0YDpQ2kiAurRUYAInZVMOrg/DFfdUYWx2gyU40MMIxO7z0WJm3nFqSavZTxs Nucw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ofiYwoR7; 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=REJECT sp=REJECT 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 x17-20020aa7dad1000000b004a25cf9951dsi1876638eds.554.2023.02.03.01.23.56; Fri, 03 Feb 2023 01:24:20 -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=ofiYwoR7; 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=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232757AbjBCJRV (ORCPT + 99 others); Fri, 3 Feb 2023 04:17:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232645AbjBCJQ4 (ORCPT ); Fri, 3 Feb 2023 04:16:56 -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 A8F5992EDF; Fri, 3 Feb 2023 01:16:36 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:d413:5f9c:fc3a:208d]) (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 C4DE56602F05; Fri, 3 Feb 2023 09:16:34 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1675415795; bh=70T3rbgAAMoLX4kBMmbGMTvfjgN+XQOZtyjf09bNSQg=; h=From:To:Cc:Subject:Date:From; b=ofiYwoR7njdAKceVw0QEINOh71BASDNuuKRHDasRjjoZ8MeSFxlfAt/q2kRhXRSyx 8ctwAyrUFXH7cVQRI17sht8AVCW1wjMW4WcYweLxqm+cWxZnVfPTT0avMkSpVV17UI abFy+JV1C0qU0NMnrlz4VIg+XePD+hqNylgaX5sjACtAdeYKoXTXsUKhJ2EPsFkhB/ c9oNGEYdXIPPBGO6jzAC6jcdJvSYpZ2tWPqIoV2UGlj6so6KlUKDUMojhn3DqWwcS3 nXCza5KSp5pHph997ypFG1/HYxz4wsQY4/Azh7tFTFXWyE/0O29wbqNmkERNdfRiTl 75v9qXL19nvYg== From: Benjamin Gaignard To: ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, mchehab@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.co.uk Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v8 0/6] media: verisilicon: HEVC: fix 10bits handling Date: Fri, 3 Feb 2023 10:16:16 +0100 Message-Id: <20230203091622.127279-1-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 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?1756801280631164172?= X-GMAIL-MSGID: =?utf-8?q?1756801280631164172?= When decoding a 10bits bitstreams HEVC driver should only expose 10bits pixel formats. To fulfill this requirement it is needed to call hantro_reset_raw_fmt() and to only change driver internal state in case of success. Fluster score for HEVC (140/147) doesn't change after this series. Fluster score for VP9 is 146/303. version 8: - Correct patch 4. - Add a patch for VP9. version 7: - Remove unused ctx variable in hantro_try_ctrl(). - Change HANTRO_DEFAULT_BIT_DEPTH value to 8. - Simplify hantro_check_depth_match logic. - Keep ctx->bit_depth as integer value because it is use to compute buffers size for hevc. version 6: - Split the patches in multiple sub-patches. - Rework hantro_reset_encoded_fmt() usage. version 5: - Add Nicolas's review tags - Add Fixes tags version 4: - Split the change in 2 patches. - Change hantro_check_depth_match() prototype to avoid using ctx->bit_depth - Return the result of hantro_reset_raw_fmt() to the caller. - Only set ctx->bit_depth when hantro_reset_raw_fmt() returns is ok. Benjamin Gaignard (6): media: verisilicon: Do not set context src/dst formats in reset functions media: verisilicon: Do not use ctx fields as format storage when resetting media: verisilicon: Do not set ctx->bit_depth in hantro_try_ctrl() media: verisilicon: Do not change context bit depth before validating the format media: verisilicon: HEVC: Only propose 10 bits compatible pixels formats media: verisilicon: VP9: Only propose 10 bits compatible pixels formats .../media/platform/verisilicon/hantro_drv.c | 49 +++++++--- .../platform/verisilicon/hantro_postproc.c | 2 +- .../media/platform/verisilicon/hantro_v4l2.c | 90 +++++++++---------- .../media/platform/verisilicon/hantro_v4l2.h | 3 +- .../media/platform/verisilicon/imx8m_vpu_hw.c | 2 + 5 files changed, 86 insertions(+), 60 deletions(-)