From patchwork Tue Jun 18 18:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13702827 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 64695C27C4F for ; Tue, 18 Jun 2024 18:38:31 +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=nB7+tX7uRHHMnzLyPxOO3QL2Kk1M5nlZZx5uDK/aN9k=; b=4z9gdNFdxIUmMA M0d6d7/iecKW/Ro6bHuAHcaVZF9iuWHvZTjGedkkuSi0eXmcjCVtTq8oV4eJ/gZUSw4J0nRYCoz1p nOXHy/fkMWrA/zVoiIFizcRdqaXQQDmQ332A5ftOJCXCZGWSc0MEynCXbWbOrBDqwSWXh2K4GUC3A 6bHlg7fg2S/RZ9GTHr4mepmrpyDOHy1THVgYZfAxlckGScTm+/QCt5kF4CUoDUGAgVdcxWs+oqOhy SzkI/iho/JkdIjiAV8gfVe7Nlg0AuLgxJeTYlNyCWvAxWPiYzh2djcfECn89ivioYlOp3P+/4f0/x 27c0dhkyQanz/81oh4QQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJdit-0000000GE4d-2SYG; Tue, 18 Jun 2024 18:38:27 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJdin-0000000GE0i-0Hc7 for linux-rockchip@lists.infradead.org; Tue, 18 Jun 2024 18:38:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718735897; bh=9iZR6qfhdq2inBfR21miynRAFj2tcgSizdsoz74Q7C0=; h=From:To:Cc:Subject:Date:From; b=NS89/eA9OrJeKUWAjWeVXDiTwGODlZRi/gQdOEt1zpb8O6WhLOoeqHZLFQ09MleWX s1yBPsNUtBDO5QwUdd3jVIp9A264e9Q00yZVKYw5EMhMKbAztbX/S+u6orsN6YcFrr 1OVoRFg/yQhCtCpQUQJG5eXC2DJ1jb/CM9dC2HR0IO0MqKczoeYesXI6MVtg/gd1Gg j0V7dZo2VPYd7c+BkebElRrDczuLJpplg2wTTe5uY6bMqoHZlVnjeiPDCW+0kLcZi3 vGlTjHnWlS/bqoU1qYEECNRckuEZ93Fd0C7MJaAf9pZ3NTpV3wU++72Vt6qugYOmcD vm2oTrf4s3wrw== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (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: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 8105B3780BFE; Tue, 18 Jun 2024 18:38:17 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 2ABA24800C9; Tue, 18 Jun 2024 20:38:17 +0200 (CEST) From: Sebastian Reichel To: Ezequiel Garcia , Philipp Zabel , Nicolas Frattaroli , Heiko Stuebner Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jianfeng Liu , Emmanuel Gil Peyrot , Nicolas Dufresne , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v7 0/6] RK3588 VEPU121/VPU121 support Date: Tue, 18 Jun 2024 20:18:31 +0200 Message-ID: <20240618183816.77597-1-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240618_113821_514827_7B1CA26B X-CRM114-Status: GOOD ( 19.82 ) 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 Hi, This series enables Hantro support for RK3588. It is based on these two previous series from Emmanuel Gil Peyrot and Jianfeng Liu, which looked stalled to me. Considering the full driver is already upstream, I think this low hanging fruit should be enabled in 6.11: * https://lore.kernel.org/all/20240316071100.2419369-1-liujianfeng1994@gmail.com/ * https://lore.kernel.org/linux-rockchip/20240412151515.837824-1-linkmauve@linkmauve.fr/ Their series got some feedback from Nicolas Dufresne, that there should be a plan how multi-core processing will be handled once it is supported in the kernel. I had a look (and internal discussion with Nicolas) and came up with a patch, which allows describing all the Hantro IP in DT. The driver will only probe for the first instance. This involves dropping the RK3568 compatible for the VEPU121, so that only kernels with the driver change will try to handle these IP. Once the kernel is capable of multi-core support, the same technique to disable cores 1-3 can be used to combine them all into one cluster. We also discussed, if they should be described as a cluster (e.g. by creating some kind of virtual bus for the 4 encoders in DT). Apparently the VSI doc describes the grouping of up to 4 instances. But there is no obvious reason why only these groups can be used as a cluster. It seems that even the 5th encoder from the combo VPU121 could be used together with the other clustered cores in theory. In practice this is probably a bad idea because of the shared cache of that encoder. Since that is handled with a different compatible, this can be thought about at a later point of time and handled in the kernel. Thus no special cluster description is needed in DT. Changes since PATCHv6: * Collected Acked-by for RK3588 VEPU121 DT binding from Conor Dooley * Fix resource leak of DT node in hantro_disable_multicore() * Support disabled nodes in hantro_disable_multicore() * Use correct match data (RK3568 VEPU instead of VPU) for RK3588 VEPU121 Changes since PATCHv5: * Fix binding for vepu121 (use enum) * split hantro driver patch (multicore / vepu121 compatible) * move video-codec@fdb50000 node to correct position * change "jpeg_enc*" alias to "vepu121_*" * change "vpu_*" alias to "vpu121_*" (to be consistent) Changes since PATCHv3 (VEPU121) / PATCHv4 (VPU121) * combine both patchsets, since there is some overleap * add patch to disable multi-core handling in the hantro driver * drop the RK3568 fallback compatible for VEPU (see above for the reason) * describe all RK3588 VEPU cores (possible because of driver change) Greetings, -- Sebastian Emmanuel Gil Peyrot (2): media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121 arm64: dts: rockchip: Add VEPU121 to RK3588 Jianfeng Liu (2): media: dt-bindings: rockchip-vpu: Add RK3588 VPU121 arm64: dts: rockchip: Add VPU121 support for RK3588 Sebastian Reichel (2): media: hantro: Disable multicore support media: hantro: Add RK3588 VEPU121 .../bindings/media/rockchip,rk3568-vepu.yaml | 1 + .../bindings/media/rockchip-vpu.yaml | 3 + arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 101 ++++++++++++++++++ .../media/platform/verisilicon/hantro_drv.c | 48 +++++++++ 4 files changed, 153 insertions(+)