From patchwork Sat May 18 17:44:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 10948993 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 BFEAD924 for ; Sat, 18 May 2019 17:45:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE28F28518 for ; Sat, 18 May 2019 17:45:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A164628555; Sat, 18 May 2019 17:45:01 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 377CE284F1 for ; Sat, 18 May 2019 17:45:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729623AbfERRo0 (ORCPT ); Sat, 18 May 2019 13:44:26 -0400 Received: from mailoutvs59.siol.net ([185.57.226.250]:42530 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726050AbfERRo0 (ORCPT ); Sat, 18 May 2019 13:44:26 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id 3DCC6520A8D; Sat, 18 May 2019 19:44:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta12.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta12.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id GueISRJvbvib; Sat, 18 May 2019 19:44:21 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id C2B30520939; Sat, 18 May 2019 19:44:21 +0200 (CEST) Received: from localhost.localdomain (cpe-86-58-52-202.static.triera.net [86.58.52.202]) (Authenticated sender: 031275009) by mail.siol.net (Zimbra) with ESMTPSA id F058D520A8D; Sat, 18 May 2019 19:44:20 +0200 (CEST) From: Jernej Skrabec To: paul.kocialkowski@bootlin.com, maxime.ripard@bootlin.com Cc: mchehab@kernel.org, hverkuil-cisco@xs4all.nl, gregkh@linuxfoundation.org, wens@csie.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: cedrus: Allow different mod clock rates Date: Sat, 18 May 2019 19:44:15 +0200 Message-Id: <20190518174415.17795-1-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some VPU variants may run at higher clock speeds. They actually need extra speed to be capable of decoding more complex codecs like HEVC or bigger image sizes (4K). Expand variant structure with mod_rate information. Signed-off-by: Jernej Skrabec Acked-by: Maxime Ripard --- drivers/staging/media/sunxi/cedrus/cedrus.c | 11 ++++++++--- drivers/staging/media/sunxi/cedrus/cedrus.h | 1 + drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus_hw.h | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index d0429c0e6b6b..9349a082a29c 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -369,36 +369,41 @@ static int cedrus_remove(struct platform_device *pdev) } static const struct cedrus_variant sun4i_a10_cedrus_variant = { - /* No particular capability. */ + .mod_rate = 320000000, }; static const struct cedrus_variant sun5i_a13_cedrus_variant = { - /* No particular capability. */ + .mod_rate = 320000000, }; static const struct cedrus_variant sun7i_a20_cedrus_variant = { - /* No particular capability. */ + .mod_rate = 320000000, }; static const struct cedrus_variant sun8i_a33_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, + .mod_rate = 320000000, }; static const struct cedrus_variant sun8i_h3_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, + .mod_rate = 402000000, }; static const struct cedrus_variant sun50i_a64_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, + .mod_rate = 402000000, }; static const struct cedrus_variant sun50i_h5_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, + .mod_rate = 402000000, }; static const struct cedrus_variant sun50i_h6_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, .quirks = CEDRUS_QUIRK_NO_DMA_OFFSET, + .mod_rate = 600000000, }; static const struct of_device_id cedrus_dt_match[] = { diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h index c57c04b41d2e..25ee1f80f2c7 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -94,6 +94,7 @@ struct cedrus_dec_ops { struct cedrus_variant { unsigned int capabilities; unsigned int quirks; + unsigned int mod_rate; }; struct cedrus_dev { diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c index fbfff7c1c771..60406b2d4595 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c @@ -236,7 +236,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev) goto err_sram; } - ret = clk_set_rate(dev->mod_clk, CEDRUS_CLOCK_RATE_DEFAULT); + ret = clk_set_rate(dev->mod_clk, variant->mod_rate); if (ret) { dev_err(dev->dev, "Failed to set clock rate\n"); diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.h b/drivers/staging/media/sunxi/cedrus/cedrus_hw.h index b43c77d54b95..27d0882397aa 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.h @@ -16,8 +16,6 @@ #ifndef _CEDRUS_HW_H_ #define _CEDRUS_HW_H_ -#define CEDRUS_CLOCK_RATE_DEFAULT 320000000 - int cedrus_engine_enable(struct cedrus_dev *dev, enum cedrus_codec codec); void cedrus_engine_disable(struct cedrus_dev *dev);