From patchwork Wed Jun 12 17:15:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 102391 Received: from sv.mirrors.kernel.org ([139.178.88.99]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sHRq8-0008Ul-2q for patchwork@linuxtv.org; Wed, 12 Jun 2024 17:32:53 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 38EFD285922 for ; Wed, 12 Jun 2024 17:32:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 004B81836C1; Wed, 12 Jun 2024 17:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="R3rVf2+k" X-Original-To: linux-media@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 869D0176ACD; Wed, 12 Jun 2024 17:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213545; cv=none; b=od4vzerB9rWM3puFV3B+FRud3lIjXGtiQHgGuDEus7FbA9Za36vqVT2FR7vlQH0Mlz3XXwbhzoLHZWVTcMDyXvAWozKubkFSpSZdrFQTq7KtYfYaQqV/4L+XocrDTidmfqklnJQmizmUzWN/F/DpiTTpxX4wNbBg0Ot1vmvdOtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213545; c=relaxed/simple; bh=VEM0T7Y24bsYJeE8dDbB44Yk+1yMMARS0IlFh2wyh1Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t1RYAwpxE3ygrLWtfCQ8n3HtBRiSJgRClcEYnyw4wuO/rIqyKfMw6aBhRsQMFZgbkkyszsVLgnBfhxWnPgnGIhSNhEoPzRyPR04QmhUVR39LwktIrQrXh9k0D9d3FVqaq9UNKDekhPJVmPTBvUeysHlafzomcG599fOMH4oXY9Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=R3rVf2+k; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718213541; bh=VEM0T7Y24bsYJeE8dDbB44Yk+1yMMARS0IlFh2wyh1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R3rVf2+kdqNlzYfHpH2RTI8JqDoN2WFj5syMa9mpmmfCqCuqhgtRLmNVKdsspwBUu UmJ/XQVmUmcmcGjVEN+dNTpJZKKJSCnq8omeNZqW3B/7ILsrEAZXYTUcWcxvPftGCN WDL2EN4F+wu7myRdZKewoEck5+Z+rl4BGkQlS/e+F/RtN8WyGCh28HpGnhuKLYTU9w kRKBRMHryUnDnuJiH51FKgXXKz5yM6+m/+1NkhnteJBO9N2BdFe8nit7cSzdFhVIge HbwdYPDHOjoSfpZcdglomxNvmYYb8D4RA68MeQecWVzwh0uBzbR+FZ7HyHktwJoDx5 UCGb95SQ8XjEg== 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 AB3E9378219F; Wed, 12 Jun 2024 17:32:21 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 5A8AC4800C7; Wed, 12 Jun 2024 19:32:21 +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, kernel@collabora.com, Sebastian Reichel Subject: [PATCH v5 1/5] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121 Date: Wed, 12 Jun 2024 19:15:41 +0200 Message-ID: <20240612173213.42827-2-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240612173213.42827-1-sebastian.reichel@collabora.com> References: <20240612173213.42827-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-LSpam-Score: -4.9 (----) X-LSpam-Report: No, score=-4.9 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_PASS=-0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no From: Emmanuel Gil Peyrot This encoder-only device is present four times on this SoC, and should support everything the rk3568 vepu supports (so JPEG, H.264 and VP8 encoding). No fallback compatible has been added, since the operating systems might already support RK3568 VEPU and want to avoid registering four of them separately considering they can be used as a cluster. Signed-off-by: Emmanuel Gil Peyrot Signed-off-by: Sebastian Reichel --- .../devicetree/bindings/media/rockchip,rk3568-vepu.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml b/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml index 9d90d8d0565a..8b9496e6a2bb 100644 --- a/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml +++ b/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml @@ -15,8 +15,9 @@ description: properties: compatible: - enum: - - rockchip,rk3568-vepu + oneOf: + - const: rockchip,rk3568-vepu + - const: rockchip,rk3588-vepu121 reg: maxItems: 1 From patchwork Wed Jun 12 17:15:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 102390 Received: from sv.mirrors.kernel.org ([139.178.88.99]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sHRpw-0008S8-24 for patchwork@linuxtv.org; Wed, 12 Jun 2024 17:32:43 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C20DE28611B for ; Wed, 12 Jun 2024 17:32:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 650A6183073; Wed, 12 Jun 2024 17:32:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="f7WvOn48" X-Original-To: linux-media@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86929EBB; Wed, 12 Jun 2024 17:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213545; cv=none; b=l3Qb/TAXnhGGqukEQP1ueufO+tneV1vIOiX9pMHuUmN0nv8vmGOQHCivJfAWAld91HLcD+Y26FV/XIxIgZxF9BOe2gMeTdmEniAtLgtX7v3+nuym9EGB+iKhlFgiO9zDUQMhbIamuwyRqT3nVXtybFFJ6BgGw1hjNon/3e8rlgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213545; c=relaxed/simple; bh=qT3T7wi3nE+eFhkZ2bUnCRb/SyRrxFgNwM5t87xUarI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bV1Fc+qKxPLZTi5UWv1JDqxBEXVQf7WG7PpqBs+U9Xfv74vG3olXvBhAzAWnRrCRr8UZ2P7BwTOsfZlR+7P+0oqp4x9HaK2fMaTRgKkJRqAWgs+o8mJo2TfFsSsIO1RpUFEbAOrvk1foy0WVggimiGIyPcEpdY/PpOM9PA1eFTo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=f7WvOn48; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718213541; bh=qT3T7wi3nE+eFhkZ2bUnCRb/SyRrxFgNwM5t87xUarI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7WvOn48Zarlf+9C1J/sh6Z/Qf3l8ugftHR2RXi05xjXmPAVPn3HjySLkto+GtntX IOcxZwleqeeZ1J1OnqV5vDMMTvxM11ChjP/M0zv9VzWVZuJo3kv0ubKb8vix9N5BGt u8gV9bXASfQhuLm9mq3Mzr54L8lgRXRhkoCI5ZtOxH6wimSzF+2+Trmp5iE5cq3vmq d4Ie6pjUHsnHQHA3ZlfJjNRu/o2P8IepqEcJFqg75Jor1FUiwKYLR+a/i1X74HsLby H8Cs/5K9cnxsB00lS6tGXP2d2rMWz8mSONzemrQVQnrDySR3dPHW0iO4wDtdMWlHbH sTN6WPobSMLJQ== 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 B4D8937821A0; Wed, 12 Jun 2024 17:32:21 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 5CAC14800CD; Wed, 12 Jun 2024 19:32:21 +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, kernel@collabora.com, Conor Dooley , Sebastian Reichel Subject: [PATCH v5 2/5] media: dt-bindings: rockchip-vpu: Add RK3588 VPU121 Date: Wed, 12 Jun 2024 19:15:42 +0200 Message-ID: <20240612173213.42827-3-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240612173213.42827-1-sebastian.reichel@collabora.com> References: <20240612173213.42827-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-LSpam-Score: -4.9 (----) X-LSpam-Report: No, score=-4.9 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_PASS=-0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no From: Jianfeng Liu RK3588 has four Hantro H1 VEPUs (encoder-only) modules and one combined Hantro H1/G1 VPU (decoder and encoder). These are not described as separate IP, since they are sharing an internal cache. This adds the RK3588 specific compatible string for the combined VPU, which seems to be identical to the version found in the RK3568. Signed-off-by: Jianfeng Liu Acked-by: Conor Dooley Signed-off-by: Sebastian Reichel --- Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml index c57e1f488895..2710bb2fb0d1 100644 --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml @@ -31,6 +31,9 @@ properties: - items: - const: rockchip,rk3228-vpu - const: rockchip,rk3399-vpu + - items: + - const: rockchip,rk3588-vpu121 + - const: rockchip,rk3568-vpu reg: maxItems: 1 From patchwork Wed Jun 12 17:15:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 102393 Received: from sv.mirrors.kernel.org ([139.178.88.99]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sHRq1-0008T8-01 for patchwork@linuxtv.org; Wed, 12 Jun 2024 17:32:46 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8791A2861C6 for ; Wed, 12 Jun 2024 17:32:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFFEB1822CE; Wed, 12 Jun 2024 17:32:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="L00ouhxp" X-Original-To: linux-media@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2DC3181CE7; Wed, 12 Jun 2024 17:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213545; cv=none; b=qQljsRqSk4hlqC+eEO1dKWH/NQyWGP0SSR1oCgNnA21W4FeCBwFAXL9FYpezEWI7zwv8i/S1Bqw49/3FrQB5rdfUcJ09SBX+OyQAXG+LVUW/Q5kZLMedLYoua5HbLCL/CWPbK2gcy0IGK6svokBYfExKoMSQ2gbUPxDdhqOyVlg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213545; c=relaxed/simple; bh=KKnehwnapMDXEYhFKS5XsfL67lPPoRVBA2nN+Yi9Q24=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ELvaB9QH4vozRXWf1tUW0/fHhKt6euVNDkDEILdMeWVceJsF+O0pgGXinzEEw9YvS9YaK/byMhfbL2UP9PRQjzJlzV/rJkWQBvRgMR9/9nfRub1UgsVco73yjZ/278jBNweNLYOd+AX1LBG2NkeUjFyVaq2nuTj1NyhVCOVsN1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=L00ouhxp; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718213541; bh=KKnehwnapMDXEYhFKS5XsfL67lPPoRVBA2nN+Yi9Q24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L00ouhxpqR5XhuMSWrJNBvj0w+0dSXrylM2KwH60f5E1Nean4momD3IEMV5YxXwi4 KhokKYcNRRvzpKckrZcWxWMRO7Fao9nD+Z/YNAq/vY8R3NQ2uY0wBUeHjQ6P6W2/+I ZBrik0KeuZJ764dk5+1g1Fsjv0wqXTLBXbvX+RgAC2DfBheHvBjpHUSMYSi6EIyrNe a/rGvJAFXu+fMhQInJ0axuxw9+hkBUwAVm6GvW9wH7YJO2llTZrCIRsmYWHbhnPOdE ddOAX1Ke72O+u0U6vHoQ7Lynf9B1bCciqQ4JgGUeEw00I9ZVzwrfer4uN5JOkK+DOE VpGZP+JrB9ZrA== 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)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id C2916378219B; Wed, 12 Jun 2024 17:32:21 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 5E8E44800CE; Wed, 12 Jun 2024 19:32:21 +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 v5 3/5] media: hantro: Add RK3588 VEPU121 support Date: Wed, 12 Jun 2024 19:15:43 +0200 Message-ID: <20240612173213.42827-4-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240612173213.42827-1-sebastian.reichel@collabora.com> References: <20240612173213.42827-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-LSpam-Score: -4.9 (----) X-LSpam-Report: No, score=-4.9 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_PASS=-0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no Avoid exposing each of the 4 Hantro H1 cores separately to userspace. For now just expose the first one. Signed-off-by: Sebastian Reichel --- .../media/platform/verisilicon/hantro_drv.c | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 34b123dafd89..b722a20c5fe3 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -722,6 +722,7 @@ static const struct of_device_id of_hantro_match[] = { { .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, }, { .compatible = "rockchip,rk3568-vepu", .data = &rk3568_vepu_variant, }, { .compatible = "rockchip,rk3568-vpu", .data = &rk3568_vpu_variant, }, + { .compatible = "rockchip,rk3588-vepu121", .data = &rk3568_vpu_variant, }, { .compatible = "rockchip,rk3588-av1-vpu", .data = &rk3588_vpu981_variant, }, #endif #ifdef CONFIG_VIDEO_HANTRO_IMX8M @@ -992,6 +993,39 @@ static const struct media_device_ops hantro_m2m_media_ops = { .req_queue = v4l2_m2m_request_queue, }; +/* + * Some SoCs, like RK3588 have multiple identical Hantro cores, but the + * kernel is currently missing support for multi-core handling. Exposing + * separate devices for each core to userspace is bad, since that does + * not allow scheduling tasks properly (and creates ABI). With this workaround + * the driver will only probe for the first core and early exit for the other + * cores. Once the driver gains multi-core support, the same technique + * for detecting the main core can be used to cluster all cores together. + */ +static int hantro_disable_multicore(struct hantro_dev *vpu) +{ + const char *compatible; + struct device_node *node; + int ret; + + /* Intentionally ignores the fallback strings */ + ret = of_property_read_string(vpu->dev->of_node, "compatible", &compatible); + if (ret) + return ret; + + /* first compatible node found from the root node is considered the main core */ + node = of_find_compatible_node(NULL, NULL, compatible); + if (!node) + return -EINVAL; /* broken DT? */ + + if (vpu->dev->of_node != node) { + dev_info(vpu->dev, "missing multi-core support, ignoring this instance\n"); + return -ENODEV; + } + + return 0; +} + static int hantro_probe(struct platform_device *pdev) { const struct of_device_id *match; @@ -1011,6 +1045,10 @@ static int hantro_probe(struct platform_device *pdev) match = of_match_node(of_hantro_match, pdev->dev.of_node); vpu->variant = match->data; + ret = hantro_disable_multicore(vpu); + if (ret) + return ret; + /* * Support for nxp,imx8mq-vpu is kept for backwards compatibility * but it's deprecated. Please update your DTS file to use From patchwork Wed Jun 12 17:15:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 102394 Received: from am.mirrors.kernel.org ([147.75.80.249]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sHRqT-00006M-0c for patchwork@linuxtv.org; Wed, 12 Jun 2024 17:33:13 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6D8ED1F21BDD for ; Wed, 12 Jun 2024 17:33:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA5361836F6; Wed, 12 Jun 2024 17:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="PqcYgz1F" X-Original-To: linux-media@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2D7617E91E; Wed, 12 Jun 2024 17:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213546; cv=none; b=WMwUHAdrJ5Fu6RsR+4n+PXkiOJBrIRWmeVO9oHQtLkTEWDR1uZ/W0llPignp8c1ETTf8HJIuDhnmmIvQ0hOZDZyaCWIaLAAMkBx76Oc3U/uW3mROf5T1+QhtyyoFRdKpr2AvQTkdxVJjmgRzP5imqKqYGbAJSxwgyZNXPgA68m0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213546; c=relaxed/simple; bh=r9Pm0rMa12TnlTbVnCAif5kBsOtAXCY8BoST484+vUQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hZY24DCVlCnHwWau6hUAKR9K40aZTtRMRTDC6h/Jp5QMbc8p4pIgB90zA5Ts0r8fY2E4pcL1lP5OnsFdRSWtup+8TIW4/GhjRfj8SeYjOnta430v9glBsUfaFCNykHf91oGi99bMqXiixR/B3C/INGfRssLvfJDruMuUWlYTSoA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=PqcYgz1F; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718213542; bh=r9Pm0rMa12TnlTbVnCAif5kBsOtAXCY8BoST484+vUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PqcYgz1FzL+j/xAfT53N0okz1nknSrba+8D8H82pfxa/tY/HR9Z8wGzKbiNivoEff CpqM2XcjJ1LobLBYxrvkKKmZBx0TCuRgQ7zSOK78tfphvEpxw77W2QTA9BQ1ti/c+0 ipDCrBAxt14PHeK4phaBk7ysmWZciAwOkiNVNEuNXm7SjXLlkkOenChUE1InBvAaD7 Uhtk13fDS34ncRiPnQz6gsea3Fn4ewzT8KO2x+ftf2ChRm/OTapc90JSoBa3QFQOiv lW2BX/9OtlkB8k7ZsnWdkK8UzKtp1Ku4lwUrhu+AwwQ8r0ndRuhyHZ1lkLQ3hoIq/s 9YZMktstN/KHA== 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)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D1BCF3781139; Wed, 12 Jun 2024 17:32:21 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 607274800CF; Wed, 12 Jun 2024 19:32:21 +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, kernel@collabora.com, Sebastian Reichel Subject: [PATCH v5 4/5] arm64: dts: rockchip: Add VEPU121 to RK3588 Date: Wed, 12 Jun 2024 19:15:44 +0200 Message-ID: <20240612173213.42827-5-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240612173213.42827-1-sebastian.reichel@collabora.com> References: <20240612173213.42827-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-LSpam-Score: -2.6 (--) X-LSpam-Report: No, score=-2.6 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_PASS=-0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no From: Emmanuel Gil Peyrot RK3588 has 4 Hantro G1 encoder-only cores. They are all independent IP, but can be used as a cluster (i.e. sharing work between the cores). These cores are called VEPU121 in the TRM. The TRM describes one more VEPU121, but that is combined with a Hantro H1. That one will be handled using the VPU binding instead. Signed-off-by: Emmanuel Gil Peyrot Signed-off-by: Sebastian Reichel --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 6ac5ac8b48ab..9edbcfe778ca 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -1159,6 +1159,86 @@ power-domain@RK3588_PD_SDMMC { }; }; + jpeg_enc0: video-codec@fdba0000 { + compatible = "rockchip,rk3588-vepu121"; + reg = <0x0 0xfdba0000 0x0 0x800>; + interrupts = ; + clocks = <&cru ACLK_JPEG_ENCODER0>, <&cru HCLK_JPEG_ENCODER0>; + clock-names = "aclk", "hclk"; + iommus = <&jpeg_enc0_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + jpeg_enc0_mmu: iommu@fdba0800 { + compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; + reg = <0x0 0xfdba0800 0x0 0x40>; + interrupts = ; + clocks = <&cru ACLK_JPEG_ENCODER0>, <&cru HCLK_JPEG_ENCODER0>; + clock-names = "aclk", "iface"; + power-domains = <&power RK3588_PD_VDPU>; + #iommu-cells = <0>; + }; + + jpeg_enc1: video-codec@fdba4000 { + compatible = "rockchip,rk3588-vepu121"; + reg = <0x0 0xfdba4000 0x0 0x800>; + interrupts = ; + clocks = <&cru ACLK_JPEG_ENCODER1>, <&cru HCLK_JPEG_ENCODER1>; + clock-names = "aclk", "hclk"; + iommus = <&jpeg_enc1_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + jpeg_enc1_mmu: iommu@fdba4800 { + compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; + reg = <0x0 0xfdba4800 0x0 0x40>; + interrupts = ; + clocks = <&cru ACLK_JPEG_ENCODER1>, <&cru HCLK_JPEG_ENCODER1>; + clock-names = "aclk", "iface"; + power-domains = <&power RK3588_PD_VDPU>; + #iommu-cells = <0>; + }; + + jpeg_enc2: video-codec@fdba8000 { + compatible = "rockchip,rk3588-vepu121"; + reg = <0x0 0xfdba8000 0x0 0x800>; + interrupts = ; + clocks = <&cru ACLK_JPEG_ENCODER2>, <&cru HCLK_JPEG_ENCODER2>; + clock-names = "aclk", "hclk"; + iommus = <&jpeg_enc2_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + jpeg_enc2_mmu: iommu@fdba8800 { + compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; + reg = <0x0 0xfdba8800 0x0 0x40>; + interrupts = ; + clocks = <&cru ACLK_JPEG_ENCODER2>, <&cru HCLK_JPEG_ENCODER2>; + clock-names = "aclk", "iface"; + power-domains = <&power RK3588_PD_VDPU>; + #iommu-cells = <0>; + }; + + jpeg_enc3: video-codec@fdbac000 { + compatible = "rockchip,rk3588-vepu121"; + reg = <0x0 0xfdbac000 0x0 0x800>; + interrupts = ; + clocks = <&cru ACLK_JPEG_ENCODER3>, <&cru HCLK_JPEG_ENCODER3>; + clock-names = "aclk", "hclk"; + iommus = <&jpeg_enc3_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + jpeg_enc3_mmu: iommu@fdbac800 { + compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; + reg = <0x0 0xfdbac800 0x0 0x40>; + interrupts = ; + clocks = <&cru ACLK_JPEG_ENCODER3>, <&cru HCLK_JPEG_ENCODER3>; + clock-names = "aclk", "iface"; + power-domains = <&power RK3588_PD_VDPU>; + #iommu-cells = <0>; + }; + av1d: video-codec@fdc70000 { compatible = "rockchip,rk3588-av1-vpu"; reg = <0x0 0xfdc70000 0x0 0x800>; From patchwork Wed Jun 12 17:15:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 102395 Received: from am.mirrors.kernel.org ([147.75.80.249]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sHRr2-0000Dw-37 for patchwork@linuxtv.org; Wed, 12 Jun 2024 17:33:49 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BC4741F21407 for ; Wed, 12 Jun 2024 17:33:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 962CB18509A; Wed, 12 Jun 2024 17:32:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ChRObb4c" X-Original-To: linux-media@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA8AF1836F7; Wed, 12 Jun 2024 17:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213548; cv=none; b=VpOKqkxrp+2qJHlXaO1i5GWFv6PIoJ+R0KSotAGOVX6H/lD6nDdWV5uPkUN3tpfG2K41IGxI6C9t33mQvCCVFKDQCAxIEHIaqjB2/5D0NPwt2XC7DLzOw1ElRJKt00xBPCnJBZt8DPHxXD1j3kF+Ils87cnMWtpwaSr1RRkPa5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718213548; c=relaxed/simple; bh=09CuY792gYzujtrKgRSq5WilLJwPVg6zDs+yUzN6Tus=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U1d7g1xoc0IuhAKmcDwFqBwv1rXaH23hgQMfK9lPPK+v86BxEk74hARCAOoYGbC3aEe4DGEA5p13YyTxZ4VKmi/8Xl8nWnqTF2Owz6qYWK3N61ncxfhWXcIE2kGrLtVFsgrI6nTz/+EIGXyCIIOO0Jr00VhNOtzlMU7/BGph5V0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ChRObb4c; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718213542; bh=09CuY792gYzujtrKgRSq5WilLJwPVg6zDs+yUzN6Tus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ChRObb4cGRQZCu7ko5Pmmb3VO70BNnD1QJBg+PJckCN1aDpi+ABBzjsl+VfAIPrwx miEp470WoHAj1pEiLwbGAbZTta0smRqyjwEZOXkazG55sUZctz+17lKJQ3qQqxsUlU n7ogL6s/897T+61wHIKarYCgKscaPcw1tC7ENA4UMR8Lz5XwbxoNTrehhmMJvaEkfs mrA47oip4cdMHnNF+Nf1prOzycQIpC5fSAYnCOHBPrXTUw7HLC1GA53ZAiR3IqSALq uOF3fGKByuDD9q88p93qgoL51GRmjqHR1mMs7MCcskL3Vnh662CmRnr5+vXjodEk8B m/AgKX1gDZW1A== 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)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 3260037821A3; Wed, 12 Jun 2024 17:32:22 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 624CA4800D0; Wed, 12 Jun 2024 19:32:21 +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, kernel@collabora.com, Hugh Cole-Baker , Sebastian Reichel Subject: [PATCH v5 5/5] arm64: dts: rockchip: Add VPU121 support for RK3588 Date: Wed, 12 Jun 2024 19:15:45 +0200 Message-ID: <20240612173213.42827-6-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240612173213.42827-1-sebastian.reichel@collabora.com> References: <20240612173213.42827-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-LSpam-Score: -2.6 (--) X-LSpam-Report: No, score=-2.6 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_PASS=-0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no From: Jianfeng Liu Enable Hantro G1 video decoder in RK3588's devicetree. Tested with FFmpeg v4l2_request code taken from [1] with MPEG2, H.264 and VP8 samples. [1] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch Signed-off-by: Jianfeng Liu Tested-by: Hugh Cole-Baker Signed-off-by: Sebastian Reichel --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 9edbcfe778ca..e7e1b456b9b9 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -1239,6 +1239,27 @@ jpeg_enc3_mmu: iommu@fdbac800 { #iommu-cells = <0>; }; + vpu: video-codec@fdb50000 { + compatible = "rockchip,rk3588-vpu121", "rockchip,rk3568-vpu"; + reg = <0x0 0xfdb50000 0x0 0x800>; + interrupts = ; + interrupt-names = "vdpu"; + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>; + clock-names = "aclk", "hclk"; + iommus = <&vpu_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + vpu_mmu: iommu@fdb50800 { + compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; + reg = <0x0 0xfdb50800 0x0 0x40>; + interrupts = ; + clock-names = "aclk", "iface"; + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>; + power-domains = <&power RK3588_PD_VDPU>; + #iommu-cells = <0>; + }; + av1d: video-codec@fdc70000 { compatible = "rockchip,rk3588-av1-vpu"; reg = <0x0 0xfdc70000 0x0 0x800>;