From patchwork Thu Jun 13 13:48: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: 13696870 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 65030161; Thu, 13 Jun 2024 13:50:38 +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=1718286641; cv=none; b=HM3j8YqnyCbinvqQvWrPZFRawEyB2v0x7ufoRcdSSkcW2tl0kcZU0t9med+ZeogRv6tKgkJE3rTxBzOQv7UC7/qm+jfsokX4wuScsqqPyKhocivAJR852djEpgjpIrjqpnKiPrT7xlXRl4bK+KA75m7HjyMqxVM+3C4ztLJr3Vw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718286641; c=relaxed/simple; bh=2uEIOesLQHzaqO6vKfZg0vEOytHcpsJFgIleLYwBBGA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oDmhX9EBtfDLEJAiCt6jg90xlW0/YnLFRJTgTIcA64LDuH43kOpumUD8kwsCW5puLiZTVc5WgIC/F0ychd71S6Vs7anb0RxgYJTCVC1lzFtpzpuCVcNKak3aMhftmAmXxxlFPs30ivG6nid2hiwPLhT0kJUAU4y32k+PTxk7uWA= 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=MPt6pxRN; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="MPt6pxRN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718286636; bh=2uEIOesLQHzaqO6vKfZg0vEOytHcpsJFgIleLYwBBGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MPt6pxRN7/zHLC3goTa9KUrzG7tetBPTvObF4qbQzAktB6zaMTlkCl7jXvfWJgcfL s1wSGn0qlfTJmZYlmWq/UV92Vt5z+bqtFxDuMDHN3nckwd140zEg+TERMBGBYcbVJc YK9QGPtncO+NZiS/5bgvwDnlQ4ELW8wfHyzrVMRrQM7+WFNmbfLndRtzb4mzUMaHlS G6x/MXz4Iy5wngs5CwqI8MEZuWapIaTX0fLyNMiwKsHJjUJ3jnSj06ifcMVCu01TBF 7dHypr+PIy9TRA37pyKz5SkuDJkcYz7vjRrtxLpyUbT5sPb/GkFie83gEDMuNF/6HY Jy6d8JHC6b7/g== 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 8618637820CD; Thu, 13 Jun 2024 13:50:36 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 330784800C7; Thu, 13 Jun 2024 15:50:36 +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 v6 1/6] media: dt-bindings: rk3568-vepu: Add RK3588 VEPU121 Date: Thu, 13 Jun 2024 15:48:42 +0200 Message-ID: <20240613135034.31684-2-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240613135034.31684-1-sebastian.reichel@collabora.com> References: <20240613135034.31684-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 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 Acked-by: Conor Dooley --- .../devicetree/bindings/media/rockchip,rk3568-vepu.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml b/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml index 9d90d8d0565a..947ad699cc5e 100644 --- a/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml +++ b/Documentation/devicetree/bindings/media/rockchip,rk3568-vepu.yaml @@ -17,6 +17,7 @@ properties: compatible: enum: - rockchip,rk3568-vepu + - rockchip,rk3588-vepu121 reg: maxItems: 1 From patchwork Thu Jun 13 13:48: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: 13696866 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 8D6E0144D18; Thu, 13 Jun 2024 13:50:38 +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=1718286640; cv=none; b=ByGOAQVS07CLg1Oj9HAKKplWkkz0ju9tGYMheTLtiv0d74OOxotE5aJ4ZUfZjxMyCDA0Ing6chFDxXaFmxpvYil5MyYYMoS284U3bg74uGKCG4+CimIBfAVyE5tGcHzpduf4SFfSrYNeX4HjDBfjFajp2xq1Up+atkp/u7ytQZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718286640; c=relaxed/simple; bh=qT3T7wi3nE+eFhkZ2bUnCRb/SyRrxFgNwM5t87xUarI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qME1jon14AJTdwPE7y8fY6IP0jVOLwn9rxNKYTsrr9OfTB9UtbLX/6wxn7hukWBD8+aeGxOZ7sWo8mpaRpJcpUxUAuPEWSrhfX614qZExrmAZDjgO1ilgsO+57I2Q51h+UJT9XVLtHfRPtBPc/f71vtSt1yneuM7eNUiDtDizi8= 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=cPROAiVX; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="cPROAiVX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718286636; bh=qT3T7wi3nE+eFhkZ2bUnCRb/SyRrxFgNwM5t87xUarI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cPROAiVXeeUDKIBYFW2Vw1uHI6CZqvs99dmHUIt+mEt5T+f4QyliV258zRnEJ7/tc fCJld725QP2D4L/m7sPxyvCGewAqxapNDZBDhhe/fzisKouRruezQXvzPfx2F1xFUt JnlGvMO7RNzitdYE3vxxfQ6sRtkaKDjGLmf8835S4pC6A5rz7r9Jv5f0WUMnckUIiS XPZDC2//kmfxMZ4f4uvp0W06iU7GNk3WSNDtVt1llLYA6zTCfwOJfIsWdrmfrQZ1Tj zg9apN2V+NBVKChcB88n+EUvkK4aXUGo6kNEDq/mXMf3BQLyxSYmQlH/zQPBSW7ko2 8n+kQ11XxUAzA== 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 891C33782199; Thu, 13 Jun 2024 13:50:36 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 34ECC4800CD; Thu, 13 Jun 2024 15:50:36 +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 v6 2/6] media: dt-bindings: rockchip-vpu: Add RK3588 VPU121 Date: Thu, 13 Jun 2024 15:48:43 +0200 Message-ID: <20240613135034.31684-3-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240613135034.31684-1-sebastian.reichel@collabora.com> References: <20240613135034.31684-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 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 Thu Jun 13 13:48: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: 13696867 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 8D726144D21; Thu, 13 Jun 2024 13:50:38 +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=1718286640; cv=none; b=PdKr7UyeBOMeCmJTczqOVhg309NGGJ6CuiZ3LHgSEQw2gwbQx7tqY/qRxX+w9VHGsxhyMD7F64nDFHgRS/9YaVk3hnc39RUvnf/IrF0o0mSPRTy4syKIS4/omP/llrwMv6xz99hh6dxw/fSvxIKOANi/uUrpVBjj2rYEgBw2yiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718286640; c=relaxed/simple; bh=th5seJF3vBX+X27ODP/uDhCZmMW2KCKtk8juv3MEKfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D7zziaaBYQwyf58IYu6UlFRHQRYFZunnjt/7FqfcfJiIxJnTjUEi3u9XYQoT3JhrXnOIGHlfMRXRGUPHEPmjnzPehb1MHxMjOMnVTJTGGlTqnBgsTumxYiylmWCV9jMUPzSnEJtW7z1oOLtuT+7dwsAh2lTAxsU2Nc5XK9Z2Tnc= 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=n0FUOv3a; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="n0FUOv3a" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718286636; bh=th5seJF3vBX+X27ODP/uDhCZmMW2KCKtk8juv3MEKfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n0FUOv3agw37r9+4v5v97sFRYeVfEt9Poau2rpub37bk0MsW5XfHXFPpWrAcyZlsT xBiSmd/Av8NAZQjq8Op066tgjYtjv1cBDX9ZUxuT6FKcMDOgz9298q4F4AI/7PzVYP npg6AXeFRXzFZzQgzcnTRWpRIEzJIk+Kv5SYtt0FzlPYXzVc/LsAHnSzxcGT0p+VGc t9tGN/6WY6h++/VeLdedjlzv6liz/UTcmZyM5333OZhlzNWcwJ1NrZCo8QLa1qNm/F 7MwLHyywoqROiDYEHrwcSATTvSk3k1l9RmnSgwqTqhO5Bz7s20uaRORvmG47rx6PEY qOdqi/oNebkFA== 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 997DA37821B5; Thu, 13 Jun 2024 13:50:36 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 36AB84800CE; Thu, 13 Jun 2024 15:50:36 +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 v6 3/6] media: hantro: Disable multicore support Date: Thu, 13 Jun 2024 15:48:44 +0200 Message-ID: <20240613135034.31684-4-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240613135034.31684-1-sebastian.reichel@collabora.com> References: <20240613135034.31684-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 Avoid exposing equal Hantro video codecs to userspace. Equal video codecs allow scheduling work between the cores. For that kernel support is required, which does not yet exist. Until that is implemented avoid exposing each core separately to userspace so that multicore can be added in the future without breaking userspace ABI. This was written with Rockchip RK3588 in mind (which has 4 Hantro H1 cores), but applies to all SoCs. Signed-off-by: Sebastian Reichel --- .../media/platform/verisilicon/hantro_drv.c | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 34b123dafd89..7123479b3eab 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -992,6 +992,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 +1044,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 Thu Jun 13 13:48: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: 13696868 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 CDDBBDF71; Thu, 13 Jun 2024 13:50:38 +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=1718286640; cv=none; b=uJbQNe3vEoc/VjpRo4V8QrApPWCXhPCvPjh4PWOJEpqFjCsk0h1+Aqayrnns1p6Fptxnj/taWkvh/ny2UUSnZ9drggb7XqMHn558qX5dWa2zBgFeUrLn8QeeAOAGK/fWnwj2/QzlBfveGVmVap0sxkTIbd0ZPJQEgH3PpwSzWu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718286640; c=relaxed/simple; bh=MCk2lzzT75gHxafgWjjiBI07jtmvCzegEvxmJbMmkDI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SkFgTREA9z2q3KfuBMls97DXL2b14SVkt5s1e0Irc5A3E2MnC8TzMKCDpv1nkgB/wEIp8+R6IPtNBDrVrFEzaFNDW9hSXqbxgHKQvfyYz/rgfnt6P8kxMQoc5xuJe1cF2coPNNXh61Ra6rQj+GYmAuKOIlViAyURU5mE5JrJwro= 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=S8zWAkR+; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="S8zWAkR+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718286636; bh=MCk2lzzT75gHxafgWjjiBI07jtmvCzegEvxmJbMmkDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S8zWAkR+4IInOh9HuDdNm6i9uq+f6Luj36N8qMjKtt8w4yzUd8h/Hx4prm9BwZvt0 NeKVOprZAM7HlVwM/b+It6G412IxKWpftegr9qtTGpkTJEf8pws/3fecZ7aA5WKIS+ O5ZmjmwKtVdU4jh1EFiFmrAe/t7FTi8Pr+98IGpW5y1NFlE9eqE+QomaOB8RDKiN4/ wsNgqX6K8welzq1Z0Uh8gZTEIERYlULrnoZ5i1Y7Bz+GLVIFvkrvIpyrCAfTyAoE2r f5Cx5Pi7JUMAPEYEToq+Rrwn6tpkC5KYCScErtxV/TW1J5v48PupUjaBnVTNsGVJyE LbKdwKS89pBSw== 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 A45E237821B6; Thu, 13 Jun 2024 13:50:36 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 387384800CF; Thu, 13 Jun 2024 15:50:36 +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 v6 4/6] media: hantro: Add RK3588 VEPU121 Date: Thu, 13 Jun 2024 15:48:45 +0200 Message-ID: <20240613135034.31684-5-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240613135034.31684-1-sebastian.reichel@collabora.com> References: <20240613135034.31684-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 RK3588 handling is exactly the same as RK3568. This is not handled using fallback compatibles to avoid exposing multiple video devices on kernels not having the multicore disable patch. Signed-off-by: Sebastian Reichel --- drivers/media/platform/verisilicon/hantro_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 7123479b3eab..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 From patchwork Thu Jun 13 13:48:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13696872 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 B4482145FE3; Thu, 13 Jun 2024 13:50:41 +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=1718286643; cv=none; b=MAYU0hylP9pMyxAGrLwr/Z1igOWUvWkdnQtdOMp5sbbIGjcxmIW9QFBZo95c6l/VrrO/nTEbiUf47OgwKbiQ3COwkCymWIddl0cF0nlZkhxn5nO+qAI8nc4RVu8eQDmg4sQkh8YC5716BtJBIAJ5RG87gsLXcINog5E43RX1J/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718286643; c=relaxed/simple; bh=JWRpO8n0qfJ/LE7k1lFWnR99Wqz0mOCN8aOE7S7nk+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qkeq3LXSGCq8N3Budr31FVkNnTLoCdPbvcYjUv77ix/P6rCyHUOrpxhY+xian9TdFzNju17POMhoHOUtu0vwbXL7dg7quzv8bSkEIva8OlxpEKxjtZ5kE/0B0DNfO/rQO0Dgilg6yrzyH7x1mgESrmDiC4tUSK9XaStX1NmlVCo= 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=oLzfqXLM; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="oLzfqXLM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718286637; bh=JWRpO8n0qfJ/LE7k1lFWnR99Wqz0mOCN8aOE7S7nk+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oLzfqXLMQHV0tQG8tRH8y30stFVoMzixKnoDXWXyxXfM3g1ZQw9J6MhtWt5j5p3rX mWif4R46rm68J4jx+HjKZv6+SfuAK/al6Zb/Hgv4AsfcMGEqgs/JKTfeObFgiPtT0B IvM2CJr/RJpgb3Y9kQpApJO9O2tjYhOCPHxObteB4pMEfWa/YYqAGS2/QpIACW3B8w ZHx+o4+qICXJ3E3rFhQ3G1U84OO/+CxWezH33355FLVgYp6qjDXuopgBV0aBRc0mv3 eIxAb6o8tLCRcFrB2whr32Xy9ATKwIwBsKHHkw5MAyr2/YGkGN2YaxvCo8nbPLacNT yV2wo3kpa9KUg== 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 1773537821B7; Thu, 13 Jun 2024 13:50:37 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 3A4A04800D0; Thu, 13 Jun 2024 15:50:36 +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 v6 5/6] arm64: dts: rockchip: Add VEPU121 to RK3588 Date: Thu, 13 Jun 2024 15:48:46 +0200 Message-ID: <20240613135034.31684-6-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240613135034.31684-1-sebastian.reichel@collabora.com> References: <20240613135034.31684-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 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 Acked-by: Nicolas Dufresne --- 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..dd85d4e55922 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 { }; }; + vepu121_0: 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 = <&vepu121_0_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + vepu121_0_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>; + }; + + vepu121_1: 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 = <&vepu121_1_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + vepu121_1_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>; + }; + + vepu121_2: 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 = <&vepu121_2_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + vepu121_2_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>; + }; + + vepu121_3: 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 = <&vepu121_3_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + vepu121_3_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 Thu Jun 13 13:48:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13696871 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 B4431145FE2; Thu, 13 Jun 2024 13:50:41 +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=1718286643; cv=none; b=AcZhc8NLjsGN1ETXMIhFFKH2TPHv1uSaIWtbmfAIRi4kkkylrSW7v6ng8I+DWDFDTmbwGQ6gZ/Idlr0uw91WbuulbFGN8bpb+Ol/Cx+WreMGlJY7BBoP00xd4dVUxbQZfOIDeLhOEwUa3CYDtpsBN3Dj50SZuGZL9N6E3A7bbqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718286643; c=relaxed/simple; bh=cqxhYAbbW9RM1md+oyI3TV89a9uLQWQLY+gbU0lSp64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B3xz6xBR+rgxaXuUrhgSBwVxq0TqjRTrdizhPY3RzIH05Lu0wAGXkCTGn9okL3B87LwwVoYGx/CeOyPwgXIG6Css8VEPpOAUkT5pR6KGanppUya5fe9ngqjhOkB2FzicKM/TpPSRPz6FWVun+l4ynIq/ZGmcXhVKcPamitrAs4Y= 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=kxMb9TSi; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="kxMb9TSi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718286637; bh=cqxhYAbbW9RM1md+oyI3TV89a9uLQWQLY+gbU0lSp64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kxMb9TSi959KemdHRj9cgYD5sDcaqyd+1y+1apZhIUERXVE7T/jTOCr2+TVjdnCSv 54VyZP6bzMSVHb8xcnVV5OuX6qmqiXn3yEV+kpsXw/kVJ0+37hHX7mSD69bsqT3N+k SR9hpJ2Sg5YWmyoSx2YZSxLfdAMMetrdzw9/WctZbCcjpZ5xlGhZWcYbirEenp4Pqe vlRhk0y5PsnSrvWtVxCJfkHySVBcf9Xa+rxDAAWUDxv29DVLoF8h1LKvHAjd8qd52k XOE4hy+AKZEY8Z2SVzl32NUKiysPDZflIy/Sw4mJSs2ztnb+g+a4Mrc7hVOLen6h+s uhEoDnIyGwTsQ== 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 185C337821B8; Thu, 13 Jun 2024 13:50:37 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 3C30C4800D1; Thu, 13 Jun 2024 15:50:36 +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 v6 6/6] arm64: dts: rockchip: Add VPU121 support for RK3588 Date: Thu, 13 Jun 2024 15:48:47 +0200 Message-ID: <20240613135034.31684-7-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240613135034.31684-1-sebastian.reichel@collabora.com> References: <20240613135034.31684-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 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 dd85d4e55922..c0466982646f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -1159,6 +1159,27 @@ power-domain@RK3588_PD_SDMMC { }; }; + vpu121: 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 = <&vpu121_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + vpu121_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>; + }; + vepu121_0: video-codec@fdba0000 { compatible = "rockchip,rk3588-vepu121"; reg = <0x0 0xfdba0000 0x0 0x800>;