Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp197668imn; Tue, 2 Aug 2022 23:40:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sKGfryZIoBKkD9D5v73o9d4vw0wjGd1Kn0NmxbspwPbZyXRbkm298RDWja2LQ/DbYQXo8O X-Received: by 2002:a05:6a00:1248:b0:52b:ca7:f2b6 with SMTP id u8-20020a056a00124800b0052b0ca7f2b6mr24612546pfi.82.1659508859676; Tue, 02 Aug 2022 23:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659508859; cv=none; d=google.com; s=arc-20160816; b=U8Uk+ySZcDSshx8E2x/bRBel1Ij85R1OqQi1ZgkaoaltQ6vR50VCCqP/+u1GjkyQ9i 9K5GjjezVNCfYig2ISaV+iJq7gHtHrVAP0wkzFdofr6uKBvDgn8j0JqkxAD4SaanGwky ZDkeOzqbo4JrNtECyHDBJTYzMFaluJZgq5fL9FXdpa4u3plGCVPPRS3hgNScuRdoIvmo 2gsUhJSnc2t7VkhYfHBta2wVULUir/+sgmceyt0nrZvloLed1UVdbactA8yrj+k08uJI Aybu3y2zkCKt99PtzHlA+lOgY2wSEKyPGjyLjc46QvfWYSNhNdnAivq2BfwmHjTkO1tn lTUA== 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=3OcxwMCevS6DiXaic0at1ipY67DzYuy+vGOdhmCrEnA=; b=IRtyi8bgGaUzAn32jvJvSh29uOWnZcpygWrUBx9E78NztEjriMDVLf6u9QQTrJq1jH PMWW26PsqS7X3+53qq/rybjlVAot+Nd0fzbkx5CWByrRXbWY1fFIPqKs84L23e8S+NCf kVaNb4K+6lXa9e5VxYRNIec6UJHR3qTYymYgc0PFckqZZKjUXXSy9ZW4vO8Onu7K1usp cN+PeG9xkr9tokQ/G6fRRqUSUAhdTfJzryjgfNmiLyi/qgnneqZ/dqMDNMA4Fk1NbGRF gX4xhDtRTVV/uShMx/zRRFPsE54CE5bV0/xKuUSRXx27ZxnW51FoQMa+paR+Mxu2I9Dy pdJQ== 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 i2-20020a654d02000000b0041b557cea68si16934545pgt.25.2022.08.02.23.40.44; Tue, 02 Aug 2022 23:40:59 -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 S236712AbiHCGUu (ORCPT + 99 others); Wed, 3 Aug 2022 02:20:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235213AbiHCGUt (ORCPT ); Wed, 3 Aug 2022 02:20:49 -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 CF6D464E3 for ; Tue, 2 Aug 2022 23:20:47 -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 1oJ7kF-0003De-Qv; Wed, 03 Aug 2022 08:20:39 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oJ7k0-0002E4-PY; Wed, 03 Aug 2022 08:20:24 +0200 Date: Wed, 3 Aug 2022 08:20:24 +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: <20220803062024.vn7awasmifkp5xow@pengutronix.de> References: <20220801225538.qtdb5zd66g6ipewz@pengutronix.de> <20220802080820.jyf3tfpgcj3pvbtp@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-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. > burst-clock-frequency and that generates a byte clock. For 891000000, > the byte clock is 111375000. The burst-clock-frequency is the hs-clk and DDR. So the MIPI-DSI clock is burst-clock-frequency/2 which is in your case: 891000000/2 = 445500000. This clock is than divided by 3 within the ADV and you get your 148500000 pixel clock. This divide by 3 is detected automatically by the ADV due to the missing bit (see above). > Modetest timings for 1080p show: > > index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot > #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 > flags: nhsync, nvsync; type: driver > > > When looking at modetest, there is a clock for 1080p which appears to be 148500. > 111375000/148500 = 750. Please see above. > The rest of the entries in my table do not divide evenly. I don;t > know if that explains the lack of display, but it's something to note. > It seems to me that instead of fixing the > samsung,burst-clock-frequency to 891000000, we should make the desired > PLL related to the desired pixel clock so it divides evenly. Please see above. > Looking at NXP's kernel, I also noticed that their esc_prescaler is > based on the byte clock divided by 20MHz. With some small code > changes to get the PLL based on the desired pixel clock instead of > hard-coded, I was able to set > > samsung,burst-clock-frequency = <1500000000>; This is not correct since the burst-clock-freq. specifies the hs-clock for the data lanes (see above). > samsung,esc-clock-frequency = <20000000>; This is correct, we also use a esc-clock of 20MHz. > 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. > 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. > 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. Regards, Marco