From patchwork Mon Nov 22 18:46:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 12693352 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 434F5C433F5 for ; Mon, 22 Nov 2021 18:49:06 +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: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=gy0W+M27srr/MV7E3Vk09FZzNMtoPRueX/rwJxvo1RU=; b=LzFkde+yN2dwpl Js60ICwaNfhtZfS1sNipHmCqXnOjFOC+B6fVNbYnN5s4FrVRrPZ9AO7hRIeAMPWTtgeIJdUsYepLm RJrsGggsMbSzkGV5168pBYvmrG7EqLOx2gII2vYhoEJrlblP8kLDk/bLueE25x3567RjhDsTa/M1C cscLJYxBKimEpZyjTIHhIdxXZe1mX+MMQtBC5119ZZ3vziiptoKWCHxYBD+afmY2dfrglK2VvSe2I UP9xaC9VyAKpDwj0WKZ6pYlGAtH4o3XLlpmIrrd2f2EOCy9UpZaIpp2vsgRVeFlrFogGtlPorhmd9 E47EcLiqm9CgA2BvY2Lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpELX-00HOCK-4e; Mon, 22 Nov 2021 18:47:19 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpELS-00HOA5-5p for linux-arm-kernel@lists.infradead.org; Mon, 22 Nov 2021 18:47:15 +0000 Received: by mail-ed1-x52d.google.com with SMTP id r25so44294918edq.7 for ; Mon, 22 Nov 2021 10:47:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Dss9UiKF+k7Po25DwSiusMM9IdCzuECfyUd1tTdrRbg=; b=Bhz5XvT0o10O8LdIN/VUhQiHJnLca2FPbI8x7F6PqhoK3FZcFJPU/UYdTpzylMMRg+ 6z0CYvdyYJZlEuRD5SbYMZ9PnFBhr9dY35NCq1Kle7ytd23z+8cMqeCungXc3aWTpMz0 tb/czpATqWjnJdXSqa3lC4acLd1TwR8YAE9NFCSJwVh6IamtDXMmdvRaLe46ALA2iPte hh5UB0gbkaQW2zds/Y7XTpR7YGJe687hrvfuLO1dbcALrHS3HAwf0r7phkTVz0Nbdnbh Px1PyTlCdNoFDo0FZH6V0UU9F2llZKSKuBSBkF4HYP2Lk5fjiETmJ3KibLlgEawJZdLA Uv9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Dss9UiKF+k7Po25DwSiusMM9IdCzuECfyUd1tTdrRbg=; b=7s4N0OtM+KnxBvNtjKJjaTgUSmFIiQLW8A3a3J4Qt+gY5xaxfgQrx//P798G2e2f60 LXJDGYVKckroF8HkxwYlRp7kr5XFO6fWCt66ilxAR/z+drqSLQ6XkzRfGRavu6j8XiMg 3aJb8gJ32kr3OVHJTPJjHgHfI3UFEeK3WeLT+rFtAbfNJC4upxp0WyZWbIyowcE76zy8 yBx+cXtKFFkg3D5YHAAFS52WK3oPuktMwYb7GjH3B0pK9XKd0bhRs8CZ2/9rX8RjUkLE eqtB95uk82gidN7BHlaedQw7bWgnicfmregncF06FysHuFpAOmfD4UIMAvyujQGcJD0a WUfw== X-Gm-Message-State: AOAM533j9CgdROlwhVpMea0CUqXe5rrFKfK2ktFYsdEL3iVujl/ct3dT VFYEtGy7NV94nSJJX1LflX8= X-Google-Smtp-Source: ABdhPJzgdosbksPZCqL8fKg3cjtQpo/DXX2+PosZpuL8FSxSDz2AVuG1NfXCsxT1xLP2AzUNixo0fA== X-Received: by 2002:a17:906:a215:: with SMTP id r21mr27612192ejy.21.1637606831875; Mon, 22 Nov 2021 10:47:11 -0800 (PST) Received: from kista.localdomain (cpe-86-58-29-253.static.triera.net. [86.58.29.253]) by smtp.gmail.com with ESMTPSA id h10sm4512312edr.95.2021.11.22.10.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 10:47:11 -0800 (PST) From: Jernej Skrabec To: linux-media@vger.kernel.org Cc: ezequiel@vanguardiasur.com.ar, nicolas.dufresne@collabora.com, mchehab@kernel.org, robh+dt@kernel.org, mripard@kernel.org, wens@csie.org, p.zabel@pengutronix.de, andrzej.p@collabora.com, gregkh@linuxfoundation.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Jernej Skrabec Subject: [PATCH 0/7] media: hantro: add Allwinner H6 support Date: Mon, 22 Nov 2021 19:46:55 +0100 Message-Id: <20211122184702.768341-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211122_104714_259585_89C0CD05 X-CRM114-Status: GOOD ( 17.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi everyone! Here is patchset which adds support for Hantro G2 core found in Allwinner H6 SoC. It is slightly older core, so it needs few quirks to be implemented: 1. It uses slightly different register layout in some cases. However, those differences are small, so it makes sense only to add quirks. 2. It doesn't use ring buffer for bitstream as newer variants. 3. It needs double buffering to be enabled in order to work correctly. 4. postproc must be enabled at the end of the job. It seems that core has some issues with latching register values if postproc registers are set at the beginning of the job legacy_regs quirk could be split into 3, like legacy_regs, ring_buffer and late_postproc, but I didn't see the need for that. I examined vendor sources at [1] and it suggests that legacy_regs implies no ring buffer. It's also unclear if core supports HEVC decoding or not. This can be implemented later. VP9 10-bit decoding support is mentioned in manual, but it doesn't work at the moment. This will be addressed later. Please take a look. Best regards, Jernej [1] https://github.com/CliveLau1990/imx-vpu-hantro Jernej Skrabec (7): media: hantro: add support for reset lines media: hantro: vp9: use double buffering if needed media: hantro: vp9: add support for legacy register set media: hantro: move postproc enablement for old cores media: dt-bindings: allwinner: document H6 Hantro G2 binding media: hantro: Add support for Allwinner H6 arm64: dts: allwinner: h6: Add Hantro G2 node .../media/allwinner,sun50i-h6-vpu-g2.yaml | 64 +++++++++++ arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 9 ++ drivers/staging/media/hantro/Kconfig | 10 +- drivers/staging/media/hantro/Makefile | 3 + drivers/staging/media/hantro/hantro.h | 7 ++ drivers/staging/media/hantro/hantro_drv.c | 27 ++++- drivers/staging/media/hantro/hantro_g2_regs.h | 20 ++++ .../staging/media/hantro/hantro_g2_vp9_dec.c | 76 ++++++++++--- drivers/staging/media/hantro/hantro_hw.h | 1 + drivers/staging/media/hantro/sunxi_vpu_hw.c | 104 ++++++++++++++++++ 10 files changed, 301 insertions(+), 20 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml create mode 100644 drivers/staging/media/hantro/sunxi_vpu_hw.c