From patchwork Sat Jan 5 18:31:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ayaka X-Patchwork-Id: 10749341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51E3A1399 for ; Sat, 5 Jan 2019 18:32:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B8F28712 for ; Sat, 5 Jan 2019 18:32:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33F3628818; Sat, 5 Jan 2019 18:32:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A419E28712 for ; Sat, 5 Jan 2019 18:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JRpF2GLm2bk1jfIACpE/1ekG7RckOeHgZL21ajtOx/E=; b=gilhb8Fv3UBUDs lkSoa+uOiolrksiKHwOcGXqZVDQpJg6hDy5O8kcaV7LKsW+c+qFSAJJpb+VJInbRUFDTdnW+n3hF4 gcHE36P4g/MCrzEhEJHnDrcoEV88CCkc0CkDo324goe1cSy9rIPsaccqG7qN+PjqcDJvcxvL3HRoo ZSB4goGs6N/WCxenwid2f++QlXL2l5TYjdaLVvFkyvfb9FjQDob8h++j0iq1V1V/YqmyJmsCztViC xeAcX/GZaOKDjLHUGbqI+TkJwl8v8LCRV8fnewvOvQvW/0Po6mWktelEmnoGSRhz4NjTA5/UXaU17 APW1w325kF5BHN3TiLwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfqk4-0004T2-6U; Sat, 05 Jan 2019 18:32:16 +0000 Received: from kozue.soulik.info ([2001:19f0:7000:8404:5054:ff:fe75:428f]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfqjs-0004E9-8u; Sat, 05 Jan 2019 18:32:11 +0000 Received: from misaki.sumomo.pri (unknown [IPv6:2001:470:b30d:2:c604:15ff:0:a00]) by kozue.soulik.info (Postfix) with ESMTPA id 38166101784; Sun, 6 Jan 2019 03:32:42 +0900 (JST) From: Randy Li To: linux-rockchip@lists.infradead.org Subject: [PATCH 2/4] staging: video: rockchip: fixup for upstream Date: Sun, 6 Jan 2019 02:31:48 +0800 Message-Id: <20190105183150.20266-3-ayaka@soulik.info> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190105183150.20266-1-ayaka@soulik.info> References: <20190105183150.20266-1-ayaka@soulik.info> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190105_103204_997452_E0A93929 X-CRM114-Status: GOOD ( 10.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hverkuil@xs4all.nl, nicolas.dufresne@collabora.com, heiko@sntech.de, Randy Li , linux-kernel@vger.kernel.org, paul.kocialkowski@bootlin.com, myy@miouyouyou.fr, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Fixing those deprecated function from vendor kernel. Removing those features don't exist in upstream kernel. Signed-off-by: Randy Li --- drivers/staging/rockchip-mpp/mpp_dev_common.c | 12 ++++++------ drivers/staging/rockchip-mpp/mpp_dev_common.h | 2 +- drivers/staging/rockchip-mpp/mpp_dev_rkvdec.c | 7 +++---- drivers/staging/rockchip-mpp/mpp_dev_vdpu1.c | 5 ++--- drivers/staging/rockchip-mpp/mpp_dev_vdpu2.c | 5 ++--- drivers/staging/rockchip-mpp/mpp_dev_vepu1.c | 5 ++--- drivers/staging/rockchip-mpp/mpp_dev_vepu2.c | 5 ++--- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/drivers/staging/rockchip-mpp/mpp_dev_common.c b/drivers/staging/rockchip-mpp/mpp_dev_common.c index 159aa5d244ce..9a257c254d4d 100644 --- a/drivers/staging/rockchip-mpp/mpp_dev_common.c +++ b/drivers/staging/rockchip-mpp/mpp_dev_common.c @@ -937,18 +937,18 @@ EXPORT_SYMBOL(mpp_dev_read); void mpp_debug_time_record(struct mpp_task *task) { if (unlikely(debug & DEBUG_TIMING) && task) - do_gettimeofday(&task->start); + getboottime64(&task->start); } EXPORT_SYMBOL(mpp_debug_time_record); void mpp_debug_time_diff(struct mpp_task *task) { - struct timeval end; + struct timespec64 end; - do_gettimeofday(&end); - mpp_debug(DEBUG_TIMING, "time: %ld us\n", - (end.tv_sec - task->start.tv_sec) * 1000000 + - (end.tv_usec - task->start.tv_usec)); + getboottime64(&end); + mpp_debug(DEBUG_TIMING, "time: %lld ms\n", + (end.tv_sec - task->start.tv_sec) * 1000 + + (end.tv_nsec - task->start.tv_nsec) / 1000000); } EXPORT_SYMBOL(mpp_debug_time_diff); diff --git a/drivers/staging/rockchip-mpp/mpp_dev_common.h b/drivers/staging/rockchip-mpp/mpp_dev_common.h index 8a7dc7444dc3..76d53ec2c452 100644 --- a/drivers/staging/rockchip-mpp/mpp_dev_common.h +++ b/drivers/staging/rockchip-mpp/mpp_dev_common.h @@ -124,7 +124,7 @@ struct mpp_task { struct work_struct work; /* record context running start time */ - struct timeval start; + struct timespec64 start; }; /* diff --git a/drivers/staging/rockchip-mpp/mpp_dev_rkvdec.c b/drivers/staging/rockchip-mpp/mpp_dev_rkvdec.c index a3da27cfc10e..44d76eba901f 100644 --- a/drivers/staging/rockchip-mpp/mpp_dev_rkvdec.c +++ b/drivers/staging/rockchip-mpp/mpp_dev_rkvdec.c @@ -19,10 +19,10 @@ #include #include #include -#include #include #include #include +#include #include "mpp_debug.h" #include "mpp_dev_common.h" @@ -230,8 +230,7 @@ static int fill_scaling_list_pps(struct rkvdec_task *task, int fd, int offset, return -ENOENT; } - ret = dma_buf_begin_cpu_access(dmabuf, 0, dmabuf->size, - DMA_FROM_DEVICE); + ret = dma_buf_begin_cpu_access(dmabuf, DMA_FROM_DEVICE); if (ret) { dev_err(dev, "can't access the pps buffer\n"); goto done; @@ -277,7 +276,7 @@ static int fill_scaling_list_pps(struct rkvdec_task *task, int fd, int offset, done: dma_buf_vunmap(dmabuf, vaddr); - dma_buf_end_cpu_access(dmabuf, 0, dmabuf->size, DMA_FROM_DEVICE); + dma_buf_end_cpu_access(dmabuf, DMA_FROM_DEVICE); dma_buf_put(dmabuf); return ret; diff --git a/drivers/staging/rockchip-mpp/mpp_dev_vdpu1.c b/drivers/staging/rockchip-mpp/mpp_dev_vdpu1.c index 4371a1a6080b..63ffd79bfe83 100644 --- a/drivers/staging/rockchip-mpp/mpp_dev_vdpu1.c +++ b/drivers/staging/rockchip-mpp/mpp_dev_vdpu1.c @@ -460,9 +460,8 @@ static int rockchip_mpp_rkvdpu_assign_reset(struct rockchip_rkvdpu_dev *dec_dev) { struct rockchip_mpp_dev *mpp_dev = &dec_dev->mpp_dev; - /* TODO: use devm_reset_control_get_share() instead */ - dec_dev->rst_a = devm_reset_control_get(mpp_dev->dev, "video_a"); - dec_dev->rst_h = devm_reset_control_get(mpp_dev->dev, "video_h"); + dec_dev->rst_a = devm_reset_control_get_shared(mpp_dev->dev, "video_a"); + dec_dev->rst_h = devm_reset_control_get_shared(mpp_dev->dev, "video_h"); if (IS_ERR_OR_NULL(dec_dev->rst_a)) { mpp_err("No aclk reset resource define\n"); diff --git a/drivers/staging/rockchip-mpp/mpp_dev_vdpu2.c b/drivers/staging/rockchip-mpp/mpp_dev_vdpu2.c index b131790f72a3..5789c8940543 100644 --- a/drivers/staging/rockchip-mpp/mpp_dev_vdpu2.c +++ b/drivers/staging/rockchip-mpp/mpp_dev_vdpu2.c @@ -428,9 +428,8 @@ static int rockchip_mpp_rkvdpu_assign_reset(struct rockchip_rkvdpu_dev *dec_dev) { struct rockchip_mpp_dev *mpp_dev = &dec_dev->mpp_dev; - /* TODO: use devm_reset_control_get_share() instead */ - dec_dev->rst_a = devm_reset_control_get(mpp_dev->dev, "video_a"); - dec_dev->rst_h = devm_reset_control_get(mpp_dev->dev, "video_h"); + dec_dev->rst_a = devm_reset_control_get_shared(mpp_dev->dev, "video_a"); + dec_dev->rst_h = devm_reset_control_get_shared(mpp_dev->dev, "video_h"); if (IS_ERR_OR_NULL(dec_dev->rst_a)) { mpp_err("No aclk reset resource define\n"); diff --git a/drivers/staging/rockchip-mpp/mpp_dev_vepu1.c b/drivers/staging/rockchip-mpp/mpp_dev_vepu1.c index 64619092c792..ebe8174e931e 100644 --- a/drivers/staging/rockchip-mpp/mpp_dev_vepu1.c +++ b/drivers/staging/rockchip-mpp/mpp_dev_vepu1.c @@ -330,9 +330,8 @@ static int rockchip_mpp_rkvepu_assign_reset(struct rockchip_rkvepu_dev *enc_dev) { struct rockchip_mpp_dev *mpp_dev = &enc_dev->mpp_dev; - /* TODO: use devm_reset_control_get_share() instead */ - enc_dev->rst_a = devm_reset_control_get(mpp_dev->dev, "video_a"); - enc_dev->rst_h = devm_reset_control_get(mpp_dev->dev, "video_h"); + enc_dev->rst_a = devm_reset_control_get_shared(mpp_dev->dev, "video_a"); + enc_dev->rst_h = devm_reset_control_get_shared(mpp_dev->dev, "video_h"); if (IS_ERR_OR_NULL(enc_dev->rst_a)) { mpp_err("No aclk reset resource define\n"); diff --git a/drivers/staging/rockchip-mpp/mpp_dev_vepu2.c b/drivers/staging/rockchip-mpp/mpp_dev_vepu2.c index 48ec401145d5..889aaccf25c5 100644 --- a/drivers/staging/rockchip-mpp/mpp_dev_vepu2.c +++ b/drivers/staging/rockchip-mpp/mpp_dev_vepu2.c @@ -327,9 +327,8 @@ static int rockchip_mpp_rkvepu_assign_reset(struct rockchip_rkvepu_dev *enc_dev) { struct rockchip_mpp_dev *mpp_dev = &enc_dev->mpp_dev; - /* TODO: use devm_reset_control_get_share() instead */ - enc_dev->rst_a = devm_reset_control_get(mpp_dev->dev, "video_a"); - enc_dev->rst_h = devm_reset_control_get(mpp_dev->dev, "video_h"); + enc_dev->rst_a = devm_reset_control_get_shared(mpp_dev->dev, "video_a"); + enc_dev->rst_h = devm_reset_control_get_shared(mpp_dev->dev, "video_h"); if (IS_ERR_OR_NULL(enc_dev->rst_a)) { mpp_err("No aclk reset resource define\n"); From patchwork Sat Jan 5 18:31:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ayaka X-Patchwork-Id: 10749345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F6501399 for ; Sat, 5 Jan 2019 18:32:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F62F28712 for ; Sat, 5 Jan 2019 18:32:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2223F28818; Sat, 5 Jan 2019 18:32:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D23D128712 for ; Sat, 5 Jan 2019 18:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gJNryjiG5sa4/X8tdBK9bfDCXQZeEYVvu3VVbxPfqW0=; b=s0ouGqZ9pKmFnH 8RLV4C9NvUyfxLbZDRZH7Hx5N+M/KXMFatL52VUkmfAzXnu2PpU1BiOaB4yqEDMiQQgx98RUXgvFt 1d/jJMxL5iT3EHiys6SUg4EZl3pDC7Gtb0E9m9raa5HBn0c/YUf58AtxGrmNoOA3pyYDxKXbBJAny M4bGVEoPnIOFizgzRvVsCYVBilrCDh94nOrv0yNQJMkyZMIy71a79abiVA8znUh++W37SwWaQPLGg R1x2s39HkVktDJCft5Zj6sdcSoCtkZy1atYLmNusH8yYGmW+PONM52EHTUqB1+kBgJWxTfZbdEYm0 IL3xqYoPti1yTTvjRksg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfqkK-0004k9-2I; Sat, 05 Jan 2019 18:32:32 +0000 Received: from kozue.soulik.info ([2001:19f0:7000:8404:5054:ff:fe75:428f]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfqju-0004G8-3r; Sat, 05 Jan 2019 18:32:15 +0000 Received: from misaki.sumomo.pri (unknown [IPv6:2001:470:b30d:2:c604:15ff:0:a00]) by kozue.soulik.info (Postfix) with ESMTPA id 23BD0101811; Sun, 6 Jan 2019 03:32:44 +0900 (JST) From: Randy Li To: linux-rockchip@lists.infradead.org Subject: [PATCH 3/4] staging: video: rockchip: add video codec Date: Sun, 6 Jan 2019 02:31:49 +0800 Message-Id: <20190105183150.20266-4-ayaka@soulik.info> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190105183150.20266-1-ayaka@soulik.info> References: <20190105183150.20266-1-ayaka@soulik.info> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190105_103206_779185_6AB569EA X-CRM114-Status: UNSURE ( 5.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hverkuil@xs4all.nl, nicolas.dufresne@collabora.com, heiko@sntech.de, Randy Li , linux-kernel@vger.kernel.org, paul.kocialkowski@bootlin.com, myy@miouyouyou.fr, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Randy Li --- drivers/staging/Kconfig | 2 ++ drivers/staging/Makefile | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index e4f608815c05..81634dd0a283 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig @@ -122,4 +122,6 @@ source "drivers/staging/axis-fifo/Kconfig" source "drivers/staging/erofs/Kconfig" +source "drivers/staging/rockchip-mpp/Kconfig" + endif # STAGING diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index 5868631e8f1b..22499c68c21e 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -51,3 +51,4 @@ obj-$(CONFIG_SOC_MT7621) += mt7621-dts/ obj-$(CONFIG_STAGING_GASKET_FRAMEWORK) += gasket/ obj-$(CONFIG_XIL_AXIS_FIFO) += axis-fifo/ obj-$(CONFIG_EROFS_FS) += erofs/ +obj-$(CONFIG_ROCKCHIP_MPP_SERVICE) += rockchip-mpp/ From patchwork Sat Jan 5 18:31:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ayaka X-Patchwork-Id: 10749347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2883C13B5 for ; Sat, 5 Jan 2019 18:32:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16D2728712 for ; Sat, 5 Jan 2019 18:32:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A40A28818; Sat, 5 Jan 2019 18:32:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6720E28712 for ; Sat, 5 Jan 2019 18:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fE5q3czpBf+nSNasLVxloy7A9Hp4V/CPo5QUKYNm0TQ=; b=mKPP+ZvnX4Nj69 GeT8vIW/5qOieHbc6X4wpcMOtMMnFmJLuKIo7KJ9LKptA6Sf7EZPp8rf6/s7CksUYUotEulyIMtFy Tai23MDhvV+WzMsm0647zYBpmWPQ2usMYw/YHXCNAB2HIsiEQswNhPpXq6/Pt7DInHRdjAc9rsiz0 PRMQXgmGCGNZ8NNfRcWW+YCCK0hJuwd7KcOP/gPUN11q3IxKZLYFQ1oBhOf+dXNWV9h8b9/Olur1e HX4UfkDePNGa1S5mVyX14PCHBf2L29ZlVJnyLTZgBOKe4ww9vbHjNY11WnHJNdtoqCCwOYggwQIw9 lOSDEZ3IFfw+O8xio+UA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfqkX-0004xL-4Z; Sat, 05 Jan 2019 18:32:45 +0000 Received: from kozue.soulik.info ([2001:19f0:7000:8404:5054:ff:fe75:428f]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfqjw-0004IU-2x; Sat, 05 Jan 2019 18:32:15 +0000 Received: from misaki.sumomo.pri (unknown [IPv6:2001:470:b30d:2:c604:15ff:0:a00]) by kozue.soulik.info (Postfix) with ESMTPA id 11D92101829; Sun, 6 Jan 2019 03:32:45 +0900 (JST) From: Randy Li To: linux-rockchip@lists.infradead.org Subject: [PATCH 4/4] arm64: dts: rockchip: add video codec for rk3399 Date: Sun, 6 Jan 2019 02:31:50 +0800 Message-Id: <20190105183150.20266-5-ayaka@soulik.info> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190105183150.20266-1-ayaka@soulik.info> References: <20190105183150.20266-1-ayaka@soulik.info> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190105_103208_871199_28FB00CC X-CRM114-Status: UNSURE ( 9.40 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hverkuil@xs4all.nl, nicolas.dufresne@collabora.com, heiko@sntech.de, Randy Li , linux-kernel@vger.kernel.org, paul.kocialkowski@bootlin.com, myy@miouyouyou.fr, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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>;