Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2312976lqt; Mon, 22 Apr 2024 07:32:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDPW83s/RVlBIkzMDmVFWk3uqs6pD7mb+sBPXMmYqFJxa4SkkBW6Tk1BHOxhESYH9Mzo/Ir19bPxy+KiBMN4U1Grk7nY2kEBP0b3DnSw== X-Google-Smtp-Source: AGHT+IHgdzsI4ZeyE33HW6RlJBcOdjYqXAFSLMOu6TrgloUH7QC2daj/vZ28UPBhGc6dylQv7yD2 X-Received: by 2002:ac2:4da2:0:b0:518:ef44:60cd with SMTP id h2-20020ac24da2000000b00518ef4460cdmr5866202lfe.6.1713796360979; Mon, 22 Apr 2024 07:32:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713796360; cv=pass; d=google.com; s=arc-20160816; b=nCqGWOCIETBE+8Tj/zTL9K+eJ782Nuq9kwxd3htVmzqiMnvsk9roGuB3cFLp/kUUyU 05S/yyKDAFIY5ZkauW0RgGNhq+F55pnO2MbXxJ38pJ7fxdt8wtuvp1Qq7ReXZA8m42bY aVWYS7Bt4jlxB/jx5WGN66uNZhZfgmNQW9I8l++IUXIWxEJeVuEzqk8NFUbNNN79mqNO raQvXaF9fqdIfVGnl9IesufnxEaELgAB1BsvJ/D+HDCmAftmynSwx+iW716vrtNoN2JG 6DVfxC5sEMV+w14pyNqyqnB0zSOzSHSOoLAboEv5FB0hGJCPOE2Lvp8AYnCEa09biwOD PBVw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+8Sght38akXrLxpc8bIOrp7sk/H8IvN8R0IpAuGFtqg=; fh=/vZsIMkX1BdJ/RiLwSXGKFrnNxxYzvDrM2J8kTom6kM=; b=FtXZSOFSJiXmhxMyVrSnZ/lWphXEzOcdatUsO/tQPutWiIYeOPhdYbpVtygSLctaD4 jtAC2C0fO1LHBLaTtKBOQg2zIOs092oSRhXVeww1lj4wNMa63LwLhMIApJI1ysGJMjQl IstD4IO0CZ1e2DNFoPHanPhkSs7g41XWRsqdTNGthGNXXWI5cuFpkZ90jNJJVzfspmcW RfpAmxFxc6vw5ypkPdK5WnzDrgZrtAnh2jFPa5p5Z0x/wxfi/iK6VRjubVwhj0zDhRCf bjz9X0vVlORTjo3uRCYmotbq7P6Ezm98lWtXzvwS+skwxReSOnwExquW6+wrwBGOO5Az b6CA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b=ka1jsMQo; arc=pass (i=1 spf=pass spfdomain=geanix.com dkim=pass dkdomain=geanix.com dmarc=pass fromdomain=geanix.com); spf=pass (google.com: domain of linux-kernel+bounces-153546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153546-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id if18-20020a0564025d9200b00571cdc733a5si4833186edb.190.2024.04.22.07.32.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 07:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b=ka1jsMQo; arc=pass (i=1 spf=pass spfdomain=geanix.com dkim=pass dkdomain=geanix.com dmarc=pass fromdomain=geanix.com); spf=pass (google.com: domain of linux-kernel+bounces-153546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153546-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B18551F21508 for ; Mon, 22 Apr 2024 14:32:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A540F152160; Mon, 22 Apr 2024 14:32:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b="ka1jsMQo" Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57C621514C3 for ; Mon, 22 Apr 2024 14:32:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.40.30.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713796328; cv=none; b=Ct4U6LEvFnni76qvZ9ENSNi8bK4YF7HJJ21nMNDKS0I8XOhpxkDnQKSFj4lElMme89FtkgrZQh1C2nZRhrfXqgXjcNPW3ln/2oWbi5vO8al68mhtBBC6ixFcDRZ/ZpyLlMluatbm/brudYnNlNqKrxiFacc+7/97pr1u9iASs9s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713796328; c=relaxed/simple; bh=68Yl3pglrE91waDADM64DjqGLm27wUPpydhC5jftev0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jE+lH+RLnBzMgqcr+za3RHYwdbdMAQ4BoOxF7jLCESSj5hGMfA/QemQq/NMJheBDQK2Y8vH9pxVpJg4HsJxJ5LawnrrdooQP1ZT0LaGo5sgi3SwvaYUlk2QsJ8Korw7JNEPe8mzABPKe5YzuHRGbCxedcaOeVjSrunfQMtOpSnM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=geanix.com; spf=pass smtp.mailfrom=geanix.com; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b=ka1jsMQo; arc=none smtp.client-ip=188.40.30.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=geanix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=geanix.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID; bh=+8Sght38akXrLxpc8bIOrp7sk/H8IvN8R0IpAuGFtqg=; b=ka1jsM QoDI/leDOzmbaV9BZzCqMrm4r7sNDO7UV5WafQaSmnI59TzSKjAxpUIT1Dd3uwyqI9Yxb/FPFx1TQ cxyn7zmfwuIqR7a0HlHzZ6Db50kKVl5paNJ1n+Drnvf0N0cDsxCYHsgcTjMY82o93KNXXur6wU3WY nhYqjXSKvQJBvLlW+65d0Nowjg/BMMah78kfDXvJZMnCXzV3h7Moa9jLR//Y083CZtVP/OL79uonI Ts3yYDebuxJjC1hcrnkT86KLlOjqi/oB5zXYFfI+AZHlIrn4Y8+sOx3xBdlQIx3mb2yUAal+E1u1b zFDSu2lRup1vChyHGg6Dh8aQAfMw==; Received: from sslproxy07.your-server.de ([78.47.199.104]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ryuIX-0000qj-Vk; Mon, 22 Apr 2024 16:05:34 +0200 Received: from [2a06:4004:10df:0:781f:1970:8d00:73ed] (helo=Seans-MBP.snzone.dk) by sslproxy07.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ryuIW-000Jz9-2W; Mon, 22 Apr 2024 16:05:32 +0200 Date: Mon, 22 Apr 2024 16:05:31 +0200 From: Sean Nyekjaer To: Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre Torgue , Robert Foss , Antonio Borneo Cc: dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/stm: dsi: relax mode_valid clock tolerance Message-ID: References: <20240322104732.2327060-1-sean@geanix.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240322104732.2327060-1-sean@geanix.com> X-Authenticated-Sender: sean@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27253/Mon Apr 22 10:25:51 2024) On Fri, Mar 22, 2024 at 11:47:31AM +0100, Sean Nyekjaer wrote: > When using the DSI interface via DSI2LVDS bridge, it seems a bit harsh > to reguire the requested and the actual px clock to be within > 50Hz. A typical LVDS display requires the px clock to be within +-10%. > > In case for HDMI .5% tolerance is required. > > Fixes: e01356d18273 ("drm/stm: dsi: provide the implementation of mode_valid()") > Signed-off-by: Sean Nyekjaer > --- Any feedback on this? > drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c > index d5f8c923d7bc..97936b0ef702 100644 > --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c > +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c > @@ -322,8 +322,6 @@ dw_mipi_dsi_phy_get_timing(void *priv_data, unsigned int lane_mbps, > return 0; > } > > -#define CLK_TOLERANCE_HZ 50 > - > static enum drm_mode_status > dw_mipi_dsi_stm_mode_valid(void *priv_data, > const struct drm_display_mode *mode, > @@ -375,9 +373,10 @@ dw_mipi_dsi_stm_mode_valid(void *priv_data, > /* > * Filter modes according to the clock value, particularly useful for > * hdmi modes that require precise pixel clocks. > + * Check that px_clock is within .5% tolerance. > */ > - if (px_clock_hz < target_px_clock_hz - CLK_TOLERANCE_HZ || > - px_clock_hz > target_px_clock_hz + CLK_TOLERANCE_HZ) > + if (px_clock_hz < mult_frac(target_px_clock_hz, 995, 1000) || > + px_clock_hz > mult_frac(target_px_clock_hz, 1005, 1000)) > return MODE_CLOCK_RANGE; > > /* sync packets are codes as DSI short packets (4 bytes) */ > -- > 2.44.0 >