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: 650738 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8E02C636CC for ; Fri, 3 Feb 2023 09:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232749AbjBCJRU (ORCPT ); Fri, 3 Feb 2023 04:17:20 -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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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(-)