Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp198326imn; Thu, 4 Aug 2022 02:21:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR6GvibS/4UvO9IF3Ls1LEfWRAwuQN5kHAhVdoPpZBHWm7hSX9lxSM1/1O2GurXoxNnFZU2H X-Received: by 2002:a05:6402:c47:b0:437:ce2d:c30d with SMTP id cs7-20020a0564020c4700b00437ce2dc30dmr1046208edb.395.1659604884552; Thu, 04 Aug 2022 02:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659604884; cv=none; d=google.com; s=arc-20160816; b=Ru7lXUjUgE4m7/TI+Z3fsBMA7VMfJyk64Splyz7TGM19RzLQRtAG5555br/5d8J8dP rZBNXOSCl2nssKqOFd0BTkYXPWfomN2fwL1xI1S5O33V0LV/ZY/cvDT9hn820lbwn0LS spuwC7VnRXKfQL3UZNdp/7c3ufTCwC+02S7HAg/PQKOGUNjDPUyLPTsiFW5tAsmLTWUq JAPQVXc2GwtfpJ/4cCuLlajHmDPAmAPnyTyNw4LttmUTBvCiht7IQ0MujqdUoWWyYS5j K3OisxNaZOaTNXlSCl0u61mVgtGNmkuccjsBmeScLcOgrq7QyeER6ROgv9UUvQjzKDE+ dbIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=3rWsaw7/9tc8UtwebxFHkpDVFrhmPry5/EYehWxF5/8=; b=cAqolppgbhF7Hqqe4EJLEXd+PeXT5XbAheJwGcPKuK7BsPmz/GfmW72yw88h8UcBSc UGDALApyl13JU5sGA/kFHtsqV6bZwtATiG4/t5t7q90xugd8Wox9w1wMtfZAt0fya5Ky cV6XXIA9ccMA/HiHO6RYmAy8N1olVU9K/zHdvN8uc9tiLq/CpHUAz3yAyqRjrSIzKstd U6DyzoyhzZ6Rfdx71GlFb/Dg/ayT9sXQi3DPh5ixftfKD7BrIbL9kQu8qYZiaVEYIYb1 KNxOFL/7NF0gN2DL7/KRzhysR64P/LFciKcD3PhRoxOLulnNyqpsib6RO9AsJ8slORaL ufQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw10-20020a170907a0ca00b0071200866b78si199994ejc.689.2022.08.04.02.20.58; Thu, 04 Aug 2022 02:21:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239507AbiHDIn3 (ORCPT + 99 others); Thu, 4 Aug 2022 04:43:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239224AbiHDImx (ORCPT ); Thu, 4 Aug 2022 04:42:53 -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 B49D767CB2 for ; Thu, 4 Aug 2022 01:41:33 -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 1oJWQ2-0007xA-P9; Thu, 04 Aug 2022 10:41:26 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oJWPw-00043J-Kr; Thu, 04 Aug 2022 10:41:20 +0200 Date: Thu, 4 Aug 2022 10:41:20 +0200 From: Marco Felsch To: Adam Ford Cc: Fabio Estevam , Marek Vasut , Stefan Agner , Jernej Skrabec , Daniel Vetter , Jonas Karlman , David Airlie , dri-devel , Neil Armstrong , NXP Linux Team , Robert Foss , Linux Kernel Mailing List , Pengutronix Kernel Team , Laurent Pinchart , Andrzej Hajda , Marek Szyprowski , Shawn Guo , Sascha Hauer , arm-soc , Jagan Teki , robert.chiras@nxp.com, laurentiu.palcu@nxp.com Subject: Re: imx8mm lcdif->dsi->adv7535 no video, no errors Message-ID: <20220804084120.in435n4ofdw6ksfj@pengutronix.de> References: <20220802080820.jyf3tfpgcj3pvbtp@pengutronix.de> <20220803062024.vn7awasmifkp5xow@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22-08-03, Adam Ford wrote: > On Wed, Aug 3, 2022 at 1:20 AM Marco Felsch wrote: > > > > On 22-08-02, Adam Ford wrote: > > > > ... > > > > > > I did some reading about the internal timing generator. It appears > > > > that it's required when video formats use fractional bytes, and it's > > > > preconfigured to run at 720p by default, but registers 28h through 37h > > > > configure it for other video modes. > > > > > > I think there may still be some issues with the DSIM since some of the > > > clock frequencies are set in the device tree. > > > > > > From what I can tell, the pixel rate is calculated based on the > > > > By pixel rate you mean the HDMI pixel rate from the ADV? If so then yes. > > The ADV has an divider which is already configured by the driver but > > meaningless since the driver is lacking of setting the "manual-divider" > > bit within the same register. > > I was thinking about the pixel clock from the DSI to the ADV. I did > see the manual-divider bit was missing. I tried enabling that bit, > but it didn't appear to make much difference. This depends, e.g. I saw that the HDMI pixel clock is correct if I had set this bit, set the divider manually to 6 and configured the dsi-host burst clock to 891MHz: -> 891MHz / 2 = 445.5 (DSI-Clock) -> 445.5 / 6 = 74.25 (HDMI pixel clock for 720P) Of course this doesn't happen automatically yet :( I also find it a bit of too reduce the lane line, I had removed this logic too. But as I said, I got no frames shown on my HDMI monitor. ... > > > samsung,burst-clock-frequency = <1500000000>; > > > > This is not correct since the burst-clock-freq. specifies the hs-clock > > for the data lanes (see above). > > But I don't think the clock should be fixed. I think it should vary as > the resolution changes. You're right and this is something we have on our TODO list as well. But this needs a bit more work within the DRM framework. So the client and the host can negotiate the frequency. Remember our main problem: with a correct burst-clock-frequency set and lane number set for 720P, the ADV don't display anything. > From what I can tell, NXP's DSI code doesn't > hard code this value, but it does appear to cap it at 1.5G. I did > soom looking into the NXP frequency calculation Can you provide me a link? There are a lot frequencies involved in this discussion ^^ Just that I look at the same location. > and it is capable of adjusting resolutions to some extent and from > what I can see the 891MHz clock is only set when 1080p. At 720p, > thier kernel shows the output frequency at 445.5 MHz. Yes, we need the dynamic handling but hardcoding it isn't the way we should go either. We have the dynamic PLL calculation, so we can configure it to all possible values not just a few VESA standards. > The way the DSIM is currently configured, it's fixed at 891MHz, so I > don't expect the output feeding the adv7535 to be correct for the > different resolutions. Why not? The ADV can work with that hs-clock and for 720P@60 we need a bandwidth of roughly (only pixels no package header/footer overhead): 1280x720x24x60 = 1327104000 Bit/s = 1327.104 MBit/s With 891MHz and 2 lanes we have 891MBps * 2 = 1782000000 Bit/s = 1782 MBit/s So this should be fine. With 445.5 MHz and 2 lanes we have not enough bandwidth and with 445.5 MHz and 4 lanes we have exactly the same bandwidth. Therefore I still think that there is problem within the ADV. ... > > > With these settings and the above mentioned code changes, 1080p still > > > appears, however when attempting other modes, the display still fails > > > to load. I also noticed that the phy ref clock is set to 27MHz > > > instead of NXP's 12MHz. > > > > That's interesting, I didn't noticed that NXP uses 12 MHz as refclock > > but I don't think that this is the problem. Since we have other > > converter chips using the bridge driver and they work fine. I still > > think that the main problem is within the ADV driver. > > Do the other converter chips work fine at different resolutions? Yes. > > > > > > I attempted to play with that setting, but I couldn't get 1080p to > > > work again, so I backed it out. > > > > > > Maybe I am headed in the wrong direction, but I'm going to examine the > > > P/M/S calculation of the timing on NXP's kernel to see how the DSIM in > > > this code compares. > > > > I think the pms values are fine. > > I compared the P/M/S values between this driver and NXP's and they > calculate different values of PMS when running at 1080P. NXP don't calculate anything if I remember correctly, they just provide PLL values so they reach the frequency. On the other hand with the patches from Jagan we can configure the PLL to what-ever value :) > NXP @ 1080p: > fout = 891000, fin = 12000, m = 297, p = 2, s = 1, best_delta = 0 > > This kernel @ 1080p: > > PLL freq 891000000, (p 3, m 99, s 0) As you said, we use a differnet fin value 27MHz instead of the 12MHz so those values must be different. > at 720P, the NXP Kernel > fout = 445500, fin = 12000, m = 297, p = 2, s = 2, best_delta = 0 > (working) > > at 720P, this kernel: > PLL freq 891000000, (p 3, m 99, s 0) > hs_clk = 891000000, byte_clk = 111375000, esc_clk = 18562500 > (not working) Yes, as I said you need to configure the PLL manually (see above). > > > If someone who understands the interactions between these different > > > components has suggestions, I'm willing to run some experiments. > > > > Did managed to get access to the ADV7535 programming guide? This is the > > black box here. Let me check if I can provide you a link with our repo > > so you can test our current DSIM state if you want. > > I do have access to the programming guide, but it's under NDA, but > I'll try to answer questions if I can. Thanks a lot for your work :) Regards, Marco