From patchwork Wed Nov 1 14:16:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 10036377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69407602B5 for ; Wed, 1 Nov 2017 14:16:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C2F228BCC for ; Wed, 1 Nov 2017 14:16:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40EE828BF9; Wed, 1 Nov 2017 14:16: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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BC4F228BCC for ; Wed, 1 Nov 2017 14:16:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC1076E74B; Wed, 1 Nov 2017 14:16:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by gabe.freedesktop.org (Postfix) with ESMTPS id 873A76E74B for ; Wed, 1 Nov 2017 14:16:33 +0000 (UTC) Received: from e110455-lin.cambridge.arm.com (e110455-lin.cambridge.arm.com [10.2.131.60]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id vA1EGPij007522; Wed, 1 Nov 2017 14:16:25 GMT From: Liviu Dudau To: Brian Starkey Subject: [PATCH] drm: hdlcd: Skip checking the clock provider when CRTC is disabled. Date: Wed, 1 Nov 2017 14:16:25 +0000 Message-Id: <20171101141625.3297-1-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.14.3 Cc: David Airlie , Mali DP Maintainers , LKML , DRI-devel X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some clock providers (clk-vexpress-osc) trigger a WARN() when the requested rate falls outside its capabilities, as is the case when a CRTC gets disabled. Check if the CRTC's new state is enabled and skip the clk_round_rate() call if it is not. Reported-by: Vladimir Murzin Signed-off-by: Liviu Dudau Tested-by: Vladimir Murzin --- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 72b22b805412b..a1387a8bf78c4 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -193,6 +193,10 @@ static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc, struct drm_display_mode *mode = &state->adjusted_mode; long rate, clk_rate = mode->clock * 1000; + /* if the crtc is disabled, skip the clock check */ + if (!state->enable) + return 0; + rate = clk_round_rate(hdlcd->clk, clk_rate); if (rate != clk_rate) { /* clock required by mode not supported by hardware */