From patchwork Wed Dec 27 17:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianfeng Liu X-Patchwork-Id: 13505422 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 034B44654D for ; Wed, 27 Dec 2023 17:40:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mkEuuYR2" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-28c7e30c83fso742189a91.1 for ; Wed, 27 Dec 2023 09:40:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703698824; x=1704303624; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gwaYM1PH1SgDuz8j6xYAmjET/NuMiIbLCMJmRCvooPc=; b=mkEuuYR2Oe8QDlepIEJqbobfTL0KVDAbB497Sc7BXqfRG8aQV0rOI269zJdvO6lc5S K5q1w58SG+GPuPb2uRO1KBL49xwoK6Xds6iJbWoAATX0DlLNWGvbP4WstvsX0lQOPeUQ krVUj3aNx7vVKSJBdks6nb16jMdyt1QX9m7lMPrtkG+bJnrLkUDYAQRBxJMLqoFmu3AT WkJ5CaM3Iv5Q84Ab/UsoFUV6nC42pxi2Timr4pUDFIP0Q//qWLmGtVOBMqHgbRM5aZwZ UT3udZpqBj7ru3epPfa3YYA6jk4kFk1LleXZVwEbprN54fFx0PrVhToMR+p9iXFDPqG7 FB7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703698824; x=1704303624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gwaYM1PH1SgDuz8j6xYAmjET/NuMiIbLCMJmRCvooPc=; b=Wp530bdYBPR7j2yTeQVEVyKigU1RvybeZNFbp6hAlbU9z1udQVRbl2bB3/jcImWceg YCVH5FqFjbRiBVu/VRszXicpn+7S1lwcvhbG7Mq3IJ3/5YgoZhbY+/n8A85n4RBucW6c kXYnmKJ8biU2nbkal2FwOI2aSFwMEwa4zOyPbulbmRs7ruUBZE1jv/AObWHOAzCG5oh1 sdInIkL7hBKbEZAJrcIkNk3iIicGyZZdp4hZ1WQh5RlztkHASi9YTe7qfn+bIPicQxv4 coc/Yd5Brno9uYWw2zM5nqNhl/kZ5nk2QOwoMh9JqhAGwg3CPP7z23UvKMO6pQQSmCRr wiHw== X-Gm-Message-State: AOJu0YwfBZWlHwzzsGaL3gE6pwF/QolKPOPc5AtkmiEgHDLsrMZYCX57 3qdy/5lmU6tulQRsTQxig6hu7yhfMXrFiSlydKN0CA== X-Google-Smtp-Source: AGHT+IEkoXdtxaXTBOKfUNSDG1JYl5u4z0jBjeXdXyn/IMVZsgY34HskJAzpRrLSwTtL0qu7M/msSw== X-Received: by 2002:a17:90b:2287:b0:28b:f2e2:6158 with SMTP id kx7-20020a17090b228700b0028bf2e26158mr2485270pjb.56.1703698823837; Wed, 27 Dec 2023 09:40:23 -0800 (PST) Received: from localhost.localdomain ([2408:8207:2540:8c00:3708:559:ea20:9883]) by smtp.gmail.com with ESMTPSA id qb4-20020a17090b280400b0028aecd6b29fsm17240262pjb.3.2023.12.27.09.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 09:40:23 -0800 (PST) From: Jianfeng Liu To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: liujianfeng1994@gmail.com Subject: [PATCH 1/3] media: verisilicon: Add support for Hantro G1 on RK3588 Date: Thu, 28 Dec 2023 01:39:09 +0800 Message-Id: <20231227173911.3295410-2-liujianfeng1994@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227173911.3295410-1-liujianfeng1994@gmail.com> References: <20231227173911.3295410-1-liujianfeng1994@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This patch adds support for RK3588 in existing Hantro video decoder kernel driver. 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 --- drivers/media/platform/verisilicon/hantro_drv.c | 1 + drivers/media/platform/verisilicon/hantro_hw.h | 1 + .../media/platform/verisilicon/rockchip_vpu_hw.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+) -- 2.34.1 diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index db3df6cc4..4c988f272 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-vpu", .data = &rk3588_vpu_variant, }, { .compatible = "rockchip,rk3588-av1-vpu", .data = &rk3588_vpu981_variant, }, #endif #ifdef CONFIG_VIDEO_HANTRO_IMX8M diff --git a/drivers/media/platform/verisilicon/hantro_hw.h b/drivers/media/platform/verisilicon/hantro_hw.h index 9aec8a79a..276f09a7a 100644 --- a/drivers/media/platform/verisilicon/hantro_hw.h +++ b/drivers/media/platform/verisilicon/hantro_hw.h @@ -405,6 +405,7 @@ extern const struct hantro_variant rk3328_vpu_variant; extern const struct hantro_variant rk3399_vpu_variant; extern const struct hantro_variant rk3568_vepu_variant; extern const struct hantro_variant rk3568_vpu_variant; +extern const struct hantro_variant rk3588_vpu_variant; extern const struct hantro_variant rk3588_vpu981_variant; extern const struct hantro_variant sama5d4_vdec_variant; extern const struct hantro_variant sunxi_vpu_variant; diff --git a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c index f97527670..4ee8d64eb 100644 --- a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c +++ b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c @@ -797,6 +797,20 @@ const struct hantro_variant px30_vpu_variant = { .num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names) }; +const struct hantro_variant rk3588_vpu_variant = { + .dec_offset = 0x400, + .dec_fmts = rockchip_vdpu2_dec_fmts, + .num_dec_fmts = ARRAY_SIZE(rockchip_vdpu2_dec_fmts), + .codec = HANTRO_MPEG2_DECODER | + HANTRO_VP8_DECODER | HANTRO_H264_DECODER, + .codec_ops = rk3399_vpu_codec_ops, + .irqs = rockchip_vdpu2_irqs, + .num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs), + .init = rockchip_vpu_hw_init, + .clk_names = rockchip_vpu_clk_names, + .num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names) +}; + const struct hantro_variant rk3588_vpu981_variant = { .dec_offset = 0x0, .dec_fmts = rockchip_vpu981_dec_fmts, From patchwork Wed Dec 27 17:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianfeng Liu X-Patchwork-Id: 13505423 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80D4B46542 for ; Wed, 27 Dec 2023 17:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T5afg97h" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-28c7c422ad9so1125011a91.3 for ; Wed, 27 Dec 2023 09:40:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703698826; x=1704303626; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Eiz0fylx3s+eC9GIkVjZ8U5D1rTDiaiV9DlEcXV1OkM=; b=T5afg97hDfNo3WIREmw1HncS/bvNyNVueKx207pTD1F7jL8k3w/mdhzy8D6Uef80xc jOKlZCZ2bW4Dzm6hqpO6rbrZaco01Wa+CeHcmsnnCPcpiyDjWU9PBYwVuzMHq51V0I+n MxLQMBBwKM5RbRIWt+29aL1Es7wNjae91/QZZ8U28JZlSEjMtNyPqWW112gfIRtIe27p w3Z9VfD8CeQGNAgiZCWHZgpGt3Nys+PL4tIXEV/4B2J6Ibc5iaEWI3ACKflm9J+7fCfy XboHaL54SQgOqAJjhrJQ/aEPy9gH8kpxxzhpqsLRsZ/ekUJJZiz6SoA3BCGAvE3XgXHv IGoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703698826; x=1704303626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Eiz0fylx3s+eC9GIkVjZ8U5D1rTDiaiV9DlEcXV1OkM=; b=ALO7MTgQDoLuKGQK3LJosKBFDYT6spzwjPjoUX+XKH3/1FlyJoNuddpZMrGxjf3eeY jR7UJqcFK7zAdqNiJFTQpzi3jXbvp5/VMKHI3EWXl+TWd/JYyfRg8bytD79TFXOvN0zY 0VtAtZ0G30iqEl0XPc1mMsfgwCBjYbDI7IRZbXCvzEADtxEs6YaM1t0NPo5rYs4gHkIq +scKPCwBrALogQWO0k2k7HpyaGWaHIJa2SAy7ONPO5g0xdwOzxLlre148mAM46NYyvyW fUlbeL8SSJKYR6Wokmg8yc0REebQEzTP9C9P5VeGQkyYZ2H6g4W/Z9wlKQUA3IAbyDef XIOg== X-Gm-Message-State: AOJu0Yz4RrixraypD8xUQbVupkI252GrKt/lrBWuGHn3+g4Lns8WyQcu dmLIXhC8LJvUSkcTpYfR019oqyRbWLvdspJFNuG2jw== X-Google-Smtp-Source: AGHT+IFKmm9teGcP+8Tna2sHM7S2jEdgKLyhWGg1bBDaANSKgJHF9IGW9NXOMBQug9eUS3RxNhK9UA== X-Received: by 2002:a17:90a:d3c8:b0:28b:b995:c886 with SMTP id d8-20020a17090ad3c800b0028bb995c886mr4477592pjw.82.1703698825952; Wed, 27 Dec 2023 09:40:25 -0800 (PST) Received: from localhost.localdomain ([2408:8207:2540:8c00:3708:559:ea20:9883]) by smtp.gmail.com with ESMTPSA id qb4-20020a17090b280400b0028aecd6b29fsm17240262pjb.3.2023.12.27.09.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 09:40:25 -0800 (PST) From: Jianfeng Liu To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: liujianfeng1994@gmail.com Subject: [PATCH 2/3] arm64: dts: rockchip: Add Hantro G1 VPU support for RK3588 Date: Thu, 28 Dec 2023 01:39:10 +0800 Message-Id: <20231227173911.3295410-3-liujianfeng1994@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227173911.3295410-1-liujianfeng1994@gmail.com> References: <20231227173911.3295410-1-liujianfeng1994@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This patch enables Hantro G1 video decoder in RK3588's device-tree 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 --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.34.1 diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 5fb0baf8a..b3536e097 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -708,6 +708,26 @@ vop_mmu: iommu@fdd97e00 { status = "disabled"; }; + vpu: video-codec@fdb50400 { + compatible = "rockchip,rk3588-vpu"; + reg = <0x0 0xfdb50000 0x0 0x800>; + interrupts = ; + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>; + clock-names = "aclk", "hclk"; + iommus = <&vdpu_mmu>; + power-domains = <&power RK3588_PD_VDPU>; + }; + + vdpu_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>; + }; + uart0: serial@fd890000 { compatible = "rockchip,rk3588-uart", "snps,dw-apb-uart"; reg = <0x0 0xfd890000 0x0 0x100>; From patchwork Wed Dec 27 17:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianfeng Liu X-Patchwork-Id: 13505424 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9710D46529 for ; Wed, 27 Dec 2023 17:40:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W52Dm1qg" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1d3aa0321b5so44105345ad.2 for ; Wed, 27 Dec 2023 09:40:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703698828; x=1704303628; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XvNJhug4GM8oN3uUr85wWPaav17uENPDOjuSlTTZUGs=; b=W52Dm1qg5GtjlGMe4RJRknMkMLi8fnGDuhJLgCL5El8TgS8ut/EoJCV1jO+SpVmnCU gIo5RgEdZhLE7xJaSrN/ToAcaWGtmwMtTElUc9HxBSBNhm/cOdfGVlGch5DHeKuEfdbP 9/pvjO+2Mkrazg5ZyhbzN30psZbEyef42h0olcfxps5pjCKNiu3oQa99VUy6JTUhADo1 qYw8Q4yti751hoxc3oF5m7hKVcQDK7vQSmkUqwWxS4XpxUE4DfohW11YtWb7iwUP2BT5 hfnsZ12n2dpehQm+FNGXwbytd0remICbC/SjBUgHBBZwEyUwAXgKLgS01ceeNElkWtn8 xieA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703698828; x=1704303628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XvNJhug4GM8oN3uUr85wWPaav17uENPDOjuSlTTZUGs=; b=DWz6gKLr4uop9EK57oVLBKxbuHCqSdPGdCsShM+2Bu0Odsliwy7sxBWiQ+y5d0HRW6 o1Yh8ZrPaJL1lJhwwWUogHXE0Kf/Yb2eUWokix0CrxVP39a7tg+yU7FUzY24TospuoVS 2P314ps3P8tj7E5T+joB97oAtGqfnLrbDzzwU00zR9lpgUQ3Ow9F/MvD0tet1s3Ij4pT LY0gD2ocKR5pO7E+6RM2SapMC6uC61KrDnlKcN9VK3HnNoZfRelBy5tXkYpIctJfdIYX o0iVQ4m1oMsWtxlVM2qzJeEHKbJqFyi8Cycyu3ItCkPGv3rwJZl6xwtTQEHHIt2JS1l5 FJ9Q== X-Gm-Message-State: AOJu0YwVewbqIQxJhskghIvdV6uBB06GX7K6gnaZJiEBHXVdzJR9RQXs Y0uiPJeW1J5jSi+D2JOSv0CvtU7PlrwdR9kwjl2irQ== X-Google-Smtp-Source: AGHT+IFv2sl1p1gve97lVFrCK/XsXTux44ghUPif7134R+YMyV3AGp05l5GJEcR1dFRJjyWf8EbNnw== X-Received: by 2002:a17:90a:ff03:b0:28c:3b32:bab2 with SMTP id ce3-20020a17090aff0300b0028c3b32bab2mr2675616pjb.98.1703698828529; Wed, 27 Dec 2023 09:40:28 -0800 (PST) Received: from localhost.localdomain ([2408:8207:2540:8c00:3708:559:ea20:9883]) by smtp.gmail.com with ESMTPSA id qb4-20020a17090b280400b0028aecd6b29fsm17240262pjb.3.2023.12.27.09.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 09:40:28 -0800 (PST) From: Jianfeng Liu To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: liujianfeng1994@gmail.com Subject: [PATCH 3/3] dt-bindings: media: rockchip-vpu: Add RK3588 compatible Date: Thu, 28 Dec 2023 01:39:11 +0800 Message-Id: <20231227173911.3295410-4-liujianfeng1994@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227173911.3295410-1-liujianfeng1994@gmail.com> References: <20231227173911.3295410-1-liujianfeng1994@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This patch adds RK3588 compatible in rockchip-vpu dt-bindings. Signed-off-by: Jianfeng Liu --- Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 1 + 1 file changed, 1 insertion(+) -- 2.34.1 diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml index c57e1f488..600ad351e 100644 --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml @@ -24,6 +24,7 @@ properties: - rockchip,rk3399-vpu - rockchip,px30-vpu - rockchip,rk3568-vpu + - rockchip,rk3588-vpu - rockchip,rk3588-av1-vpu - items: - const: rockchip,rk3188-vpu