Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp750546ybt; Wed, 8 Jul 2020 10:43:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfBsVjDzJkHrjDcPMSC+mcqhHgUMb63+pmdgKdSXi8GJYfO0yW7LZxqwOQ3NlXNGe4aYbD X-Received: by 2002:a50:ec8b:: with SMTP id e11mr56609933edr.344.1594230198426; Wed, 08 Jul 2020 10:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594230198; cv=none; d=google.com; s=arc-20160816; b=ENzLYG2Yxa4KB7PX2h5RONZmranuHS0vCK1yJ0GfjXreoxW7VIo09ss6WzLjGJv56s zlCaJ/tg9VZ73ypa+StC+0cprrGFgcsEOStzKigUwJ3XnlEFkGQLQq/2Dh6K7pPYxqlz 9A7eupRyBNNTzQnw24fMc556krwOefWJpdQAF51Dtm81YsMgLWRQP326BL7bXajE9AnQ rFETEc8TDwNAG4XtunwhaWlaDhvDghPof1eaIosJtcZsC/6m3SJ6ia+y5af/TnKbYoYN fn3BO3bE1aLiYw94xmgOvw9rA80Dsdi84gbxCx8ROffDkhtniAeJxzRqBn1PMlhdHwGM 18Kw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=RlVVp5ey41A4/xHfB5R+NY+MB0nkGXB8vLAeySU6ylg=; b=O0H1G0epE2Eri/X90paP0etWSIu4tuu1lAHnP7tyOkFSY+YU/mfPUJl0i+rMthGb5t BQDSulYnndz6AoMNfJlRvHHa2Nf78Xip6OiWiXquaCzZmVOktHrQkrXKMtco7UiQqv59 4nBwEuOwRug/HkkmAr3o6MGiYnLjIHoKtZQVYjU/rbiJulsW6+4z/op7SMdGxIJbpYVt 6uNIkk6xkbDrm9EMIynuCieHK2MUuBIJs0MSYfukvKJJuiHFWRdArDSmp4RQ3gnhrJES comSgT4n1a9WyP01wsBFYV9yLrxGAuUOdsSniPFtcJ3wSw2Bw27lHSOYn0Efuxc0L4TF KKPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=oVe02zEz; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=OAoiTM70; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si399470eds.221.2020.07.08.10.42.54; Wed, 08 Jul 2020 10:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=oVe02zEz; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=OAoiTM70; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726347AbgGHRmi (ORCPT + 99 others); Wed, 8 Jul 2020 13:42:38 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:41309 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgGHRmh (ORCPT ); Wed, 8 Jul 2020 13:42:37 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 4FBB62F2; Wed, 8 Jul 2020 13:42:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 08 Jul 2020 13:42:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=RlVVp5ey41A4/ xHfB5R+NY+MB0nkGXB8vLAeySU6ylg=; b=oVe02zEz2eNtnRU/u6ih82wxAgvvZ 6kjPbaeldSYzqtsqme0jKR+2qUIK60ucWadgg+VFJdYhhnigMhToLnCH6cdWlzsU iaKwoxYdUNPzMfPFnF4TPRfwUjpYpfXepkS//Nr1gMIfjpDztttgzuOd/xsUJ3iz E81YaygA5b7M476DQtObUYTsb90L6rRAvHNVP8tF1keA/Sqhy3ouNjGqcYSYJmXc w7WKFya33ZJNvgbyylmD5QUhp6vtfmlELkXwopQQt3wv4FBZMjwBmyc9IQrYzLlj UFG3dsHNKAlJJ9MF8TwZ9YbCzJbSzn0grxsd9JdoYEVQprHSHK0bLdY5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=RlVVp5ey41A4/xHfB5R+NY+MB0nkGXB8vLAeySU6ylg=; b=OAoiTM70 19Y1PDo24qMLUZEmUWOvhaBka+FIH5lNPbhS3GnBoV8Qq8wsoheFCU2uS5OvL/Qy Q7PKl4MS0lPDBC8M4BmDBndnAgey0c7OM6l7CAZnRcSvcYxkUP0xVSBa15owDPeW s3JngJMqYDFWauT8p+c7a9lrDSSHMNf3+jr5PHYLVDz0kpnAtem4F8A4A58UQipX kc0N4LU/N25Oi3VPT8O+cb9bkSEn8AeBjbKosYoZyjeLjxPZ0jHZPFqEkZ6I5oGU rKDQBFfzT0XoWkgA2DUPM6ETqthXWZXW/sQvEJzY9VtkzOXSpKwSZKocDGpApzM2 zl/s6rl8TDSMbQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudejgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 8A03030600A3; Wed, 8 Jul 2020 13:42:35 -0400 (EDT) From: Maxime Ripard To: Nicolas Saenz Julienne , Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell , Maxime Ripard Subject: [PATCH v4 03/78] drm/vc4: hvs: Boost the core clock during modeset Date: Wed, 8 Jul 2020 19:41:11 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to prevent timeouts and stalls in the pipeline, the core clock needs to be maxed at 500MHz during a modeset on the BCM2711. Reviewed-by: Eric Anholt Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_drv.h | 2 ++ drivers/gpu/drm/vc4/vc4_hvs.c | 9 +++++++++ drivers/gpu/drm/vc4/vc4_kms.c | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index e4cde1f9224b..6358f6ca8d56 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -320,6 +320,8 @@ struct vc4_hvs { void __iomem *regs; u32 __iomem *dlist; + struct clk *core_clk; + /* Memory manager for CRTCs to allocate space in the display * list. Units are dwords. */ diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 836d8799d79e..091fdf4908aa 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -19,6 +19,7 @@ * each CRTC. */ +#include #include #include @@ -540,6 +541,14 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) hvs->regset.regs = hvs_regs; hvs->regset.nregs = ARRAY_SIZE(hvs_regs); + if (hvs->hvs5) { + hvs->core_clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(hvs->core_clk)) { + dev_err(&pdev->dev, "Couldn't get core clock\n"); + return PTR_ERR(hvs->core_clk); + } + } + if (!hvs->hvs5) hvs->dlist = hvs->regs + SCALER_DLIST_START; else diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 08318e69061b..210cc2408087 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -11,6 +11,8 @@ * crtc, HDMI encoder). */ +#include + #include #include #include @@ -149,6 +151,7 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) { struct drm_device *dev = state->dev; struct vc4_dev *vc4 = to_vc4_dev(dev); + struct vc4_hvs *hvs = vc4->hvs; struct vc4_crtc *vc4_crtc; int i; @@ -160,6 +163,9 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) vc4_hvs_mask_underrun(dev, vc4_crtc->channel); } + if (vc4->hvs->hvs5) + clk_set_min_rate(hvs->core_clk, 500000000); + drm_atomic_helper_wait_for_fences(dev, state, false); drm_atomic_helper_wait_for_dependencies(state); @@ -182,6 +188,9 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) drm_atomic_helper_commit_cleanup_done(state); + if (vc4->hvs->hvs5) + clk_set_min_rate(hvs->core_clk, 0); + drm_atomic_state_put(state); up(&vc4->async_modeset); -- git-series 0.9.1