From patchwork Sun Feb 13 17:13:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Oniszczuk X-Patchwork-Id: 12744634 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B2CEC433EF for ; Sun, 13 Feb 2022 17:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237233AbiBMRN3 (ORCPT ); Sun, 13 Feb 2022 12:13:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232033AbiBMRN3 (ORCPT ); Sun, 13 Feb 2022 12:13:29 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4108558E5B for ; Sun, 13 Feb 2022 09:13:21 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id bu29so20973902lfb.0 for ; Sun, 13 Feb 2022 09:13:21 -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=+IvjBSigw9nyuJJODv2b6IGzdRQsGcbOBUmM9/VOzQU=; b=YirlOw5MCb+osyrDR6LElXOhN0n57tTvvUGMKBjX7b6aQmvp6blBsvrU6rmgd51oGU c4TYXHL8rrBsC7osDzR7L/wE07DXHxWDlE5Zk4v2pATwB0Pfx9u7enZAG1q8a5ApLFRQ kPTs6mSPVx9xQTswBSxmJUGg+9ZjlLIlH1rE4iMSn92gvM2ST439mwIKnec3WfRfen2H u6B+iB4ZqkXgKicdocoJSkc8v6bEUrJQif+yUzvSw2/GzViKM9bWckWcKurJdQf+vKOT ygXMob1yF7F6QYBI7QmW3VlWDsM9b2zXg1PmY5rTIyMkwUv9qJvpHIwpbPHkN0J1QeyX eLfg== 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=+IvjBSigw9nyuJJODv2b6IGzdRQsGcbOBUmM9/VOzQU=; b=hjiC13YryQwETYCCzeF9PBM8dStxKLVbV+RIB8Fw0J/CGOWrUWV6Rl98EdHLLhrMIW lzqGyC8Y2lLji8+y7hIU94FFwpwuWjM1teYxsVJRzL6/cwIA/flfJYM1QSJtCl0j455r 04bl8cct6u+3gP9QZiwN4T29igey708WDzJ1GGfcXIBlnPDEAN1yb81JcVN7UhW9JRM1 cwMPFj8Qrmg5KMU3msignGfQsT2qoD1d7AAG9nwbxKBYkRFwoHKQG5e8WHx3u4WkyGj1 WsQW5KErL2SDKScmpnSCX8NuPG0+fHkZzhSKRGKauFLmmlVC5sP9lc+0DffJ4dbutGCR /C6w== X-Gm-Message-State: AOAM531Usw7Xw7oFIHWcsdWkx63Fc7WnjcsF1AIzccAWVRVDQu32xjId 8uxzO2pUw95VS06y6HAxU1zieMYJuWmzpw== X-Google-Smtp-Source: ABdhPJywpSybPEhfHJgSvcJif9wjv7cpqipiy9L1flKPm8Su6WQaf0yFm3XHN8C3835mWmIZrsD+dw== X-Received: by 2002:a05:6512:68f:: with SMTP id t15mr7721336lfe.124.1644772399382; Sun, 13 Feb 2022 09:13:19 -0800 (PST) Received: from localhost (31-178-191-245.dynamic.chello.pl. [31.178.191.245]) by smtp.gmail.com with ESMTPSA id g6sm3378631lfu.130.2022.02.13.09.13.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 09:13:18 -0800 (PST) From: Piotr Oniszczuk To: linux-media@vger.kernel.org Cc: Piotr Oniszczuk Subject: [PATCH v1 01/03]: media: hantro: Add support for Hantro G1 on RK356x Date: Sun, 13 Feb 2022 18:13:48 +0100 Message-Id: <20220213171349.3924782-1-piotr.oniszczuk@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Piotr Oniszczuk RK356x has Hantro G1 video decoder capable to decode MPEG2/H.264/VP9 video formats. This patch adds support for RK356x family in existing Hantro video decoder kernel driver. Tested on [1] with FFmpeg v4l2_request code taken from [2] with MPEG2, H.642 and VP8 samples with results [3]. [1] https://github.com/warpme/minimyth2 [2] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch [3] https://github.com/warpme/minimyth2/blob/master/video-test-summary.txt Signed-off-by: Piotr Oniszczuk --- drivers/staging/media/hantro/hantro_drv.c | 1 + drivers/staging/media/hantro/hantro_hw.h | 1 + drivers/staging/media/hantro/rockchip_vpu_hw.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c index 6a51f39dde56..ac7d58069eb8 100644 --- a/drivers/staging/media/hantro/hantro_drv.c +++ b/drivers/staging/media/hantro/hantro_drv.c @@ -613,6 +613,7 @@ static const struct of_device_id of_hantro_match[] = { { .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, }, { .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, }, { .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, }, + { .compatible = "rockchip,rk3568-vpu", .data = &rk3568_vpu_variant, }, #endif #ifdef CONFIG_VIDEO_HANTRO_IMX8M { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, }, diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h index 4a19ae8940b9..89ec6d500938 100644 --- a/drivers/staging/media/hantro/hantro_hw.h +++ b/drivers/staging/media/hantro/hantro_hw.h @@ -307,6 +307,7 @@ extern const struct hantro_variant rk3066_vpu_variant; extern const struct hantro_variant rk3288_vpu_variant; extern const struct hantro_variant rk3328_vpu_variant; extern const struct hantro_variant rk3399_vpu_variant; +extern const struct hantro_variant rk3568_vpu_variant; extern const struct hantro_variant sama5d4_vdec_variant; extern const struct hantro_variant sunxi_vpu_variant; diff --git a/drivers/staging/media/hantro/rockchip_vpu_hw.c b/drivers/staging/media/hantro/rockchip_vpu_hw.c index c203b606e6e7..5e64cf068ff9 100644 --- a/drivers/staging/media/hantro/rockchip_vpu_hw.c +++ b/drivers/staging/media/hantro/rockchip_vpu_hw.c @@ -551,6 +551,20 @@ const struct hantro_variant rk3399_vpu_variant = { .num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names) }; +const struct hantro_variant rk3568_vpu_variant = { + .dec_offset = 0x400, + .dec_fmts = rk3399_vpu_dec_fmts, + .num_dec_fmts = ARRAY_SIZE(rk3399_vpu_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 px30_vpu_variant = { .enc_offset = 0x0, .enc_fmts = rockchip_vpu_enc_fmts, From patchwork Sun Feb 13 17:13:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Oniszczuk X-Patchwork-Id: 12744635 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9B16C433EF for ; Sun, 13 Feb 2022 17:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237238AbiBMRNs (ORCPT ); Sun, 13 Feb 2022 12:13:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232033AbiBMRNr (ORCPT ); Sun, 13 Feb 2022 12:13:47 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F07458E5B for ; Sun, 13 Feb 2022 09:13:35 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id m14so4965663lfu.4 for ; Sun, 13 Feb 2022 09:13:35 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=6v6pgISJrHoSxFqvH7sLXG+J+EsPRkUHxiDxTl/cEOk=; b=QYViOVjEfwvKtkkLpqdI/eRZuDwm3iZgNMY72zeexh6HJQN6HDhXHEZcmmez81m4Ou 8te1yYOD0Pre1Fi+zqZspc3OaTeIyxXvalhTVWtNELPeydQe6re2KIyVAlm7rhpXc/Tw BEx/QIxFV6oOsDVB/v6WXIeAM0tZZI5JCvM9OEuuFDr3b2gb9aRWg6h74cftM5JfhPYo XjsOEuRNvaYcozy9RxlnOQUwLUJNsjnMcqpZay+W3BNp9sgji0Nobmch/Hg8qcK5o8X+ qIf55kFi460ELtFCDuyKG56YY4+fClOq7dt6j1H25k7nVqPtsRKXS/oIlpwglzedrehT e6oQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6v6pgISJrHoSxFqvH7sLXG+J+EsPRkUHxiDxTl/cEOk=; b=0Ur9sSn9TjgNtjojsY3wiii6Y9Sd0jNhNJy6sBb+Ll2/pGijmRNt+hSGea/9xoteWa CDYI+/8f81XOyGHbEDSnj1uzIs2LsJojd1+kflj8iXfxVL1jHUBwHDBmaFRptljXTrZT THoIPqxy2iml1d/h0fOv3bcG2BXgivcl8P4jQBIV6m4o+tuQnI+O3cojm5Xsru4eU+Fv kR99RaOo5GmT5+rnGDLT2InyJrawxY7HIgivBo0RxWbIscAHEWxcS4+l/0YNoKNpSaNq frU5WuCUpEaRevn7tG7lMu8N1xfjK0Um8R2Y7RDKp9HTPcSQjwsV1oL7lteFdhlQ4xkm SZkQ== X-Gm-Message-State: AOAM53037RyQ5p1RLWiCzw5SEXD1bJorU4lPy+7Xt8S6h2fJH3Xm0jS/ 2wjSWN8gKBV3q3duTpiLTVaeBbVnMYXnQA== X-Google-Smtp-Source: ABdhPJyDO3T25XLKPTp6ZFzTv9Mc0GzZOYNZzyIwyAfcAfEmCxptZWsQ+FwcZLrEEd0ohcIR4qXuYw== X-Received: by 2002:ac2:456d:: with SMTP id k13mr5584022lfm.203.1644772413400; Sun, 13 Feb 2022 09:13:33 -0800 (PST) Received: from localhost (31-178-191-245.dynamic.chello.pl. [31.178.191.245]) by smtp.gmail.com with ESMTPSA id 10sm540471ljv.8.2022.02.13.09.13.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 09:13:33 -0800 (PST) From: Piotr Oniszczuk To: linux-media@vger.kernel.org Cc: Piotr Oniszczuk Subject: [PATCH v1 02/03]: arm64: dts: rk356x.dtsi: Add support for Hantro G1 on RK356x Date: Sun, 13 Feb 2022 18:13:50 +0100 Message-Id: <20220213171349.3924782-2-piotr.oniszczuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220213171349.3924782-1-piotr.oniszczuk@gmail.com> References: <20220213171349.3924782-1-piotr.oniszczuk@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Piotr Oniszczuk RK356x has Hantro G1 video decoder capable to decode MPEG2/H.264/VP9 video formats. This patch enables RK356x video decoder in RK356x device-tree include. Tested on [1] with FFmpeg v4l2_request code taken from [2] with MPEG2, H.642 and VP8 samples with results [3]. [1] https://github.com/warpme/minimyth2 [2] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch [3] https://github.com/warpme/minimyth2/blob/master/video-test-summary.txt Signed-off-by: Piotr Oniszczuk --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index a68033a23975..ae5d80c5ba64 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -390,6 +390,28 @@ power-domain@RK3568_PD_RKVENC { }; }; + vpu: video-codec@fdea0400 { + compatible = "rockchip,rk3568-vpu"; + reg = <0x0 0xfdea0000 0x0 0x800>; + interrupts = ; + interrupt-names = "vdpu"; + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>; + clock-names = "aclk", "hclk"; + iommus = <&vdpu_mmu>; + power-domains = <&power RK3568_PD_VPU>; + }; + + vdpu_mmu: iommu@fdea0800 { + compatible = "rockchip,rk3568-iommu"; + reg = <0x0 0xfdea0800 0x0 0x40>; + interrupts = ; + interrupt-names = "vdpu_mmu"; + clock-names = "aclk", "iface"; + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>; + power-domains = <&power RK3568_PD_VPU>; + #iommu-cells = <0>; + }; + sdmmc2: mmc@fe000000 { compatible = "rockchip,rk3568-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x0 0xfe000000 0x0 0x4000>; From patchwork Sun Feb 13 17:13:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Oniszczuk X-Patchwork-Id: 12744636 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F0C5C433F5 for ; Sun, 13 Feb 2022 17:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237240AbiBMRN6 (ORCPT ); Sun, 13 Feb 2022 12:13:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232033AbiBMRN5 (ORCPT ); Sun, 13 Feb 2022 12:13:57 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9D1D58E5B for ; Sun, 13 Feb 2022 09:13:50 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id bu29so20975253lfb.0 for ; Sun, 13 Feb 2022 09:13:50 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=OsBhtQ98iI4ZnCfMYm1kTl/BmFgQLnIwAw++GaYjsQw=; b=RJvdFbF/76T6xHLHGuAsOhkC/v0gkx9X2gQ7hEi4jW4DhGQjrrpMRXs2syRItVdOhh JxipoDKlfZ4sQPrCVkCquNBHNpyngkD53y/6Vbgd/m1sMhat4hLQXAZREI//Hi9TVRf2 K3g4ZiEC6JlSDc1IHpWJfCCMgGbk5eR3hyT1Bdtci3/SGV9CvRRiWW2UFLZqeriL1kTp mR2u5W0WsDEh8lAB2CVlLTkRywvuTRloAzzVPv0QBRGZo/xxiNVn0bIs104prFi0ScoQ uGJ+cOlcd89QcqG08xJDvXVG5iK1zkP2LDonqukZMTB/VeZAJxeyowW8vuOYnsMollgx F7bQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=OsBhtQ98iI4ZnCfMYm1kTl/BmFgQLnIwAw++GaYjsQw=; b=ok/8l+V1MCYcKtu5sNGLWE28ByJOBzG3aK3Q3LX7P6tYL+QHGba1vnUmjVYGrkCoLR eqXmBodLfNv6alJFeKQPA4CFJKQY/0PQnHdsoZx2QNIiyyN+gh/o7r8i6k4oWN+JtF7d s9or88d31BZTjwwkJA4gnz5i/OwZn2KB5iOEg2POJRjWkBvkXQAGHa3nEOQJaoLXRzT6 0AIqiwNPX4pEEdYrHztpES84V0xyxZbvPXsxJrrCQFIXkhuNWFRHO3cqlZZc3vVKJbxN VbtfQbpdzIZNWhb16TMgSKj8sR8Jx+/mlPsfoYIx1PHL68oBCc4Cpcgt8gv3wadRrAlH +RQw== X-Gm-Message-State: AOAM531/zgnzCVYDf9SDQER6+sRQlF8lEomkQ1YGG34G9/ytXFAZ04wQ c0n0OXiFKwWpIAC8aAO40vLIxKX+d7qKdQ== X-Google-Smtp-Source: ABdhPJxCSwN6skeBP3wMDkaRhN1qcI/uo/SrcTa0oljeaoBSKXftLu0Vog23sdrp12nRg+7u/lWHxg== X-Received: by 2002:a05:6512:1111:: with SMTP id l17mr3852257lfg.6.1644772429087; Sun, 13 Feb 2022 09:13:49 -0800 (PST) Received: from localhost (31-178-191-245.dynamic.chello.pl. [31.178.191.245]) by smtp.gmail.com with ESMTPSA id k12sm3736120ljh.45.2022.02.13.09.13.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 09:13:48 -0800 (PST) From: Piotr Oniszczuk To: linux-media@vger.kernel.org Cc: Piotr Oniszczuk Subject: [PATCH v1 03/03]: dt-bindings: media: rockchip-vpu: Add RK3568 compatible Date: Sun, 13 Feb 2022 18:13:52 +0100 Message-Id: <20220213171349.3924782-3-piotr.oniszczuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220213171349.3924782-1-piotr.oniszczuk@gmail.com> References: <20220213171349.3924782-1-piotr.oniszczuk@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Piotr Oniszczuk RK356x has Hantro G1 video decoder capable to decode MPEG2/H.264/VP9 video formats. This patch adds RK3568 compatible in rockchip-vpu dt-bindings. Tested on [1] with FFmpeg v4l2_request code taken from [2] with MPEG2, H.642 and VP8 samples with results [3]. [1] https://github.com/warpme/minimyth2 [2] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch [3] https://github.com/warpme/minimyth2/blob/master/video-test-summary.txt Signed-off-by: Piotr Oniszczuk --- Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml index bacb60a34989..6cc4d3e5a61d 100644 --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml @@ -23,6 +23,7 @@ properties: - rockchip,rk3328-vpu - rockchip,rk3399-vpu - rockchip,px30-vpu + - rockchip,rk3568-vpu - items: - const: rockchip,rk3188-vpu - const: rockchip,rk3066-vpu