From patchwork Mon Feb 25 14:39:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 10828641 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 3BC2417E6 for ; Mon, 25 Feb 2019 14:39:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ACD02B24A for ; Mon, 25 Feb 2019 14:39:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EF072B267; Mon, 25 Feb 2019 14:39:20 +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,MAILING_LIST_MULTI, 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 BCF062B24A for ; Mon, 25 Feb 2019 14:39:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C020F89781; Mon, 25 Feb 2019 14:39:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by gabe.freedesktop.org (Postfix) with ESMTP id B395589781 for ; Mon, 25 Feb 2019 14:39:17 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 787BE80D; Mon, 25 Feb 2019 06:39:17 -0800 (PST) Received: from e110467-lin.cambridge.arm.com (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AF1213F575; Mon, 25 Feb 2019 06:39:16 -0800 (PST) From: Robin Murphy To: liviu.dudau@arm.com Subject: [PATCH] drm: hdlcd: Stop failing atomic disable check Date: Mon, 25 Feb 2019 14:39:13 +0000 Message-Id: <57a68c52732f1b463b036168d2d53737821d1087.1550862776.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.20.1.dirty MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When __drm_atomic_helper_disable_all() tries to commit the disabled state, we end up in hdlcd_crtc_atomic_check() with a mode clock rate of 0. If the input clock has a nonzero minimum rate, this fails the clk_round_rate() check and prevents the CRTC being torn down cleanly. If we're disabling the output, though, then the clock rate should be pretty much irrelevant, so skip it in that case. The kerneldoc seems to imply that we probably shouldn't be looking at the rest of the state anyway if enable=false. Signed-off-by: Robin Murphy Acked-by: Liviu Dudau --- I'm still occasionally trying to get to the bottom of why the HDLCD on Juno doesn't work properly with recent upstream EDK2 (the Linux driver thinks it's initialised and taken over, but the hardware stays stuck displaying the last contents of the EFI framebuffer). I was hoping that just unbinding and reprobing the HDLCD/TDA998x drivers might help reset things hard enough to start working again, but sadly no... Robin. drivers/gpu/drm/arm/hdlcd_crtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index e4d67b70244d..30a0d9570b57 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -193,6 +193,9 @@ 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 (!state->enable) + return 0; + rate = clk_round_rate(hdlcd->clk, clk_rate); if (rate != clk_rate) { /* clock required by mode not supported by hardware */