Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12EDBC6FD19 for ; Mon, 13 Mar 2023 08:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230155AbjCMIyb (ORCPT ); Mon, 13 Mar 2023 04:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230390AbjCMIxy (ORCPT ); Mon, 13 Mar 2023 04:53:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C910C5AB79 for ; Mon, 13 Mar 2023 01:51:17 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbdta-0001gg-NM; Mon, 13 Mar 2023 09:51:06 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pbdtZ-0004f2-TH; Mon, 13 Mar 2023 09:51:05 +0100 Date: Mon, 13 Mar 2023 09:51:05 +0100 From: Sascha Hauer To: Adam Ford Cc: arm-soc , Marek Vasut , Stefan Agner , David Airlie , Daniel Vetter , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , dri-devel , Linux Kernel Mailing List , Jagan Teki Subject: Re: MXSFB and Video PLL clock on i.MX8M Mini/Nano Question Message-ID: <20230313085105.GB7446@pengutronix.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 12, 2023 at 02:28:45PM -0500, Adam Ford wrote: > I am trying to work through a series that was submitted for enabling > the DSI on the i.MX8M Mini and Nano. I have extended this series to > route the DSI to an HDMI bridge, and I am able to get several > resolutions to properly sync on my monitor. However, there are also a > bunch that appear on the list when I run modetest that do not sync on > my monitor. > > When running some debug code, it appears that it's related to the > clocking of the MXSFB driver. > > From what I can tell, the MSXFB driver attempts to set the clock based > on the desired resolution and refresh rate. When the default > VIDEO_PLL clock is set to 594MHz, many of the resolutions that cleanly > divide from the 594MHz clock appear to sync with my monitor. However, > in order to get other resolutions to appear, I have to manually change > the device tree to set VIDEO_PLL to a different clock rate so MSXFB > can use it. Unfortunately, that breaks the resolutions that used to > work. > > I threw together a hack into the MXSFB driver which adds a new > optional clock to the MSXFB driver. When I pass VIDEO_PLL to this > driver, it can automatically set the clock rate to match that of > whatever the desired clock is, and I can get many more resolutions to > appear. > Another advantage of this is that the Video_PLL can be the minimum > speed needed for a given rate instead of setting a higher rate, then > dividing it down. Isn't it possible to add the CLK_SET_RATE_PARENT flag to the pixel clock? That's what i.MX6sx and i.MX7 do. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |