From patchwork Mon Feb 14 21:29:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Oniszczuk X-Patchwork-Id: 12746136 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 7472CC433F5 for ; Mon, 14 Feb 2022 21:29:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbiBNV3c (ORCPT ); Mon, 14 Feb 2022 16:29:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231450AbiBNV3Z (ORCPT ); Mon, 14 Feb 2022 16:29:25 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3BA71480F8 for ; Mon, 14 Feb 2022 13:29:10 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id n24so21377986ljj.10 for ; Mon, 14 Feb 2022 13:29:10 -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=CkXrAzUFSY/e5T9rKqwMBznq2Sq4ji4dfshU2pB68VY=; b=ikMA6Pao2D4vOKU4mdw3H/jO6uD6kWySYHOyurn/qC3yp4V+W5XRU7Moe7zmqFY2op LoNKUPbagZHGE+SgbdlcDKgLBH6cnqHaiu8ux0gy7Va/Gbi+bmdjV0fbpycEzFeVbib2 OxSMqPgXQ2aSKM/Th7Noj2fBNz92q6m/sq7jzExQEkV9WOWkfv7ahByt9YBLm4emRirx 8VVHg3cO9dzkwrZ224qNKamxZqFV0ve+P5bNi2FT7dQrSjKi1ta945nVUKr/cWSiHFD2 dffnGFmsUUWWB6HLL2hBTcTDCgwyJAne9QXmhrZmCwdlWgEbjDe3+/Du4KAx74KdpnMG CB2Q== 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=CkXrAzUFSY/e5T9rKqwMBznq2Sq4ji4dfshU2pB68VY=; b=DRSm8Y3GL44df/4FzDbKdv9kEfp2oy4LjETfWnDLbsS7lgd6uUxeVmPYqHkt5w3zRv d+Qh1M3Piz3hjnceckIi1IkKn8WMBJ+Lbah5FKXT4v+mNVviWtbkwgkEVkKJzfIfzQ/d KthV1fIk339ZGASjpHSKR8DSHrspfsw7fufCsU0TXv2z7oOnbRwVFT42Uy8b3F9YZwxw hcpFUGDd/Nw3ivCEeiOS+mSPjhF40e44C2WDT+3vDGEM47hqg3dsl9dfFKH2Ga61uwmR vL2fZlx0mZ02zT0AyY6pLYB4VSCLHV0kgVDu9g++aP+iMEsft7vPDfUw8y0PxlDX27Sf cnWA== X-Gm-Message-State: AOAM5338XH8Y4Tv63lsan2DlTlCHrJbm1nwzjiPnVz7vjvOXqQnKy7EI sMpb1yUIzsbJHUxRXoEtEj2Cd+wlAWmPEA== X-Google-Smtp-Source: ABdhPJx8zS75cmKpRFetRZGNVYIjjCd1PRU3OHm8pQBavNjPfZDe4n/6b7rNfBm0iqqtn4IRturZ6Q== X-Received: by 2002:a05:651c:168c:: with SMTP id bd12mr47042ljb.63.1644874148685; Mon, 14 Feb 2022 13:29:08 -0800 (PST) Received: from localhost (31-178-191-245.dynamic.chello.pl. [31.178.191.245]) by smtp.gmail.com with ESMTPSA id m28sm650982ljc.1.2022.02.14.13.29.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 13:29:08 -0800 (PST) From: Piotr Oniszczuk To: linux-media@vger.kernel.org, Linux-rockchip@lists.infradead.org Cc: Piotr Oniszczuk Subject: [PATCH v2 1/3] media: hantro: Add support for Hantro G1 on RK356x Date: Mon, 14 Feb 2022 22:29:53 +0100 Message-Id: <20220214212955.1178947-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/VP8 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 Reviewed-by: Ezequiel Garcia --- 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 Mon Feb 14 21:29:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Oniszczuk X-Patchwork-Id: 12746137 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 5FB10C433EF for ; Mon, 14 Feb 2022 21:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231328AbiBNV3g (ORCPT ); Mon, 14 Feb 2022 16:29:36 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231324AbiBNV31 (ORCPT ); Mon, 14 Feb 2022 16:29:27 -0500 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61B1B14865D for ; Mon, 14 Feb 2022 13:29:13 -0800 (PST) Received: by mail-lj1-x22c.google.com with SMTP id d2so1745305ljl.1 for ; Mon, 14 Feb 2022 13:29:13 -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=KAsCtIlfmp+m7ShyllLFJYAj9FEeo8wO2Fz9dFrEzUk=; b=oviBn1dwswIq6zXepxKju+gVEouA9bnn6Bd2iFa/bIWH0fkx9MbgJMD2YGwR7k8K7o byLrXrGvwcgWvYOqHvjd44h/zB43zde4T5mYQEr1hamdbDkFHDHuxc9euFmgpaJ+Pojg LlIRGRlCkMjOXdMs2I5V4M/CMtzvg2Mo6Hpi3QbUrd6lBR0cUfcEz2NhENMfzTo+mmYR 1yXhc2Wk6WFU/1jusIHPk+ADc35oOOH6xP1PZZ/XECUyVWjnlDNzJcadeRnH2HTZO6l5 eBwhe+BcMAmZIFBdmlwC/uF/Ng+DINUUuiLPbGRvfRtnYzQ51QhtGeMlQh8Ua+gxhZje lkRQ== 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=KAsCtIlfmp+m7ShyllLFJYAj9FEeo8wO2Fz9dFrEzUk=; b=NlqWgN3z6WA9a88bJ/h0p/rt9hkWZ6cLdUgQ40IDadRi01ace26hpO6FAv4UrXDCqU a4V/7pluPWdwEKKgrkmNrlmGPPrmWR/RW0/nQvpPgBY+XxUT7CFqO4T6fmGM5KpPdIBZ HfDdvnyQvhhQ6tNyJ3ujghGiyi3VV4S/DCESsr0mysesplnD+uudWd2i3e5GIwlGZnc+ L96utQNNpWL8iQiujBLKMxmHElkl9m3iG3UepiISVtqahRR8iWL/sD+x2qRUG9rGgCzU X9f1FaXJ6WlT/iK4DKWGQx8efrKIsa5DWwH1MLcdF9VetooEDiyGrLK0RGWUmPOL4sYv n7jw== X-Gm-Message-State: AOAM530v0r5g4h8mQ9LySAXQhqEbND/mcLA89tHf6EpjXU89XTbYsvCx VhtidBCzB1rz8hCfQziaPMfIXYocP6EMOA== X-Google-Smtp-Source: ABdhPJygCRUKcXYRREzCPhlgnMRY/xJ2BV/jbHvhY0MtRmH/g5VjCExQ76VosAuSlDwk9Q67S2g3kw== X-Received: by 2002:a05:651c:1054:: with SMTP id x20mr415144ljm.349.1644874151550; Mon, 14 Feb 2022 13:29:11 -0800 (PST) Received: from localhost (31-178-191-245.dynamic.chello.pl. [31.178.191.245]) by smtp.gmail.com with ESMTPSA id a22sm491184lfr.24.2022.02.14.13.29.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 13:29:11 -0800 (PST) From: Piotr Oniszczuk To: linux-media@vger.kernel.org, Linux-rockchip@lists.infradead.org Cc: Piotr Oniszczuk Subject: [PATCH v2 2/3] arm64: dts: rockchip: Add VPU support for RK3568/RK3566 Date: Mon, 14 Feb 2022 22:29:54 +0100 Message-Id: <20220214212955.1178947-2-piotr.oniszczuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220214212955.1178947-1-piotr.oniszczuk@gmail.com> References: <20220214212955.1178947-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/VP8 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 Reviewed-by: Ezequiel Garcia --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index a68033a23975..33ecaafa8cb7 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -390,6 +390,26 @@ power-domain@RK3568_PD_RKVENC { }; }; + vpu: video-codec@fdea0400 { + compatible = "rockchip,rk3568-vpu"; + reg = <0x0 0xfdea0000 0x0 0x800>; + interrupts = ; + 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 = ; + 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 Mon Feb 14 21:29:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Oniszczuk X-Patchwork-Id: 12746138 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 EB539C433EF for ; Mon, 14 Feb 2022 21:29:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbiBNV3k (ORCPT ); Mon, 14 Feb 2022 16:29:40 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbiBNV33 (ORCPT ); Mon, 14 Feb 2022 16:29:29 -0500 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0E0D128648 for ; Mon, 14 Feb 2022 13:29:15 -0800 (PST) Received: by mail-lj1-x231.google.com with SMTP id d2so1745411ljl.1 for ; Mon, 14 Feb 2022 13:29:15 -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=bvEyQB/PyceZSKFICAgr4rX9IZccsdLqr5cSBDPK0TQ=; b=O5Fkn+9175Dg1Xv2y/9nuCaofeltao86wRESQBPZvQaxnAEumWfk1up4sKPnZzbbGF HmXYHjl/VDP5dbsl88sX60+gWWkzAIMuWCVi3rgsqGUzH2YchfSzptpswWG0JLGtXz8s QGKDiUkR4PsSXU1eym0MLb3J2z4de6GpHnzbWdzFvphcHyZ9vyR5vAAnelAIWdOI3Ct0 PCMB97eI/Cp2ovH06CZxQuz5FE+TWA2MNMbZ/N8+kiuDZ+A7jKy4xS2WTJMP56WV4OMJ 4ONgDuRxhz0ClqAzeqFBoefEVAaFWd2xN8vGMhNXqvlMH6ZFFtkK1EvknD+MQQG1rrkT nd9g== 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=bvEyQB/PyceZSKFICAgr4rX9IZccsdLqr5cSBDPK0TQ=; b=46MD8D9nnddbDHF1oZUQSEGm2w7/RdOU8NOJ+3H8WvHX4rPS7HvAS9UhfdIK3NzZer hwiYiHMoBU5eF7BvlVh4D0UIFGX43PFnl2P9Cvs8QbsKKsGOopxpG+gMa9e/FhFhHKXQ xutQDyLGt0ReREUHUBhQuff+ZdQfL/47VOpla9vw2I9ntjgIgpbNq9Z02awtZgjGSpdo UDq20eEamK/TUard42XirprtxzD2pUcAeKktG/isY3b6JPtMqPtR3e65bPlVnljs8suu p7iZbTOzeDREElRO+uDgO1kjWC+052gG4Hpf99A8oPLWruWU33qpx0gltoX+ZioAFRlS WqeA== X-Gm-Message-State: AOAM531+bYRXERqJc1Xh3Klga37PlNVWCj/Nl5o6CziehCtSTFFl9MM6 aW4/hbiRj0aD00ynxwL7pBOcAg+LnDqsMw== X-Google-Smtp-Source: ABdhPJzidgUExYWazrcpL9i5bTa8JzEUMlW9InrSyLoYH8ESjXXhHMSlks8Qiy/MSB62O/rwQxe/aA== X-Received: by 2002:a05:651c:178e:: with SMTP id bn14mr473681ljb.12.1644874153832; Mon, 14 Feb 2022 13:29:13 -0800 (PST) Received: from localhost (31-178-191-245.dynamic.chello.pl. [31.178.191.245]) by smtp.gmail.com with ESMTPSA id s2sm868363lfr.126.2022.02.14.13.29.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 13:29:13 -0800 (PST) From: Piotr Oniszczuk To: linux-media@vger.kernel.org, Linux-rockchip@lists.infradead.org Cc: Piotr Oniszczuk Subject: [PATCH v2 3/3] dt-bindings: media: rockchip-vpu: Add RK3568 compatible Date: Mon, 14 Feb 2022 22:29:55 +0100 Message-Id: <20220214212955.1178947-3-piotr.oniszczuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220214212955.1178947-1-piotr.oniszczuk@gmail.com> References: <20220214212955.1178947-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/VP8 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 Reviewed-by: Ezequiel Garcia --- 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