Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2249590ybd; Mon, 24 Jun 2019 03:17:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhaMia7TddKR20qpFK4c2e9h1DCixYHvtV9fB5P1/U4Mc6PZGdbNWFDaKNqNAAlw4WOr8N X-Received: by 2002:a17:902:d70a:: with SMTP id w10mr133344313ply.251.1561371454043; Mon, 24 Jun 2019 03:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371454; cv=none; d=google.com; s=arc-20160816; b=y69JL1ONZTIFAg5YN/hzpIkuwQ/SJtdIGzmgkK9+HEWOKGUqSxF1uEwj7CGd/upWnO EhXRqiAKdo3w8/gf74hJ37PZN2y9x8MGrHYC1cvZ13XtSdOIBpVJg7R+An3XqIhPLIbB zTtFPmuoMA9gmnqW1e6K88Wcjy7EHgYK3ORuu6i3adtoVpCcc/LauN17x88PE9j3u6v/ KWKFC4Hp5xZ2LyMT6tu60SopfzssfA6vLcNJFTWG+RfYs9D2hkj6Ot4odsMbCoVgcnbA 0HLsVRQJ58VXEaNxtfaPeYdK63T1H0WOevqNNuBxkqnj+BCwzrSkmo9Jw15F6oZT3soB fXug== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=clZ62DtP7Hqyzyd3ZT2oFCuDuG+pbW0HUrwlkyH80rM=; b=PXFuQrEUSNPc4DAxCWi7vKHCiwKweNS2JrNW0Ribkh6KX1AYFUGwCPO66e7xyrZnFc dlaAA1PJVkTx6DUtV5jN0i2iOBsyvKNHig9bljFhocUA+xAz+Bzfwvi/ffxdLUZ3j0nB Vpf92OiRLVDHXjH389kdI4k7iJn2IoBGVvie/35YjU92kaPy06qTXyDTG6lKRwB8LPlB t5zdhHj5G2KC4q1Pg4i7eaZA2GYaMs8x/OBmVBc4K1I0HcIM2qeULGb04VFe7jEbhe9x 4756i1NGSd/42e/eVxNx/z0Ayva2cJ7IQYOSOsBen8PrM7JpPeTkKFKbSGsy7nF/H4pg dAJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nepFQr3s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si10602600pjw.61.2019.06.24.03.17.18; Mon, 24 Jun 2019 03:17:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nepFQr3s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730791AbfFXKQp (ORCPT + 99 others); Mon, 24 Jun 2019 06:16:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:54200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730781AbfFXKQl (ORCPT ); Mon, 24 Jun 2019 06:16:41 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 31BCD21655; Mon, 24 Jun 2019 10:16:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371400; bh=Bmlf/63L1YzhRKCsfRGGeoOTY9ucH6F4dWz5ixnJi0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nepFQr3sR+RuwUEpQTLFk6UXN+K0RiYz3vEOXWE1rukQgQWIUgl1cn3GSwbXCXJNF 8YWPl7EMrGpQRZHr9eJXrTjfTR5LULTvyiMRVpQH8NaZnQUQOSHXt8MSpC28OBicZ9 QIZLETYLUuToK5J89iVMvMDV5g+B1wN4gzgi4cPE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robin Murphy , Liviu Dudau , Sasha Levin Subject: [PATCH 5.1 072/121] drm/arm/hdlcd: Allow a bit of clock tolerance Date: Mon, 24 Jun 2019 17:56:44 +0800 Message-Id: <20190624092324.588994531@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 1c810739097fdeb31b393b67a0a1e3d7ffdd9f63 ] On the Arm Juno platform, the HDLCD pixel clock is constrained to 250KHz resolution in order to avoid the tiny System Control Processor spending aeons trying to calculate exact PLL coefficients. This means that modes like my oddball 1600x1200 with 130.89MHz clock get rejected since the rate cannot be matched exactly. In practice, though, this mode works quite happily with the clock at 131MHz, so let's relax the check to allow a little bit of slop. Signed-off-by: Robin Murphy Signed-off-by: Liviu Dudau Signed-off-by: Sasha Levin --- drivers/gpu/drm/arm/hdlcd_crtc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index ecac6fe0b213..a3efa28436ea 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -193,7 +193,8 @@ static enum drm_mode_status hdlcd_crtc_mode_valid(struct drm_crtc *crtc, long rate, clk_rate = mode->clock * 1000; rate = clk_round_rate(hdlcd->clk, clk_rate); - if (rate != clk_rate) { + /* 0.1% seems a close enough tolerance for the TDA19988 on Juno */ + if (abs(rate - clk_rate) * 1000 > clk_rate) { /* clock required by mode not supported by hardware */ return MODE_NOCLOCK; } -- 2.20.1