From patchwork Fri Jun 17 11:57:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 12885611 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AC46C433EF for ; Fri, 17 Jun 2022 11:59:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BBIqWK7sblp3oAbagsxHMkC9iY7TmUN888INKqJkfOk=; b=JM6mzM1IFJuUZ+ TfTaD3pPnpRmkuTbuL4uMuRQTabOgRKUpmryuTj5szqRzc8DbX5t0eCupxEZjYi+i1uX9x/dkPpuk lL0RWnAHa5pY+TYuIvEWQ2mm96AuP8vLm5pLyq2JpuGdvJzU8b7L/WIIEZgDp9IRtrR4389Se7aS6 RBUniSLZlJdl21n2A69S8rLMd2vo+b2FEYICIDraqFPiJDljlt9ztgEed8w8czdPx3xr3KOK9GeJo EFDfD/9e5w8AkMw9ecZIijjybv2fkNX3PuKtJ2wCgmwTjLNDeXVr2CnirorUs3mq9uMdNulfAFoEW Sahfyg5bKD8JbW3omfig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2Ad1-007VCR-T4; Fri, 17 Jun 2022 11:59:07 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcA-007Uq2-RU; Fri, 17 Jun 2022 11:58:17 +0000 Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:faf2:1a12:f903:cc5e]) (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 0F50A660179B; Fri, 17 Jun 2022 12:58:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655467091; bh=p1IL0WApAId0OF2roNkCC1LN0QMRN6h/Fzya6tDqTJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O6latk3LWVF1Zw3HOlI6NzxIuXB815MakCNbc3pJmtgKdofzf6w08jd57TXK/Eh50 s9WBWe/hiDYqdPXNM8UQanOMXEkmE3GELVblXCsSRAIIpjUdiQy+FTtlAYxReVpQQr cMFITh4k19Q0S0AIv5FKNuU+YT9AtQzfeV43nsIm+QoOqnZ4ctJ6NnXpWygkBaomOH MsgIL7ELBB0sbMdm9/UtCkIPeJMm6yMv4ZYJjOB7A8IvWiGDrenDxyjeiiqdtR3fJD 365J04MD9DgFqFKYXBV/p1g1lvqsBC+6yB4FyFC877kowvJ/hAT4b5LYN00pmv+fQ2 UC2aJjRGXK+Bw== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH 1/7] media: hantro: Store HEVC bit depth in context Date: Fri, 17 Jun 2022 13:57:56 +0200 Message-Id: <20220617115802.396442-2-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220617115802.396442-1-benjamin.gaignard@collabora.com> References: <20220617115802.396442-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_045815_205893_26CE3EC9 X-CRM114-Status: UNSURE ( 7.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Store HEVC bit depth in context. Bit depth is equal to hevc sps bit_depth_luma_minus8 + 8. Signed-off-by: Benjamin Gaignard --- drivers/staging/media/hantro/hantro_hevc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/hantro/hantro_hevc.c b/drivers/staging/media/hantro/hantro_hevc.c index 5984c5fa6f83..dcb5c8703b6e 100644 --- a/drivers/staging/media/hantro/hantro_hevc.c +++ b/drivers/staging/media/hantro/hantro_hevc.c @@ -163,6 +163,8 @@ int hantro_hevc_validate_sps(struct hantro_ctx *ctx, const struct v4l2_ctrl_hevc /* Only 8-bit is supported */ return -EINVAL; + ctx->bit_depth = sps->bit_depth_luma_minus8 + 8; + /* * for tile pixel format check if the width and height match * hardware constraints From patchwork Fri Jun 17 11:57:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 12885687 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59CEEC43334 for ; Fri, 17 Jun 2022 13:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0LTLvGv9fvn+pILp3O4ZUuEB3O76lnrkSSpEDlWmaCA=; b=PAFI3pacx8rrp+ BMjLEAOKcSEoCawQ4g0qPr6VIDtDp92zcpms4l9HN6a6EFHa2vq/NtkkprY8+7KOxroZ5W+47U90s MwvrHDd5xjDJPnP2zVIO4Ee0VNU5axtyWqXvXlvLU6+u4ad81kqn0HvoeA+Lf9wp0vzGbRckpSht6 Uggy/FoEwy/b0qeL1PbW4LeD7nPMPWOJA3PmR5RI+Mckv5nfGl8Tn2mn06OBPeYBh7pNaaPHFu8uE GDqMuyarEFHkFhZJg7rHhbwOIFyHco//UDrXXLBiX1zxDRrGWoql1yijMBwPz2LMhfCqCObEyQAPr ZvtV+Vugu05xiR+UIrpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2Bb1-007kTq-D5; Fri, 17 Jun 2022 13:01:07 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcA-007Uq3-RV; Fri, 17 Jun 2022 11:58:16 +0000 Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:faf2:1a12:f903:cc5e]) (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 CE19366017A2; Fri, 17 Jun 2022 12:58:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655467092; bh=NZho7CBZaKZuUJgc719whph3yEflX+mhA9knrYhlB3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pemv87GwPsnRgtBW/7fIx58OmOU+RRPFdJQeHHpbU5g5znfxtRAAt6U6xd/dOHSnV qSP2kBoh2Qeb3uP9/hsw4djXlV8ghfPizEcs189ZU0Cyi+yb+CHxbnS8qnPcpurFC/ fmQD1aeyMyTVZjtBe3AK0yeprgPHdzMFDzvKxzRI35dppbz3fLcKrd+mZmZmIdcqad UDB6dlWx9PRUcjzNOpv83Ebbw7/bCtzRzd0dfBMEGJU/ES6LvVJUOXO6CbQALRDzze L6f1KLnuAwTUWVhkIpAIw0PKi7hZdp+7u6S4IJZl+OjQQ/XRXISIfmcAuhoKO1rFA3 Rh2Tu4IX6GT+A== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH 2/7] media: hantro: HEVC: Fix auxilary buffer size calculation Date: Fri, 17 Jun 2022 13:57:57 +0200 Message-Id: <20220617115802.396442-3-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220617115802.396442-1-benjamin.gaignard@collabora.com> References: <20220617115802.396442-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_045815_186023_C85629B6 X-CRM114-Status: UNSURE ( 9.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org SAO and FILTER buffers size depend of the bit depth. Make sure we have enough space for 10bit bitstreams. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia --- drivers/staging/media/hantro/hantro_hevc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/hantro/hantro_hevc.c b/drivers/staging/media/hantro/hantro_hevc.c index dcb5c8703b6e..e06837108a09 100644 --- a/drivers/staging/media/hantro/hantro_hevc.c +++ b/drivers/staging/media/hantro/hantro_hevc.c @@ -104,7 +104,7 @@ static int tile_buffer_reallocate(struct hantro_ctx *ctx) hevc_dec->tile_bsd.cpu = NULL; } - size = VERT_FILTER_RAM_SIZE * height64 * (num_tile_cols - 1); + size = (VERT_FILTER_RAM_SIZE * height64 * (num_tile_cols - 1) * ctx->bit_depth) / 8; hevc_dec->tile_filter.cpu = dma_alloc_coherent(vpu->dev, size, &hevc_dec->tile_filter.dma, GFP_KERNEL); @@ -112,7 +112,7 @@ static int tile_buffer_reallocate(struct hantro_ctx *ctx) goto err_free_tile_buffers; hevc_dec->tile_filter.size = size; - size = VERT_SAO_RAM_SIZE * height64 * (num_tile_cols - 1); + size = (VERT_SAO_RAM_SIZE * height64 * (num_tile_cols - 1) * ctx->bit_depth) / 8; hevc_dec->tile_sao.cpu = dma_alloc_coherent(vpu->dev, size, &hevc_dec->tile_sao.dma, GFP_KERNEL); From patchwork Fri Jun 17 11:57:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 12885613 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B150CCA479 for ; Fri, 17 Jun 2022 11:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e5aqHHph7q2mBHn4+CFdEKAwQOWpL4inuMQFOLZN+IQ=; b=ehmO3LzdcRC9n0 +3+1ubxSYbUB5bmmKzpjFIeflEEEroNirzNQTU+Um4CBO7e1+MDQNHB3jG6dSVKydIyuzTDz5WzDc gylNWX0+tT0ZvLMyMJYVrWMlGLD+zJ+0lIYJQVfH6k4fBrcxcjyvXnbYsL6xLUeGZk15AmBvOG4ru iGX3ULJ3hjxb4w1suaJ5AIbBAIcxkJjCzBxeeDTz/EOe0R3gP9WNbN12wFszWsAfKdxvBgJxSgdq1 9kwj3VNRomNBaaIuwGD+smjD/vm+L82lvDUkZgXcBnFCo4DjGhYLC8DrHSaiVlR0EHp2kIE4Fixp7 RPmh7lAPiTHcVs7wplCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2Ad2-007VCh-D0; Fri, 17 Jun 2022 11:59:08 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcA-007UqA-RP; Fri, 17 Jun 2022 11:58:17 +0000 Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:faf2:1a12:f903:cc5e]) (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 7B38066017E6; Fri, 17 Jun 2022 12:58:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655467093; bh=UCYAWxfH7NqhDgW2LvrbsQwdBrhxn/zmxyr+y6/KCnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gpL482i9rVqH8nuvkKstUQRydbw9K6qvl1weUz0Qvvi2hCu3gWoKEXUp7ATR/OeH9 yqSt0AB0X2ZZLXxLULLJLZoJa1zuZ4Pwb/Y0L5WZaBRwL0LnXH6hdh9SHILYPKEOBc duFRTtLJsT40jracOgjtXRwUXVquPVD8K2TX7ASEQIRD7G8RxlXlepEW+xtSXgjs6K 5X0lzuqj8zPDiZh194vkfaZxEXjREDTA4KNHn/Ny/z3lzDmWhxjrgZsk85VP4NUDUT Sb+93VPYO2ksa/Vf33gMIOQZbyOc4t7kEDlpU9lqi3bWef8N0IQjNLFwgR5BCKwvmu TY6CNssUSUz7w== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH 3/7] media: hantro: HEVC: Fix chroma offset computation Date: Fri, 17 Jun 2022 13:57:58 +0200 Message-Id: <20220617115802.396442-4-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220617115802.396442-1-benjamin.gaignard@collabora.com> References: <20220617115802.396442-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_045815_182137_43AA971E X-CRM114-Status: UNSURE ( 9.04 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The chroma offset depends of the bitstream depth. Make sure that ctx->bit_depth is used to compute it. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia --- drivers/staging/media/hantro/hantro_g2_hevc_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/hantro/hantro_g2_hevc_dec.c b/drivers/staging/media/hantro/hantro_g2_hevc_dec.c index 9eac133bda68..8407ad45b7b7 100644 --- a/drivers/staging/media/hantro/hantro_g2_hevc_dec.c +++ b/drivers/staging/media/hantro/hantro_g2_hevc_dec.c @@ -12,7 +12,7 @@ static size_t hantro_hevc_chroma_offset(struct hantro_ctx *ctx) { - return ctx->dst_fmt.width * ctx->dst_fmt.height; + return ctx->dst_fmt.width * ctx->dst_fmt.height * ctx->bit_depth / 8; } static size_t hantro_hevc_motion_vectors_offset(struct hantro_ctx *ctx) From patchwork Fri Jun 17 11:57:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 12885612 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44369C43334 for ; Fri, 17 Jun 2022 11:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JjFwG8deAtKdGY85pDcgFZkNmD1XQqGY9DGybcxIi5Q=; b=o2LRUVOu56qFp2 asUggn5eN9d+urvlnGXVTWcg08GMckID6g+Kg/v/RDQDn9idiYyJ/z5/QK8zERrMRp3ITufol8MC0 Aj3ll/zZzW+oxsZ9EB+6OLlN79Dn7Y+cQVjaL6wpobxVSXSwCXj6yuqe5swSp5uN1kOTFNoIjTutS eFiI0JuVAV1qoqYiIGP//wzCJUpsFSbTgWH8f87svU+6hjeHGzxyIg+CFjrLElb6/JcT7p27gFAkR mXGzzmBZDb8a3B7B0XFRRR1V9oOsGYbuXDWPtixrNbT+3hL0aKqCe//fpRATsOkZw/4sXYLc5/tkD VsqaNEOvnvVCEAhxmP8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2Ad3-007VCy-30; Fri, 17 Jun 2022 11:59:09 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcA-007UqC-UX; Fri, 17 Jun 2022 11:58:18 +0000 Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:faf2:1a12:f903:cc5e]) (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 41CDA6601809; Fri, 17 Jun 2022 12:58:13 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655467093; bh=kUbZWcRNMzi2WPQGtQkKDBy7v+BVLv+T6REBwhFVdjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bn5lVlUZ05Irb3YPu9DZK8DCwGHAWJN5F/jMYFiHf4nZ7ywixtkYyn9UlbgWqpYcf RupN7jPpa20cfQhciZPGk8VAUKDDu49b/xeoWP9zPNV+WUszpA0inmUIHFAzCr1G4m uIvezZsos/DGe+4Q7Kwa87uyhe4cc3MzJk88Eig7j9LLlDO3nfR4uWOYWr2ShFMW+B tvirxAg+q8poypQs7AHuhAavBsESEfT5yEp9OMrc8UYAGse/QGP68dF+4aUPprEdfQ Mh7WVsX/1pdMsOb8M0NsfSs1QmStYpCh31E1b0UjyacBYU/3UW5uxBNiot+5imMaYJ OaMHD5SPk47Tg== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH 4/7] media: hantro: postproc: Configure output regs to support 10bit Date: Fri, 17 Jun 2022 13:57:59 +0200 Message-Id: <20220617115802.396442-5-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220617115802.396442-1-benjamin.gaignard@collabora.com> References: <20220617115802.396442-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_045815_213322_815B1FD6 X-CRM114-Status: GOOD ( 10.37 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Move output format setting in postproc and make sure that 8/10bit configuration is correctly set. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia --- drivers/staging/media/hantro/hantro_g2_hevc_dec.c | 2 -- drivers/staging/media/hantro/hantro_postproc.c | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/hantro/hantro_g2_hevc_dec.c b/drivers/staging/media/hantro/hantro_g2_hevc_dec.c index 8407ad45b7b7..c929f2974a01 100644 --- a/drivers/staging/media/hantro/hantro_g2_hevc_dec.c +++ b/drivers/staging/media/hantro/hantro_g2_hevc_dec.c @@ -167,8 +167,6 @@ static void set_params(struct hantro_ctx *ctx) hantro_reg_write(vpu, &g2_bit_depth_y_minus8, sps->bit_depth_luma_minus8); hantro_reg_write(vpu, &g2_bit_depth_c_minus8, sps->bit_depth_chroma_minus8); - hantro_reg_write(vpu, &g2_output_8_bits, 0); - hantro_reg_write(vpu, &g2_hdr_skip_length, compute_header_skip_lenght(ctx)); min_log2_cb_size = sps->log2_min_luma_coding_block_size_minus3 + 3; diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c index a0928c508434..09d8cf942689 100644 --- a/drivers/staging/media/hantro/hantro_postproc.c +++ b/drivers/staging/media/hantro/hantro_postproc.c @@ -114,6 +114,7 @@ static void hantro_postproc_g2_enable(struct hantro_ctx *ctx) struct hantro_dev *vpu = ctx->dev; struct vb2_v4l2_buffer *dst_buf; int down_scale = down_scale_factor(ctx); + int out_depth; size_t chroma_offset; dma_addr_t dst_dma; @@ -132,8 +133,9 @@ static void hantro_postproc_g2_enable(struct hantro_ctx *ctx) hantro_write_addr(vpu, G2_RS_OUT_LUMA_ADDR, dst_dma); hantro_write_addr(vpu, G2_RS_OUT_CHROMA_ADDR, dst_dma + chroma_offset); } + + out_depth = hantro_get_format_depth(ctx->dst_fmt.pixelformat); if (ctx->dev->variant->legacy_regs) { - int out_depth = hantro_get_format_depth(ctx->dst_fmt.pixelformat); u8 pp_shift = 0; if (out_depth > 8) @@ -141,6 +143,9 @@ static void hantro_postproc_g2_enable(struct hantro_ctx *ctx) hantro_reg_write(ctx->dev, &g2_rs_out_bit_depth, out_depth); hantro_reg_write(ctx->dev, &g2_pp_pix_shift, pp_shift); + } else { + hantro_reg_write(vpu, &g2_output_8_bits, out_depth > 8 ? 0 : 1); + hantro_reg_write(vpu, &g2_output_format, out_depth > 8 ? 1 : 0); } hantro_reg_write(vpu, &g2_out_rs_e, 1); } From patchwork Fri Jun 17 11:58:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 12885617 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50F93C43334 for ; Fri, 17 Jun 2022 12:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fwGAAGGdLHchDUugHEfS2ZCmiXHsp9Rsgx8BQ925No4=; b=lm/fwai2Uvu8+p kKoSuAjsbJ4JCwFakMz5QaEUjXNYhkpLfd7YZIOy8l9rFeQaTRZwZj22PSE4k44Dba0OnGzOvDD0C tKtney8EZ4EX6nvxF96kNaMY1zY6hpKhxGLC/036X4bf9DZWNagURBiw06Nt2Lsr12Cb/bRGJkOdl YiL14mRvNdtw0ffKAmQHV7d0jBla2BxNpYAEdWYdX4s73PXPc8w283g3DrK1txa9H9o9M94b7t8Pe VFaXw4oVxi602Q8z2fD+qBo5tAVNDx1xumwF9XaL+UoZGphathhgk/4LLHLNO26XAa+aKGmX9kXh1 5lGGx7bAs84hs5H1vi9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2Ae9-007W2e-R6; Fri, 17 Jun 2022 12:00:17 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcU-007UzA-Mg; Fri, 17 Jun 2022 11:58:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=3uw9DTlVlL/3p2zPOPmNWGMTwEFie9pHBKmiA6Ivfi0=; b=ObT96/fXaOgdBDiXd0Wp4tmIIt xxhsK8MizBP7xxGoSHvIw4tYNQstxLjHywrerqwQbMaJ3aSgUDswtVJmRg+NcHPnQEhTuQ/uDhM5j 0vB0+7wSUbZM6Z520HignKaGBsi7zBSCecILFaVNQOM/P42TW9PViAjOVW16EZSCDe2AK1D86uStq 94xqS/qmQ4470X0BBf/8clea30LwVdNJnjuyvWOidSrITWoDosMEGb+VyFC/pueMd3vz165yttKfM 8TXZRg+O/ZyFJTtLwV/UqK0rDH64YcLo2t7ITWipuqcUSXw8FDnJesutM1ujzKHtSIN1/WqyKg4oI TvlbtC+g==; Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcH-008g12-GB; Fri, 17 Jun 2022 11:58:31 +0000 Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:faf2:1a12:f903:cc5e]) (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 E532F660182B; Fri, 17 Jun 2022 12:58:13 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655467094; bh=fxXI7c8YXJnT7vm+g7u/aQWMuoQ0IJrsBIzhoiD/xMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WHiyH0jeRJY0lzGPOQRJdYu8CI0pnfTp42+8SfKodfAfvThdlVQMp5r36uFQq8KcO IODu9Q6+r6a8D0X5cBPa9XkSSyAkwteXz03/F/5iAvSp0WYK6fi9KRhz5kpxKFJrJQ 2gAQMEpdKFXYN2JQcaCl3oGAkQGcio3L1XJ3oucSieTzOt1g4NyvBqqydvylUhwt32 hRq+LagLJIGGUL1YuLziWG85CdL8HpR1/3i7OvgK5nf3jh8M1GaS2MzoMzYWxWK3Yn Cg39tZbklkbA14PwW4c6/K5nQhS5XH3bSLNresaPWkIJV+QqWl7QbQAzbTomsDb3xK dPmGYQi84EmbA== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH 5/7] media: Hantro: HEVC: Allows 10-bit bitstream Date: Fri, 17 Jun 2022 13:58:00 +0200 Message-Id: <20220617115802.396442-6-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220617115802.396442-1-benjamin.gaignard@collabora.com> References: <20220617115802.396442-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_125823_740009_07212543 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Stop limiting HEVC support to 8-bits bitstreams also accept 10-bits bitstreams. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia --- drivers/staging/media/hantro/hantro_hevc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/hantro/hantro_hevc.c b/drivers/staging/media/hantro/hantro_hevc.c index e06837108a09..85688a4df166 100644 --- a/drivers/staging/media/hantro/hantro_hevc.c +++ b/drivers/staging/media/hantro/hantro_hevc.c @@ -159,8 +159,8 @@ int hantro_hevc_validate_sps(struct hantro_ctx *ctx, const struct v4l2_ctrl_hevc if (sps->bit_depth_luma_minus8 != sps->bit_depth_chroma_minus8) /* Luma and chroma bit depth mismatch */ return -EINVAL; - if (sps->bit_depth_luma_minus8 != 0) - /* Only 8-bit is supported */ + if (sps->bit_depth_luma_minus8 != 0 && sps->bit_depth_luma_minus8 != 2) + /* Only 8-bit and 10-bit is supported */ return -EINVAL; ctx->bit_depth = sps->bit_depth_luma_minus8 + 8; From patchwork Fri Jun 17 11:58:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 12885616 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8D62C43334 for ; Fri, 17 Jun 2022 12:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c5w9U1iB3pNrFsqkT++YSdMLiSVPj74x8QrRkVDnXtM=; b=TAx1ANZ4u62t0a kRUeBD5PxW90tLImkq4NfsutS8OH/ntAgCG/SQYNp7K7b/D0DXr+Ar/un2FgQY4HBUJccRmKiyowA L5Kg0/3gHZATJwmGqRqzy4cu21qNAiGWO5PObMLH6NaVoZogb8qyfYTJN7GtDsaWqwi+rYn+34r79 U0JtRchMTfyKQLYbLY8DCP84mu5VkwfTZty9ej/d9fk6NsjG942NDoE3wUcALLBzV8l8jwXvEiuKp k5BCRE6oIgHUODPfaFpijiOD9kZ7Zje5YpnjzorFD0cIwuLjHITR2SDWqkdYzJ9wqVwLULMJ8luYB 4VCZAn59X0m9hE8EbG5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2Adr-007Vpg-8y; Fri, 17 Jun 2022 11:59:59 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcU-007Uz4-Du; Fri, 17 Jun 2022 11:58:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=pD+aiRV73CLHlkRFdtcrCiiY/Hsz9hpciHAoVHeRQOA=; b=jV1G1vs9eI+Fwfij6sBojhw6Kn akMwMchm+tTC3M+FkiDSeSnYHT5oH7TN2hFC82F9lf4hsV9KEnf4tdPIAeglm+APYy+mGawpH+KU2 YcbbDaPPZPE0pVETYZ0j90NttVbUv/9WdqY3EUpkvpL3frzwkmNEcY5lmVBF0ad1JT+dfWfCMs8/k zzDIhwNlV5BCWsfrhJ+uqwlZyDtASmXMwzX/91p6zrg4rQv6gX7BJedopto0oabDS7cxMoKFna5QJ lZVAStPUZMxCyURwZexDf7uBQFCEvh9tPcHWm2xdxonSW2TMcPQ5LmWgV46q7UKc0IUmDEJ8uMN0e d61iEZ8w==; Received: from madras.collabora.co.uk ([46.235.227.172]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcH-008g13-G5; Fri, 17 Jun 2022 11:58:31 +0000 Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:faf2:1a12:f903:cc5e]) (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 958D3660183F; Fri, 17 Jun 2022 12:58:14 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655467095; bh=Bi9ZgazJJwK+UkLeBW4Jrqy71/5gwlYkkwpr++kSPkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A6NLed4jxlXHDJPD/q4xzy1Fl7/Bqux8fDkPtfQqt3OTbEmyg4aKG3s2xWyB6cRLY QlZW2trGVdOF/x2dTMvEYIMCKKcVT/TX2AzPUr6p7neNVfqOdSLZ3EdVon9Yw7ivwe y+xAHhMRyMxupaPm6VyvGapLJ9PNDuMNlp3DFvvNoBz8gLx2gVCdoqdvCDWSc7OD/r NCesnf18jXkKzrQ09TVqWylBbdEXFZzoakQUodTkexabf+na8RuWQaTQKJV5BUNOFM Jh8ra96L+qdOPpSNLfENziK7H/aCewUCmlP6sbRroEzGiv41iGe3+WE1+2gxvzOFPZ MkcefIlVFHb+Q== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH 6/7] media: hantro: imx8m: Enable 10bit decoding Date: Fri, 17 Jun 2022 13:58:01 +0200 Message-Id: <20220617115802.396442-7-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220617115802.396442-1-benjamin.gaignard@collabora.com> References: <20220617115802.396442-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_125823_679686_0A9843F6 X-CRM114-Status: UNSURE ( 8.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Expose 10bit pixel formats to enable 10bit decoding in IMX8M SoCs. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia --- drivers/staging/media/hantro/imx8m_vpu_hw.c | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c index 77f574fdfa77..b390228fd3b4 100644 --- a/drivers/staging/media/hantro/imx8m_vpu_hw.c +++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c @@ -162,12 +162,39 @@ static const struct hantro_fmt imx8m_vpu_g2_postproc_fmts[] = { .step_height = MB_DIM, }, }, + { + .fourcc = V4L2_PIX_FMT_P010, + .codec_mode = HANTRO_MODE_NONE, + .postprocessed = true, + .frmsize = { + .min_width = FMT_MIN_WIDTH, + .max_width = FMT_UHD_WIDTH, + .step_width = MB_DIM, + .min_height = FMT_MIN_HEIGHT, + .max_height = FMT_UHD_HEIGHT, + .step_height = MB_DIM, + }, + }, }; static const struct hantro_fmt imx8m_vpu_g2_dec_fmts[] = { { .fourcc = V4L2_PIX_FMT_NV12_4L4, .codec_mode = HANTRO_MODE_NONE, + .match_depth = true, + .frmsize = { + .min_width = FMT_MIN_WIDTH, + .max_width = FMT_UHD_WIDTH, + .step_width = TILE_MB_DIM, + .min_height = FMT_MIN_HEIGHT, + .max_height = FMT_UHD_HEIGHT, + .step_height = TILE_MB_DIM, + }, + }, + { + .fourcc = V4L2_PIX_FMT_P010_4L4, + .codec_mode = HANTRO_MODE_NONE, + .match_depth = true, .frmsize = { .min_width = FMT_MIN_WIDTH, .max_width = FMT_UHD_WIDTH, From patchwork Fri Jun 17 11:58:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 12885615 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E071EC43334 for ; Fri, 17 Jun 2022 11:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f4VP7kEO72rcIAWiHNdGYQKCDuzxmqJToQarffnt/RI=; b=a9QoANuKcDJWGT nEGjGDbwqNICN2kExfFzK0nQA4iUyOSMaRsMWTkeL1F9PdWv6vIchpbzLExO2SJT4Dl5f0rq2pAdq Zr7AJk4r+OsBFn/E4nhoVbprx5zt3zNNJPrVioodSeg0nOI+HLYnDP9qFytr6aUdiG3iut/pNDzOf af4ckD3d0qDwYkPpag3Jyq+i97hhRhCPajfGcaNWlwlkDMUgwk+ZfQj8u5D4Hfpg8wxpCzRfVeTJy zlihTK1HxQOVEMxxdjCDBO1DCrFDXNNJP82dAyzoE+5ei4QY4Q/992bja/yZyfyt55SLB+hk/hsxt GGJOPgl+vs0i9B6rjxTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AdT-007VXa-SL; Fri, 17 Jun 2022 11:59:35 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2AcF-007UsQ-3S; Fri, 17 Jun 2022 11:58:20 +0000 Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:faf2:1a12:f903:cc5e]) (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 433E56601856; Fri, 17 Jun 2022 12:58:15 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655467095; bh=3gDGpkk06mAHtR7r2AdzFP7ojDo8eosyId0TYaAzb0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V7ijhT1PVDl59M55MviVPo+G6c0DxIIFvfRu69WWtAtXq/iaVJqQQmk1H3Og4NeP7 9h5bCty+9M24d82c3OiJ52fVcagAyjAzEesEjqrBb002UmANOLi3tBXue4EDrdz2QM na0bYj4KWvuB0ooFjuERsuY9w6yFrmzhBz5xqnuptTieA2IzMOLWdmz+PUpFTIPYip /cBvjF9pRhcWNPiDDtqv08/g1pdl8Ei4U4a1HoiQbuBFeMpFlrInjkWdelRAmTLhaK EJtjNHhBkIMb3hSwifY7alxjuuUp1AExSaiYr7V1TuO0JIMhuqvw//S7kuytSBEZXX emR9803mvXbxw== From: Benjamin Gaignard To: mchehab@kernel.org, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, nicolas.dufresne@collabora.com, andrzej.p@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH 7/7] media: hantro: Allows luma and chroma depth to be different Date: Fri, 17 Jun 2022 13:58:02 +0200 Message-Id: <20220617115802.396442-8-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220617115802.396442-1-benjamin.gaignard@collabora.com> References: <20220617115802.396442-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_045819_317284_A44A1EFE X-CRM114-Status: UNSURE ( 9.16 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Luma and chroma depth are set on different hardware registers. Even if they aren't identical the bitstream can be compliant to HEVC specifications and decoded by the hardware. With this patch TSUNEQBD_A_MAIN10_Technicolor_2 conformance test is successfully decoded. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia --- drivers/staging/media/hantro/hantro_hevc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/media/hantro/hantro_hevc.c b/drivers/staging/media/hantro/hantro_hevc.c index 85688a4df166..26b1329893f7 100644 --- a/drivers/staging/media/hantro/hantro_hevc.c +++ b/drivers/staging/media/hantro/hantro_hevc.c @@ -156,9 +156,6 @@ static int tile_buffer_reallocate(struct hantro_ctx *ctx) int hantro_hevc_validate_sps(struct hantro_ctx *ctx, const struct v4l2_ctrl_hevc_sps *sps) { - if (sps->bit_depth_luma_minus8 != sps->bit_depth_chroma_minus8) - /* Luma and chroma bit depth mismatch */ - return -EINVAL; if (sps->bit_depth_luma_minus8 != 0 && sps->bit_depth_luma_minus8 != 2) /* Only 8-bit and 10-bit is supported */ return -EINVAL;