Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2636002imu; Sun, 6 Jan 2019 06:24:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/WA53JNAuq3h+EAEnv7HKgL9pmS11Oz4rKM6ia6Kf5MevOmfVpV/UFebhsjf3cld0x+WEyi X-Received: by 2002:a62:d2c1:: with SMTP id c184mr60044739pfg.248.1546784692132; Sun, 06 Jan 2019 06:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546784692; cv=none; d=google.com; s=arc-20160816; b=PnvK9yvBy2+bNsX+rwYi5osHNmMEwc4WrLHn3sC6kB6iHIOaHV+avFiJWj6jfZ4iFn D4worhR74L9B5kGgoCjkHRiyIuHHQ6p9NPKC0BCby2BdnByhpMpt6sGDU7Iza5z/5tVM VyEsFYjr9UAe/Nqaca+PvAbaGzi7yx/UmfNETqKxa6o8TkDBnU+uojkzFJYU+vVpUNPI 0/01Ng+RUHo02ICxfTNVkMxI0axn1dkPLzCXdK6WoiUMxsns+OzaCI/eGhGqLLq4C/wX Bkq9fbl2TmFFsN1mzEF8HpZtJKkeOhMCSVbSvceCf+hkV+qd4W72dBeFm2DL+ofYScGv 2S3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=he3k65hYsXN0idmSA59daywLI8jN2YBzTX/8XMqzNGk=; b=ZJbXyQ5b0I2S7+u2P12+FbaQ91GJxk+v+MayIxR1N6X+OhrAaOvBh9zcGBvX2yIyXh QMB12hUoEKH3xndLJn3MTOf41lffXkM4x5nLbdMlAXJuCaRyRHIypb2q7XjKiL3pvB+4 2bbU/9SY9zZmGyFR8DVxBWT94FB1ob+qujpvEEyxnSTPp7ga6nDbSDHgQA38R6OO84xH SxYZ4iLUW4MWTvPmKOf7tBR+Tp9BX8cqp6sNbDNrCUwSvnly/Gq8UQS0HNQFKtqOUnV5 nV1ng1uBhMWj9C2zE3qyDdgRbLapzckPp6VxTJ/+Pq4r1ZgCplzdUT8vFCQDTP/l68UQ rnrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59si5113207ple.291.2019.01.06.06.24.24; Sun, 06 Jan 2019 06:24:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726426AbfAFOW3 (ORCPT + 99 others); Sun, 6 Jan 2019 09:22:29 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47688 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfAFOW2 (ORCPT ); Sun, 6 Jan 2019 09:22:28 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 530B72735FE Message-ID: <50db3bc3faea97182b7fe18b4d9677f7e1563eaa.camel@collabora.com> Subject: Re: [PATCH 4/4] arm64: dts: rockchip: add video codec for rk3399 From: Ezequiel Garcia To: Randy Li , linux-rockchip@lists.infradead.org, Tomasz Figa Cc: nicolas.dufresne@collabora.com, myy@miouyouyou.fr, paul.kocialkowski@bootlin.com, mchehab@kernel.org, linux-media@vger.kernel.org, hverkuil@xs4all.nl, heiko@sntech.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Sun, 06 Jan 2019 11:22:17 -0300 In-Reply-To: <20190105183150.20266-5-ayaka@soulik.info> References: <20190105183150.20266-1-ayaka@soulik.info> <20190105183150.20266-5-ayaka@soulik.info> Organization: Collabora Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Randy, Thanks a lot for this patches. They are really useful to provide more insight into the VPU hardware. This change will make the vpu encoder and vpu decoder completely independent, can they really work in parallel? Could you provide more details about what is shared between these devices? Thanks a lot! On Sun, 2019-01-06 at 02:31 +0800, Randy Li wrote: > It offers an example how a full features video codec > should be configured. > > The original clocks assignment don't look good, if the clocks > lower than 300MHZ, most of decoing tasks would suffer from > timeout problem, 500MHZ is also a little high for RK3399 > running in a stable state. > > Signed-off-by: Randy Li > --- > .../boot/dts/rockchip/rk3399-sapphire.dtsi | 29 ++++++++ > arch/arm64/boot/dts/rockchip/rk3399.dtsi | 68 +++++++++++++++++-- > 2 files changed, 90 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi > index 946d3589575a..c3db878bae45 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi > @@ -632,6 +632,35 @@ > dr_mode = "host"; > }; > > +&rkvdec { > + status = "okay"; > +}; > + > +&rkvdec_srv { > + status = "okay"; > +}; > + > +&vdec_mmu { > + status = "okay"; > +}; > + > +&vdpu { > + status = "okay"; > +}; > + > +&vepu { > + status = "okay"; > +}; > + > +&vpu_service { > + status = "okay"; > +}; > + > +&vpu_mmu { > + status = "okay"; > + > +}; > + > &vopb { > status = "okay"; > }; > diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi > index b22b2e40422b..5fa3247e7bf0 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi > @@ -1242,16 +1242,39 @@ > status = "disabled"; > }; > > - vpu: video-codec@ff650000 { > - compatible = "rockchip,rk3399-vpu"; > - reg = <0x0 0xff650000 0x0 0x800>; > - interrupts = , > - ; > - interrupt-names = "vepu", "vdpu"; > + vpu_service: vpu-srv { > + compatible = "rockchip,mpp-service"; > + status = "disabled"; > + }; > + > + vepu: vpu-encoder@ff650000 { > + compatible = "rockchip,vpu-encoder-v2"; > + reg = <0x0 0xff650000 0x0 0x400>; > + interrupts = ; > + interrupt-names = "irq_enc"; > clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>; > - clock-names = "aclk", "hclk"; > + clock-names = "aclk_vcodec", "hclk_vcodec"; > + resets = <&cru SRST_H_VCODEC>, <&cru SRST_A_VCODEC>; > + reset-names = "video_h", "video_a"; > iommus = <&vpu_mmu>; > power-domains = <&power RK3399_PD_VCODEC>; > + rockchip,srv = <&vpu_service>; > + status = "disabled"; > + }; > + > + vdpu: vpu-decoder@ff650400 { > + compatible = "rockchip,vpu-decoder-v2"; > + reg = <0x0 0xff650400 0x0 0x400>; > + interrupts = ; > + interrupt-names = "irq_dec"; > + iommus = <&vpu_mmu>; > + clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>; > + clock-names = "aclk_vcodec", "hclk_vcodec"; > + resets = <&cru SRST_H_VCODEC>, <&cru SRST_A_VCODEC>; > + reset-names = "video_h", "video_a"; > + power-domains = <&power RK3399_PD_VCODEC>; > + rockchip,srv = <&vpu_service>; > + status = "disabled"; > }; > > vpu_mmu: iommu@ff650800 { > @@ -1261,11 +1284,42 @@ > interrupt-names = "vpu_mmu"; > clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>; > clock-names = "aclk", "iface"; > + assigned-clocks = <&cru ACLK_VCODEC_PRE>; > + assigned-clock-parents = <&cru PLL_GPLL>; > #iommu-cells = <0>; > power-domains = <&power RK3399_PD_VCODEC>; > status = "disabled"; > }; > > + rkvdec_srv: rkvdec-srv { > + compatible = "rockchip,mpp-service"; > + status = "disabled"; > + }; > + > + rkvdec: video-decoder@ff660000 { > + compatible = "rockchip,video-decoder-v1"; > + reg = <0x0 0xff660000 0x0 0x400>; > + interrupts = ; > + interrupt-names = "irq_dec"; > + clocks = <&cru ACLK_VDU>, <&cru HCLK_VDU>, > + <&cru SCLK_VDU_CA>, <&cru SCLK_VDU_CORE>; > + clock-names = "aclk_vcodec", "hclk_vcodec", > + "clk_cabac", "clk_core"; > + assigned-clocks = <&cru ACLK_VDU_PRE>, <&cru SCLK_VDU_CA>, > + <&cru SCLK_VDU_CORE>; > + assigned-clock-parents = <&cru PLL_NPLL>, <&cru PLL_NPLL>, > + <&cru PLL_NPLL>; > + resets = <&cru SRST_H_VDU>, <&cru SRST_A_VDU>, > + <&cru SRST_VDU_CORE>, <&cru SRST_VDU_CA>, > + <&cru SRST_A_VDU_NOC>, <&cru SRST_H_VDU_NOC>; > + reset-names = "video_h", "video_a", "video_core", "video_cabac", > + "niu_a", "niu_h"; > + power-domains = <&power RK3399_PD_VDU>; > + rockchip,srv = <&rkvdec_srv>; > + iommus = <&vdec_mmu>; > + status = "disabled"; > + }; > + > vdec_mmu: iommu@ff660480 { > compatible = "rockchip,iommu"; > reg = <0x0 0xff660480 0x0 0x40>, <0x0 0xff6604c0 0x0 0x40>;