From patchwork Fri Jun 18 13:15:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 12331341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6053FC48BE8 for ; Fri, 18 Jun 2021 13:16:01 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3252E613ED for ; Fri, 18 Jun 2021 13:16:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3252E613ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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: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:In-Reply-To:References: List-Owner; bh=80NDVqpKvFszcG/Qq4xqRk4N2pT/EvdXgToDYmjn3ic=; b=DJwsKjMAr2/cX2 9bLbQ3dTVy8dY6WGkLMEOJBuEPqKxAXegxjcnDeA+wwmQoLEOsPCPw+Z8M+fy9SAob/aKuzMKUHJ1 THws7S7tLBDL+B+qKxrHhH/NsJ0dCNeTRz7+j3UNxFCbIMTs4XFwmv1cj8AaNrKGij6XqHp2+j6N1 ibdSOoNT6w6+eQTdKVugLARvoSiwDwksEOuFlkxy2mqxKemvk1mXVDWLilYs6AXfWovPCzJ+lGfNJ LPbvRBYWPoyuz0muLQE5JoGSfUTltPSkgb1PY0R40rsT69jqMdBYO0l1FAtQOW8BAQAeyUgHI8Yp9 vgT2yRnVe1YZRqWg+V0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luELl-00E8kT-7J; Fri, 18 Jun 2021 13:15:57 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luELR-00E8Zn-3Q; Fri, 18 Jun 2021 13:15:41 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:4cb:a870:141f:c87a:873e:7b6f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 772591F448CC; Fri, 18 Jun 2021 14:15:34 +0100 (BST) From: Benjamin Gaignard To: hverkuil@xs4all.nl, ezequiel@collabora.com, p.zabel@pengutronix.de, mchehab@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@siol.net, emil.l.velikov@gmail.com, andrzej.p@collabora.com, jc@kynesim.co.uk, jernej.skrabec@gmail.com, nicolas@ndufresne.ca Cc: kernel@pengutronix.de, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Benjamin Gaignard Subject: [PATCH v3 0/8] Additional features for Hantro HEVC Date: Fri, 18 Jun 2021 15:15:18 +0200 Message-Id: <20210618131526.566762-1-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_061537_317795_7BA0F163 X-CRM114-Status: GOOD ( 15.87 ) 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 version 3: - Change trace file name to hantro_trace.h version 2: - Fix structure name in ext-ctrls-codec.rst - Define the value for compression storage size - Add comments about registers usage - Add documentation about P010 padding Basic HEVC support has been added to Hantro driver in this pull request: https://www.spinics.net/lists/linux-media/msg193744.html Thanks to that it is now possible to support more features for this driver. The first patch allow to log the hardware performance per macroblock. The second patch makes the driver use compressed reference frames to reduce memory bandwidth consumption. Patches 3 to 5 allow to decode and produce 10-bits P010 frames. Patch 6 make usage of G2 post processor to scale down the frames. Patches 7 and 8 add the support of HEVC scaling matrix by adding a new control. All these patches enhance the HEVC support for Hantro (G2) hardware. Unluckily they almost all touch the same pieces of code, where buffer size, offset and addresses are set, so they have to be in this order. They depend of the series pushed in this pull request: https://www.spinics.net/lists/linux-media/msg193744.html Benjamin Benjamin Gaignard (8): media: hantro: Trace hevc hw cycles performance register media: hantro: Add support of compressed reference buffers media: hantro: hevc: Allow 10-bits encoded streams media: Add P010 video format media: hantro: hevc: Allow to produce 10-bit frames media: hantro: enumerate scaled output formats media: hevc: Add scaling matrix control media: hantro: Add scaling lists feature .../media/v4l/ext-ctrls-codec.rst | 45 +++++ .../media/v4l/pixfmt-yuv-planar.rst | 78 +++++++- .../media/v4l/vidioc-queryctrl.rst | 6 + drivers/media/v4l2-core/v4l2-common.c | 1 + drivers/media/v4l2-core/v4l2-ctrls-core.c | 6 + drivers/media/v4l2-core/v4l2-ctrls-defs.c | 4 + drivers/media/v4l2-core/v4l2-ioctl.c | 1 + drivers/staging/media/hantro/hantro.h | 4 + drivers/staging/media/hantro/hantro_drv.c | 32 ++- .../staging/media/hantro/hantro_g2_hevc_dec.c | 186 ++++++++++++++++-- drivers/staging/media/hantro/hantro_g2_regs.h | 12 ++ drivers/staging/media/hantro/hantro_hevc.c | 67 ++++++- drivers/staging/media/hantro/hantro_hw.h | 7 + drivers/staging/media/hantro/hantro_trace.h | 39 ++++ drivers/staging/media/hantro/hantro_v4l2.c | 10 +- drivers/staging/media/hantro/imx8m_vpu_hw.c | 6 + include/media/hevc-ctrls.h | 11 ++ include/uapi/linux/videodev2.h | 1 + 18 files changed, 492 insertions(+), 24 deletions(-) create mode 100644 drivers/staging/media/hantro/hantro_trace.h