From patchwork Mon Nov 29 18:26:24 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: 12693939 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 DD98CC4332F for ; Mon, 29 Nov 2021 18:28:36 +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=Nijtosv3TUCo8uDLYhL2eJLFLzchXhLAYvqxDlc6hms=; b=uPhPNynPuAhnMB Sy06KsLdZ3pke9lTUQ1zvwvE5EQztfJ8Xoa5Nrk/wlVwPpFf+AdGpvfdptTBuPHMoZ3T7k2gv7tTg GVswNpTtO5vu/TQyZpEzY+rXnx8Big+vif8t3g8MeOqKK0lI2f3NNfLa4IEtshfrj/zyDR+Lyuf8d XNEXHCLyb8aU9XOW2U6sKkxjQ7VZp47O69e33e/+TRKlwn0IlzyY0hlGmUrwzdHem7F938TtOyx62 NJVWUV0zsQ+40eTV4P79yMk5JiCtr28O3cvOA4kgwItX1wru+d6qNllUv8TulkYBZ3yEcdqMASOO5 7SVX0JwxYrdpmyKIqoTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrlMQ-001l1Y-K4; Mon, 29 Nov 2021 18:26:42 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrlMM-001l0E-QO for linux-arm-kernel@lists.infradead.org; Mon, 29 Nov 2021 18:26:40 +0000 Received: by mail-wm1-x32d.google.com with SMTP id i8-20020a7bc948000000b0030db7b70b6bso17584910wml.1 for ; Mon, 29 Nov 2021 10:26:38 -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=GJz9RWbzi9C4eyOJNiBHCtQqCneeiBOlTZyVHZvdTbY=; b=JECIG/4l50bi1AFhIQiQVxZWiGpQP0WWOPoPhAO4/Ycnsrtqml9idfA0/lZWBjVxZB lGDKYV4R4DMiy8nkxFqyWVOffSJEglde8oGi4Z9SM7qmg8VKnHMUSgxa3qjvvac/1dkn cC+Ff3ZOSwFWFFgiZOC7CFf/z44mNMozJHLJqQPAYp3/fD/z6f1EfS9VVvBBntDlFfvj Dq+m5t/Rd+K8NoeoEUSdId8OWXLEhLs/28cSBrf53iEzMlNvoF+CkieMPOAzLggwA9VC CxCsOI5c2KpYsJRRvbDrTjFfpjA6izu1YkWjBulnkQs1kSvIy92EvgR8R7qNivQ9vWWg 7WLA== 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=GJz9RWbzi9C4eyOJNiBHCtQqCneeiBOlTZyVHZvdTbY=; b=0UW1IGWEF1nxvnn+JVEbl4gh3wGBiQneHVftK93dzHPAvMaZCKXOlw2h24+5S0uYf4 muUjM4X4Vfi+c9/zVfKwGivK141UqwddHkor9bRzIOSExUAWbDbh95dFVERnSKHnsX7O d8wq5wTB55rvCBnC3UjfD3GGIzqpJ4tV3iGF/oHILIhaW4kpWh0puoYDOfew4GhpI/2x cFWJihbtG2rn3qZA2SfNwa6X9JJA1Vp2YtiLA3tFPnx/o9fs5JDZGG9W2+BP7E991WS4 WILBqHZIduGVXtucLAoOSlnm/3wID/DKErLiJEejhAITKtg6/Zc4CF8W5t/Si7RPtM+G Flpw== X-Gm-Message-State: AOAM532JxUSrj9ZGyOdi91tDNZdL6aFLbEsl6g0Ha5SrHvaujZ65ova9 YUKTfuwMBGKkTU2xawXrpY0= X-Google-Smtp-Source: ABdhPJwVmS0SalFYLz6O8ewhDYaXtBZq+zhgghGAYTbCJPowe7PIeSLDtMw1cE7BD34HcoiBMnH3zw== X-Received: by 2002:a05:600c:1549:: with SMTP id f9mr51796wmg.118.1638210397631; Mon, 29 Nov 2021 10:26:37 -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 o12sm85907wmq.12.2021.11.29.10.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Nov 2021 10:26:37 -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 v2 0/9] media: hantro: add Allwinner H6 support Date: Mon, 29 Nov 2021 19:26:24 +0100 Message-Id: <20211129182633.480021-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211129_102638_896060_EC0407AB X-CRM114-Status: GOOD ( 18.99 ) 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 2, like legacy_regs, ring_buffer, 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. Based on top of: https://www.spinics.net/lists/linux-media/msg202448.html Please take a look. Best regards, Jernej [1] https://github.com/CliveLau1990/imx-vpu-hantro Changes from v1: - fixed error path in probe function - sorted register defines by bit number and rename some of them - added late_postproc quirk and reversed order in condition - factor out imx8m_vpu_g2_irq to a helper - updated Allwinner platform code - collected tags Jernej Skrabec (9): media: hantro: Fix probe func error path 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: hantro: Convert imx8m_vpu_g2_irq to helper 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 | 9 ++ drivers/staging/media/hantro/hantro_drv.c | 28 +++++- drivers/staging/media/hantro/hantro_g2.c | 18 ++++ drivers/staging/media/hantro/hantro_g2_regs.h | 17 ++++ .../staging/media/hantro/hantro_g2_vp9_dec.c | 76 ++++++++++++---- drivers/staging/media/hantro/hantro_hw.h | 2 + drivers/staging/media/hantro/imx8m_vpu_hw.c | 20 +---- drivers/staging/media/hantro/sunxi_vpu_hw.c | 86 +++++++++++++++++++ 12 files changed, 303 insertions(+), 39 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