| Message ID | kcEE.rJtELH1tRkiK3DwrGM4cgg.ADqA2lER2QE@vtuxmail01.tq-net.de |
|---|---|
| Headers |
Return-Path: <linux-amarula+bncBAABBRXD6GOAMGQEKCAMDDQ@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 297543F081 for <linux-amarula@patchwork.amarulasolutions.com>; Fri, 16 Dec 2022 14:25:27 +0100 (CET) Received: by mail-wm1-f70.google.com with SMTP id r129-20020a1c4487000000b003d153a83d27sf1223500wma.0 for <linux-amarula@patchwork.amarulasolutions.com>; Fri, 16 Dec 2022 05:25:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671197127; cv=pass; d=google.com; s=arc-20160816; b=TPPYejEVMcKi3pfKJFedBfMUyWucaLrpjFVxk1Mk3gt/Oqx6DUMcD8jf2l0VnHsx9J jFYbGHD62KQkFC2SE257yE1G5Jki6XPJs0l846U7h7dnYSx9eTENTiCRUDUX95OOyOT1 kPcUC40OsqQEntCEc+8eNHfXWnzyoRjlYoM71hhnW0ameX0z1WMASz/bCMK9lSxGgdcT a3ZNhzoEpUXF48wzouBPVapuvN+BB2UKCwlWPW1VzCq+EXz5d7JDPvY1b/NFROj7i5tv 6JnfGpyrOxz7YU4bauyuXBaXub4wUiBZ3HS+MFn2PpePWFSL6oCfIyjwTFa1HYuwak5Z PMBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:message-id:mime-version:date:cc:to:from :subject:sender:dkim-signature; bh=bV8lzqwl/tPT1n+LPYzLRcw/TlfU+FT8XiHCLmiWIcg=; b=BeLgprxMFQ+j1Pyk2aWE8xSp31Kx2YH6awPmz3Taqx2iMEYwAx4RRIT8EaU24PGf4A +KkhN1diWhZt8ZeI4D+I8HJVvSY6coHHDXToUJ2m2k0A5Q6027dzge2v+aIGVGIlhop/ v5NBOrrWwqhBdPoeSmtjtG6MQWq2stZcH9puxt4pKLTjiNjOEAEAvDDOH/usTBm2lTtf 60KY+pIHXL5N/OiCbKLrsVoaaDi++DKLjjTSu5YreaC3vB8hdE7ZH4GKkdIpjhScdbkZ YOpkblIUHY9f7KdM+/+IHF0gIOeuwVHVYDhScyElbRJO7yPTRd0Gi+e1nzrf+Y+tUjYg rGtA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=K7l5P3KC; dkim=pass header.i=@tq-group.com header.s=key1 header.b=K7l5P3KC; spf=pass (google.com: domain of alexander.stein@ew.tq-group.com designates 93.104.207.81 as permitted sender) smtp.mailfrom=Alexander.Stein@ew.tq-group.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:message-id:mime-version:date:cc:to:from:subject :sender:from:to:cc:subject:date:message-id:reply-to; bh=bV8lzqwl/tPT1n+LPYzLRcw/TlfU+FT8XiHCLmiWIcg=; b=Cr2bDkea0TZBypYXTQgKnn1N5P8yfS8BenIjtNCUvxQ0vIzo4eptd4bw7cxlcksWxe PvkpPd7mBzhP77cLj0PqQ6k2qhX46L0rkof3EtXDysQ/FXkmOyweWZtr1NUgB2QDea8C u26H+PveCqGr4LA28F5WYo4NQ8FxNn8MUqkyU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:message-id :mime-version:date:cc:to:from:subject:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=bV8lzqwl/tPT1n+LPYzLRcw/TlfU+FT8XiHCLmiWIcg=; b=z4aTipX36BM+bXwPljcGntYXbLZUw/2u1LkvpQzKgW+6MUvwOG+zxoXg5nfBelrp3k K8mt8kn89XdmdQkwjINCc/Mv8Q0GuXGixmkmzNs+S7wq26csHq51dhy90HmXnJmCW943 B401qbh0+0iSrWQTPI5bGcqLKGoE8t3tbUalmVbXXavc+md1AvqTGAPw4xqi65mIXMbG +tj8Vzntf0+l5yhZm9Q64nUJn+/lgagSHCjtxB7m3gWXahSRy4tKTHw6Ud056doEutBd 2/8+STSrb8fR6jhBQbuyC3NK9RgdqTzBs7Tq+Mwg8nUWz9Rrkl+9/0NL9rSYew200rNO xEBw== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: ANoB5pkLQJUIk3swk64q8zQeGpizLv7XM8zB1kbwr3rZZ+n/8mjb4Gbb 6h+vIzHVFr2KZiX01a8pMO9+Mri7 X-Google-Smtp-Source: AA0mqf5wv7evtoj+ZMp9gGkPmtuo6HmvhHi0bA8nUVRr1E0aZO22efgQp/V8OZ9ZR6WJPKbIVpW2eA== X-Received: by 2002:a05:600c:2941:b0:3cf:88df:d355 with SMTP id n1-20020a05600c294100b003cf88dfd355mr633852wmd.141.1671197126840; Fri, 16 Dec 2022 05:25:26 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:adf:d20a:0:b0:228:ddd7:f40e with SMTP id j10-20020adfd20a000000b00228ddd7f40els1658039wrh.3.-pod-prod-gmail; Fri, 16 Dec 2022 05:25:26 -0800 (PST) X-Received: by 2002:a05:6000:1e0d:b0:252:5adc:238a with SMTP id bj13-20020a0560001e0d00b002525adc238amr10915189wrb.33.1671197125942; Fri, 16 Dec 2022 05:25:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671197125; cv=none; d=google.com; s=arc-20160816; b=voFJaV7JcZgkPn7xbCl/Tce+UjpwA/K7LWDf1YliQaPODo2yPuW3JBQfJsy43o1BUA JtepY3zOhTbojjddwFZD+IRrdmZqQPRJ7Yb+1/R6U7v/DWCjpci160RPOGExAhEF5OeK 3fVnPnj/ibqoiojSEi9X0D9lONXBorr4OJnhhvLRFC7EPHwtQEseAdGt1gOcz27arCoU 8EBVHo2xVeDIzw+SqXn2AW+RhpOapoBgFYCPQQrf6QzXW0kI6yGq3URsmcNDkZGYv5wF R5TUytH0X/KSsGjPIIFklkJq0QLWhTr902AWDlXlSTdyH3lttsKlfvzbL8MbV+Hehy8p nfSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:content-transfer-encoding:mime-version:date:cc:to:from :subject:dkim-signature:dkim-signature; bh=2rOMZ+WqluKpGt9T2gsxd25x1tfiSnhzu7edlmN+S9g=; b=hOXA86VXO9PbejVEQqEFp/4sgsNXmXpIiaACDIlNymU41jMVsPBQrrrEMZrr7m/KAj 7GytlmUik7sp3qkmJMidOAPp77HalhwENFw/cvwOejBIASaT45HYVBwf0DAyHt/4Fl7H n1b0F8f0ko5N8q+vNpZpwid/GFUhuusZ4hgahvjTy/ToB9/rZwSsnTbKw2dKqqS5f2JG 9/szy8Ey6+fMD/qXVkDUYt0mftn4ldI9U2vyfx89gJOHHuQN1AoZ6SfWd9lI43F4J/Xj Fg7HVsTVyDzjuLb+AnKXCdH7keCsgAmuZk8o8wmyZNDIZNxrOmrHx8Q3GvVWbR9i1zlj gHkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=K7l5P3KC; dkim=pass header.i=@tq-group.com header.s=key1 header.b=K7l5P3KC; spf=pass (google.com: domain of alexander.stein@ew.tq-group.com designates 93.104.207.81 as permitted sender) smtp.mailfrom=Alexander.Stein@ew.tq-group.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: from mx1.tq-group.com (mx1.tq-group.com. [93.104.207.81]) by mx.google.com with ESMTPS id bj30-20020a0560001e1e00b0024258f2fc57si1967354wrb.823.2022.12.16.05.25.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2022 05:25:25 -0800 (PST) Received-SPF: pass (google.com: domain of alexander.stein@ew.tq-group.com designates 93.104.207.81 as permitted sender) client-ip=93.104.207.81; X-IronPort-AV: E=Sophos;i="5.96,249,1665439200"; d="scan'208";a="28001487" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 16 Dec 2022 14:25:25 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Fri, 16 Dec 2022 14:25:25 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Fri, 16 Dec 2022 14:25:25 +0100 X-IronPort-AV: E=Sophos;i="5.96,249,1665439200"; d="scan'208";a="28001486" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 16 Dec 2022 14:25:25 +0100 Received: from vtuxmail01.tq-net.de (localhost [127.0.0.1]) by vtuxmail01.tq-net.de (Postfix) with ESMTP id DFA1E280071; Fri, 16 Dec 2022 14:25:24 +0100 (CET) Received: by vtuxmail01 (kopano-spooler) with MAPI; Fri, 16 Dec 2022 14:25:24 +0100 Subject: [PATCH v10 00/18] drm: Add Samsung MIPI DSIM bridge From: "Alexander Stein" <Alexander.Stein@ew.tq-group.com> To: "Andrzej Hajda" <andrzej.hajda@intel.com>, "Inki Dae" <inki.dae@samsung.com>, "Marek Szyprowski" <m.szyprowski@samsung.com>, Joonyoung Shim <jy0922.shim@samsung.com>, "Seung-Woo Kim" <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, "Frieder Schrempf" <frieder.schrempf@kontron.de>, "Fancy Fang" <chen.fang@nxp.com>, Tim Harvey <tharvey@gateworks.com>, "Michael Nazzareno Trimarchi" <michael@amarulasolutions.com>, "Adam Ford" <aford173@gmail.com>, Neil Armstrong <narmstrong@linaro.org>, "Robert Foss" <robert.foss@linaro.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, "Tommaso Merciai" <tommaso.merciai@amarulasolutions.com>, dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>, Marek Vasut <marex@denx.de> Cc: linux-samsung-soc@vger.kernel.org <linux-samsung-soc@vger.kernel.org>, "Matteo Lisi" <matteo.lisi@engicam.com>, "NXP Linux Team" <linux-imx@nxp.com>, linux-amarula <linux-amarula@amarulasolutions.com>, linux-arm-kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>, Jagan Teki <jagan@amarulasolutions.com> Date: Fri, 16 Dec 2022 13:25:24 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Priority: 3 (Normal) X-Mailer: Kopano 8.7.82 Message-Id: <kcEE.rJtELH1tRkiK3DwrGM4cgg.ADqA2lER2QE@vtuxmail01.tq-net.de> X-Original-Sender: alexander.stein@ew.tq-group.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=K7l5P3KC; dkim=pass header.i=@tq-group.com header.s=key1 header.b=K7l5P3KC; spf=pass (google.com: domain of alexander.stein@ew.tq-group.com designates 93.104.207.81 as permitted sender) smtp.mailfrom=Alexander.Stein@ew.tq-group.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
drm: Add Samsung MIPI DSIM bridge
|
|
Message
Alexander Stein
Dec. 16, 2022, 1:25 p.m. UTC
Hi Marek, Am Freitag, 16. Dezember 2022, 13:58:13 CET schrieb Marek Vasut: > On 12/16/22 13:41, Alexander Stein wrote: > > Hi, > > Hi, > > > thanks for the new update. > > > > Am Mittwoch, 14. Dezember 2022, 13:58:49 CET schrieb Jagan Teki: > >> This series supports common bridge support for Samsung MIPI DSIM > >> which is used in Exynos and i.MX8MM SoC's. > >> > >> The final bridge supports both the Exynos and i.MX8M Mini/Nano/Plus. > >> > >> Patch 0001 - 0004: adding devm_drm_of_dsi_get_bridge > >> > >> Patch 0005 - 0006: optional PHY, PMS_P offset > >> > >> Patch 0007 : introduce hw_type > >> > >> Patch 0008 : fixing host init > >> > >> Patch 0009 : atomic_check > >> > >> Patch 0010 : input_bus_flags > >> > >> Patch 0011 : atomic_get_input_bus_fmts > >> > >> Patch 0012 - 0013: component vs bridge > >> > >> Patch 0014 : DSIM bridge > >> > >> Patch 0015 - 0016: i.MX8M Mini/Nano > >> > >> Patch 0017 - 0018: i.MX8M Plus > > > > Tested using LVDS bridges and works on: > > * imx8mp-tqma8mpql-mba8mpxl (i.MX8M Plus) > > * imx8mm-tqma8mqml-mba8mx (i.MX8M Mini) > > * imx8mn-tqma8mqnl-mba8mx (i.MX8M Nano) > > > > But I noticed that tqma8mqml and tqma8mqnl only have a stable output if I > > specify 'data-lanes = <0 1 2>' (not <0 1 2 3>!) on the DSI-LVDS-Bridge (TI > > SN65DSI83) input endpoint, e.g. > > > > dsi_lvds_bridge: bridge@2d { > > > > compatible = "ti,sn65dsi83"; > > reg = <0x2d>; > > enable-gpios = <&gpio_delays 0 130000 0>; > > vcc-supply = <®_sn65dsi83_1v8>; > > status = "okay"; > > ports { > > > > #address-cells = <1>; > > #size-cells = <0>; > > port@0 { > > > > reg = <0>; > > lvds_bridge_in: endpoint { > > > > data-lanes = <0 1 2>; > > remote-endpoint = <&mipi_dsi_out>; > > > > }; > > > > }; > > port@2 { > > > > reg = <2>; > > lvds_bridge_out: endpoint { > > > > remote-endpoint = <&panel_in_lvds0>; > > > > }; > > > > }; > > > > }; > > > > }; > > > > I have no idea if this is on the DSIM side or the DSI-LVDS bridge side. > > Register 0xe5 on sn65dsi83 shows that CHA_LPP_ERR and CHA_SOT_BIT_ERR > > error > > bits are set, indicating there are low level protocol and SoT leader > > sequence bit errors. I can't find any significant difference in sn65dsi83 > > driver compared to downstream-kernel, so I would assume something in DSIM > > driver is different. > > Make sure the HS clock rate expected by the DSI83 bridge chip and the > one generated by the DSIM bridge from PMS PLL match. There is currently > no negotiation of this frequency and both sides divine it on their own. > > See sn65dsi83_get_dsi_range() and samsung_dsim_set_pll(). Oh, nice, thanks for the pointer. When setting > samsung,burst-clock-frequency = <668250000>; in imx8mm.dtsi I get a non-flickering display using 4 lanes. Although admittedly this is just random guessing. I'm not sure which clock exactly has to be in the range CHA_DSI_CLK_RANGE is configured to. With 4 lanes SN65DSI84 is configured for 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: > samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) > samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, esc_clk = 16706250 AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just from DT properties, while SN65DSI84 is using display mode and number of lanes. Is it expected that the DSIM PLL frequencies are set in DT for a specific bridge/display setup? Best regards, Alexander
Comments
On 12/16/22 14:25, Alexander Stein wrote: Hi, [...] > Oh, nice, thanks for the pointer. When setting >> samsung,burst-clock-frequency = <668250000>; > in imx8mm.dtsi > I get a non-flickering display using 4 lanes. Although admittedly this is just > random guessing. I'm not sure which clock exactly has to be in the range > CHA_DSI_CLK_RANGE is configured to. With 4 lanes SN65DSI84 is configured for > 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: >> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) >> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, esc_clk > = 16706250 If I recall it right, minimum PLL frequency is: fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz the link frequency is then fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) So DSI83 should be in the range of 80..85 MHz input clock if I calculate this right. Can you check what is the value of mode->clock, the mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 sm65dsi83_get_dsi_range() ? > AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just from DT > properties, while SN65DSI84 is using display mode and number of lanes. > > Is it expected that the DSIM PLL frequencies are set in DT for a specific > bridge/display setup? No, there should be negotiation between the host and bridge/panel, I tried to propose two variants, but they were all rejected.
On Sat, Dec 17, 2022 at 5:56 PM Marek Vasut <marex@denx.de> wrote: > > On 12/16/22 14:25, Alexander Stein wrote: > Hi, > > [...] > > > Oh, nice, thanks for the pointer. When setting > >> samsung,burst-clock-frequency = <668250000>; > > in imx8mm.dtsi > > I get a non-flickering display using 4 lanes. Although admittedly this is just > > random guessing. I'm not sure which clock exactly has to be in the range > > CHA_DSI_CLK_RANGE is configured to. With 4 lanes SN65DSI84 is configured for > > 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: > >> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) > >> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, esc_clk > > = 16706250 > > If I recall it right, minimum PLL frequency is: > > fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz > > the link frequency is then > > fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) > > So DSI83 should be in the range of 80..85 MHz input clock if I calculate > this right. Can you check what is the value of mode->clock, the > mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 > sm65dsi83_get_dsi_range() ? > > > AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just from DT > > properties, while SN65DSI84 is using display mode and number of lanes. > > > > Is it expected that the DSIM PLL frequencies are set in DT for a specific > > bridge/display setup? > > No, there should be negotiation between the host and bridge/panel, I > tried to propose two variants, but they were all rejected. For one of Jagan's previous revisions, I added some code to let the PHY auto adjust the frequencies instead of being fixed. NXP had this in their downstream kernel, but with this patch and another, I was able to set a variety of pixel clocks from my HDMI monitor and my DSI83. I haven't had time to re-base my work on Jagan's latest work, but you can link to the patch I did for the older stuff here: https://github.com/aford173/linux/commit/e845274b0f22ba3b24813ffd6bb3cb88ab4b67e4 and https://github.com/aford173/linux/commit/3f90057eb608f96d106029ef639813475241936f I've been traveling a lot lately, so I haven't had time to evaluate his series, but I hope to get something like those re-based once the DSI stuff has been accepted. adam
On 12/18/22 05:23, Adam Ford wrote: > On Sat, Dec 17, 2022 at 5:56 PM Marek Vasut <marex@denx.de> wrote: >> >> On 12/16/22 14:25, Alexander Stein wrote: >> Hi, >> >> [...] >> >>> Oh, nice, thanks for the pointer. When setting >>>> samsung,burst-clock-frequency = <668250000>; >>> in imx8mm.dtsi >>> I get a non-flickering display using 4 lanes. Although admittedly this is just >>> random guessing. I'm not sure which clock exactly has to be in the range >>> CHA_DSI_CLK_RANGE is configured to. With 4 lanes SN65DSI84 is configured for >>> 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: >>>> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) >>>> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, esc_clk >>> = 16706250 >> >> If I recall it right, minimum PLL frequency is: >> >> fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz >> >> the link frequency is then >> >> fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) >> >> So DSI83 should be in the range of 80..85 MHz input clock if I calculate >> this right. Can you check what is the value of mode->clock, the >> mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 >> sm65dsi83_get_dsi_range() ? >> >>> AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just from DT >>> properties, while SN65DSI84 is using display mode and number of lanes. >>> >>> Is it expected that the DSIM PLL frequencies are set in DT for a specific >>> bridge/display setup? >> >> No, there should be negotiation between the host and bridge/panel, I >> tried to propose two variants, but they were all rejected. > > For one of Jagan's previous revisions, I added some code to let the > PHY auto adjust the frequencies instead of being fixed. NXP had this > in their downstream kernel, but with this patch and another, I was > able to set a variety of pixel clocks from my HDMI monitor and my > DSI83. I haven't had time to re-base my work on Jagan's latest work, > but you can link to the patch I did for the older stuff here: > > https://github.com/aford173/linux/commit/e845274b0f22ba3b24813ffd6bb3cb88ab4b67e4 > and > https://github.com/aford173/linux/commit/3f90057eb608f96d106029ef639813475241936f > > I've been traveling a lot lately, so I haven't had time to evaluate > his series, but I hope to get something like those re-based once the > DSI stuff has been accepted. I have these two attempts, both rejected: https://patchwork.freedesktop.org/patch/475207/ https://patchwork.freedesktop.org/patch/496049/
On Sat, Dec 17, 2022 at 10:33 PM Marek Vasut <marex@denx.de> wrote: > > On 12/18/22 05:23, Adam Ford wrote: > > On Sat, Dec 17, 2022 at 5:56 PM Marek Vasut <marex@denx.de> wrote: > >> > >> On 12/16/22 14:25, Alexander Stein wrote: > >> Hi, > >> > >> [...] > >> > >>> Oh, nice, thanks for the pointer. When setting > >>>> samsung,burst-clock-frequency = <668250000>; > >>> in imx8mm.dtsi > >>> I get a non-flickering display using 4 lanes. Although admittedly this is just > >>> random guessing. I'm not sure which clock exactly has to be in the range > >>> CHA_DSI_CLK_RANGE is configured to. With 4 lanes SN65DSI84 is configured for > >>> 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: > >>>> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) > >>>> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, esc_clk > >>> = 16706250 > >> > >> If I recall it right, minimum PLL frequency is: > >> > >> fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz > >> > >> the link frequency is then > >> > >> fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) > >> > >> So DSI83 should be in the range of 80..85 MHz input clock if I calculate > >> this right. Can you check what is the value of mode->clock, the > >> mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 > >> sm65dsi83_get_dsi_range() ? > >> > >>> AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just from DT > >>> properties, while SN65DSI84 is using display mode and number of lanes. > >>> > >>> Is it expected that the DSIM PLL frequencies are set in DT for a specific > >>> bridge/display setup? > >> > >> No, there should be negotiation between the host and bridge/panel, I > >> tried to propose two variants, but they were all rejected. > > > > For one of Jagan's previous revisions, I added some code to let the > > PHY auto adjust the frequencies instead of being fixed. NXP had this > > in their downstream kernel, but with this patch and another, I was > > able to set a variety of pixel clocks from my HDMI monitor and my > > DSI83. I haven't had time to re-base my work on Jagan's latest work, > > but you can link to the patch I did for the older stuff here: > > > > https://github.com/aford173/linux/commit/e845274b0f22ba3b24813ffd6bb3cb88ab4b67e4 > > and > > https://github.com/aford173/linux/commit/3f90057eb608f96d106029ef639813475241936f > > > > I've been traveling a lot lately, so I haven't had time to evaluate > > his series, but I hope to get something like those re-based once the > > DSI stuff has been accepted. > > I have these two attempts, both rejected: > > https://patchwork.freedesktop.org/patch/475207/ > https://patchwork.freedesktop.org/patch/496049/ I have some patches re-based to Jagan's latest branch. It doesn't impact any drivers other than the new samsung-dsim driver, and it doesn't touch any of the drm helper functions either. It adjusts hs clock based on the connected device. I am not sure what the impact will have on the attached Exynos devices, so I am expecting some iterations. Right now it's working with my DSI83 chip, but I need to get it working with my adv7535 part as well. On the older branch, I was able to sync the ad7535 with a variety of resolutions using different pixel clock rates. Once I get it working again with my adv7535 and cleaned up, I'll submit the patches to the drm group, and I'll CC you, Jagan and Marek Szyprowski with a reference to Jagan's series so people wanting to try it can apply it to his branch. adam
On 12/18/22 23:24, Adam Ford wrote: > On Sat, Dec 17, 2022 at 10:33 PM Marek Vasut <marex@denx.de> wrote: >> >> On 12/18/22 05:23, Adam Ford wrote: >>> On Sat, Dec 17, 2022 at 5:56 PM Marek Vasut <marex@denx.de> wrote: >>>> >>>> On 12/16/22 14:25, Alexander Stein wrote: >>>> Hi, >>>> >>>> [...] >>>> >>>>> Oh, nice, thanks for the pointer. When setting >>>>>> samsung,burst-clock-frequency = <668250000>; >>>>> in imx8mm.dtsi >>>>> I get a non-flickering display using 4 lanes. Although admittedly this is just >>>>> random guessing. I'm not sure which clock exactly has to be in the range >>>>> CHA_DSI_CLK_RANGE is configured to. With 4 lanes SN65DSI84 is configured for >>>>> 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: >>>>>> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) >>>>>> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, esc_clk >>>>> = 16706250 >>>> >>>> If I recall it right, minimum PLL frequency is: >>>> >>>> fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz >>>> >>>> the link frequency is then >>>> >>>> fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) >>>> >>>> So DSI83 should be in the range of 80..85 MHz input clock if I calculate >>>> this right. Can you check what is the value of mode->clock, the >>>> mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 >>>> sm65dsi83_get_dsi_range() ? >>>> >>>>> AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just from DT >>>>> properties, while SN65DSI84 is using display mode and number of lanes. >>>>> >>>>> Is it expected that the DSIM PLL frequencies are set in DT for a specific >>>>> bridge/display setup? >>>> >>>> No, there should be negotiation between the host and bridge/panel, I >>>> tried to propose two variants, but they were all rejected. >>> >>> For one of Jagan's previous revisions, I added some code to let the >>> PHY auto adjust the frequencies instead of being fixed. NXP had this >>> in their downstream kernel, but with this patch and another, I was >>> able to set a variety of pixel clocks from my HDMI monitor and my >>> DSI83. I haven't had time to re-base my work on Jagan's latest work, >>> but you can link to the patch I did for the older stuff here: >>> >>> https://github.com/aford173/linux/commit/e845274b0f22ba3b24813ffd6bb3cb88ab4b67e4 >>> and >>> https://github.com/aford173/linux/commit/3f90057eb608f96d106029ef639813475241936f >>> >>> I've been traveling a lot lately, so I haven't had time to evaluate >>> his series, but I hope to get something like those re-based once the >>> DSI stuff has been accepted. >> >> I have these two attempts, both rejected: >> >> https://patchwork.freedesktop.org/patch/475207/ >> https://patchwork.freedesktop.org/patch/496049/ > > I have some patches re-based to Jagan's latest branch. It doesn't > impact any drivers other than the new samsung-dsim driver, and it > doesn't touch any of the drm helper functions either. It adjusts hs > clock based on the connected device. I am not sure what the impact > will have on the attached Exynos devices, so I am expecting some > iterations. Right now it's working with my DSI83 chip, but I need to > get it working with my adv7535 part as well. On the older branch, I > was able to sync the ad7535 with a variety of resolutions using > different pixel clock rates. > > Once I get it working again with my adv7535 and cleaned up, I'll > submit the patches to the drm group, and I'll CC you, Jagan and Marek > Szyprowski with a reference to Jagan's series so people wanting to try > it can apply it to his branch. The negotiation has to happen between the host and the bridge/panel, otherwise you won't be able to support bridge/panel devices which require specific clock rate on the DSI. Only the bridge/panel driver knows about such requirement.
Hi Marek, Am Sonntag, 18. Dezember 2022, 00:55:57 CET schrieb Marek Vasut: > On 12/16/22 14:25, Alexander Stein wrote: > Hi, > > [...] > > > Oh, nice, thanks for the pointer. When setting > > > >> samsung,burst-clock-frequency = <668250000>; > > > > in imx8mm.dtsi > > I get a non-flickering display using 4 lanes. Although admittedly this is > > just random guessing. I'm not sure which clock exactly has to be in the > > range CHA_DSI_CLK_RANGE is configured to. With 4 lanes SN65DSI84 is > > configured for> > > 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: > >> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) > >> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, > >> esc_clk > > > > = 16706250 > > If I recall it right, minimum PLL frequency is: > > fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz > > the link frequency is then > > fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) Mh, there is something bogus about this. Right now the PLL freq is set depending on 'samsung,burst-clock-frequency' property. But this actually is somehow depending on the number of lanes I configure. From the debug output hs_clk and PLL freq are identical. AFAICS there is also no divider from PLL to hs_clk in the register map. > So DSI83 should be in the range of 80..85 MHz input clock if I calculate > this right. Can you check what is the value of mode->clock, the > mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 > sm65dsi83_get_dsi_range() ? A working setup on a tianma,tm070jvhg33 display (1280x800) is: > samsung-dsim 32e10000.dsi: PLL freq 891000000, (p 3, m 99, s 0) > samsung-dsim 32e10000.dsi: hs_clk = 891000000, byte_clk = 111375000, esc_clk = 18562500 > sn65dsi83 2-002d: mode->clock: 68200 > sn65dsi83 2-002d: mode bpp: 24 > sn65dsi83 2-002d: ctx->dsi->lanes: 3 > sn65dsi83 2-002d: samsung_dsim_set_pll: 0x37 Calculating backwards, sn64dsi83 is expecting a clock in the range of 275-280 MHz. But I fail to see a corresponding clock in the DSIM PLL configuration. Best regards, Alexander > > AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just from > > DT > > properties, while SN65DSI84 is using display mode and number of lanes. > > > > Is it expected that the DSIM PLL frequencies are set in DT for a specific > > bridge/display setup? > > No, there should be negotiation between the host and bridge/panel, I > tried to propose two variants, but they were all rejected.
Hi, Am Sonntag, 18. Dezember 2022, 23:28:20 CET schrieb Marek Vasut: > On 12/18/22 23:24, Adam Ford wrote: > > On Sat, Dec 17, 2022 at 10:33 PM Marek Vasut <marex@denx.de> wrote: > >> On 12/18/22 05:23, Adam Ford wrote: > >>> On Sat, Dec 17, 2022 at 5:56 PM Marek Vasut <marex@denx.de> wrote: > >>>> On 12/16/22 14:25, Alexander Stein wrote: > >>>> Hi, > >>>> > >>>> [...] > >>>> > >>>>> Oh, nice, thanks for the pointer. When setting > >>>>> > >>>>>> samsung,burst-clock-frequency = <668250000>; > >>>>> > >>>>> in imx8mm.dtsi > >>>>> I get a non-flickering display using 4 lanes. Although admittedly this > >>>>> is just random guessing. I'm not sure which clock exactly has to be > >>>>> in the range CHA_DSI_CLK_RANGE is configured to. With 4 lanes > >>>>> SN65DSI84 is configured for>>>>> > >>>>> 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: > >>>>>> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) > >>>>>> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, > >>>>>> esc_clk > >>>>> > >>>>> = 16706250 > >>>> > >>>> If I recall it right, minimum PLL frequency is: > >>>> > >>>> fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz > >>>> > >>>> the link frequency is then > >>>> > >>>> fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) > >>>> > >>>> So DSI83 should be in the range of 80..85 MHz input clock if I > >>>> calculate > >>>> this right. Can you check what is the value of mode->clock, the > >>>> mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 > >>>> sm65dsi83_get_dsi_range() ? > >>>> > >>>>> AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just > >>>>> from DT > >>>>> properties, while SN65DSI84 is using display mode and number of lanes. > >>>>> > >>>>> Is it expected that the DSIM PLL frequencies are set in DT for a > >>>>> specific > >>>>> bridge/display setup? > >>>> > >>>> No, there should be negotiation between the host and bridge/panel, I > >>>> tried to propose two variants, but they were all rejected. > >>> > >>> For one of Jagan's previous revisions, I added some code to let the > >>> PHY auto adjust the frequencies instead of being fixed. NXP had this > >>> in their downstream kernel, but with this patch and another, I was > >>> able to set a variety of pixel clocks from my HDMI monitor and my > >>> DSI83. I haven't had time to re-base my work on Jagan's latest work, > >>> but you can link to the patch I did for the older stuff here: > >>> > >>> https://github.com/aford173/linux/commit/e845274b0f22ba3b24813ffd6bb3cb8 > >>> 8ab4b67e4 and > >>> https://github.com/aford173/linux/commit/3f90057eb608f96d106029ef6398134 > >>> 75241936f > >>> > >>> I've been traveling a lot lately, so I haven't had time to evaluate > >>> his series, but I hope to get something like those re-based once the > >>> DSI stuff has been accepted. > >> > >> I have these two attempts, both rejected: > >> > >> https://patchwork.freedesktop.org/patch/475207/ > >> https://patchwork.freedesktop.org/patch/496049/ > > > > I have some patches re-based to Jagan's latest branch. It doesn't > > impact any drivers other than the new samsung-dsim driver, and it > > doesn't touch any of the drm helper functions either. It adjusts hs > > clock based on the connected device. I am not sure what the impact > > will have on the attached Exynos devices, so I am expecting some > > iterations. Right now it's working with my DSI83 chip, but I need to > > get it working with my adv7535 part as well. On the older branch, I > > was able to sync the ad7535 with a variety of resolutions using > > different pixel clock rates. > > > > Once I get it working again with my adv7535 and cleaned up, I'll > > submit the patches to the drm group, and I'll CC you, Jagan and Marek > > Szyprowski with a reference to Jagan's series so people wanting to try > > it can apply it to his branch. > > The negotiation has to happen between the host and the bridge/panel, > otherwise you won't be able to support bridge/panel devices which > require specific clock rate on the DSI. Only the bridge/panel driver > knows about such requirement. AFAICS using Adam's patch the dynamic DPHY config is done in atomic_pre_enable callback. So at this point the negotiation has to be finished already. Wouldn't it be possible to setup 'dsi->format' within a atomic_check for samsung_dsim? But I don't know how you would get the expected clock frequency from the downward bridge. Best regards, Alexander
On 1/3/23 10:51, Alexander Stein wrote: > Hi Marek, > > Am Sonntag, 18. Dezember 2022, 00:55:57 CET schrieb Marek Vasut: >> On 12/16/22 14:25, Alexander Stein wrote: >> Hi, >> >> [...] >> >>> Oh, nice, thanks for the pointer. When setting >>> >>>> samsung,burst-clock-frequency = <668250000>; >>> >>> in imx8mm.dtsi >>> I get a non-flickering display using 4 lanes. Although admittedly this is >>> just random guessing. I'm not sure which clock exactly has to be in the >>> range CHA_DSI_CLK_RANGE is configured to. With 4 lanes SN65DSI84 is >>> configured for> >>> 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: >>>> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) >>>> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, >>>> esc_clk >>> >>> = 16706250 >> >> If I recall it right, minimum PLL frequency is: >> >> fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz >> >> the link frequency is then >> >> fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) > > Mh, there is something bogus about this. Right now the PLL freq is set > depending on 'samsung,burst-clock-frequency' property. But this actually is > somehow depending on the number of lanes I configure. From the debug output > hs_clk and PLL freq are identical. AFAICS there is also no divider from PLL to > hs_clk in the register map. Could it be that samsung,burst-clock-frequency is fPMS / 2 ? >> So DSI83 should be in the range of 80..85 MHz input clock if I calculate >> this right. Can you check what is the value of mode->clock, the >> mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 >> sm65dsi83_get_dsi_range() ? > > A working setup on a tianma,tm070jvhg33 display (1280x800) is: >> samsung-dsim 32e10000.dsi: PLL freq 891000000, (p 3, m 99, s 0) >> samsung-dsim 32e10000.dsi: hs_clk = 891000000, byte_clk = 111375000, esc_clk > = 18562500 >> sn65dsi83 2-002d: mode->clock: 68200 >> sn65dsi83 2-002d: mode bpp: 24 >> sn65dsi83 2-002d: ctx->dsi->lanes: 3 >> sn65dsi83 2-002d: samsung_dsim_set_pll: 0x37 > > Calculating backwards, sn64dsi83 is expecting a clock in the range of 275-280 > MHz. But I fail to see a corresponding clock in the DSIM PLL configuration. 294.9 MHz, no ? 1280x800x24x60x1.2 / 3 / 2 = 294.9 .
On 1/3/23 11:59, Alexander Stein wrote: > Hi, > > Am Sonntag, 18. Dezember 2022, 23:28:20 CET schrieb Marek Vasut: >> On 12/18/22 23:24, Adam Ford wrote: >>> On Sat, Dec 17, 2022 at 10:33 PM Marek Vasut <marex@denx.de> wrote: >>>> On 12/18/22 05:23, Adam Ford wrote: >>>>> On Sat, Dec 17, 2022 at 5:56 PM Marek Vasut <marex@denx.de> wrote: >>>>>> On 12/16/22 14:25, Alexander Stein wrote: >>>>>> Hi, >>>>>> >>>>>> [...] >>>>>> >>>>>>> Oh, nice, thanks for the pointer. When setting >>>>>>> >>>>>>>> samsung,burst-clock-frequency = <668250000>; >>>>>>> >>>>>>> in imx8mm.dtsi >>>>>>> I get a non-flickering display using 4 lanes. Although admittedly this >>>>>>> is just random guessing. I'm not sure which clock exactly has to be >>>>>>> in the range CHA_DSI_CLK_RANGE is configured to. With 4 lanes >>>>>>> SN65DSI84 is configured for>>>>> >>>>>>> 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: >>>>>>>> samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) >>>>>>>> samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, >>>>>>>> esc_clk >>>>>>> >>>>>>> = 16706250 >>>>>> >>>>>> If I recall it right, minimum PLL frequency is: >>>>>> >>>>>> fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz >>>>>> >>>>>> the link frequency is then >>>>>> >>>>>> fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) >>>>>> >>>>>> So DSI83 should be in the range of 80..85 MHz input clock if I >>>>>> calculate >>>>>> this right. Can you check what is the value of mode->clock, the >>>>>> mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 >>>>>> sm65dsi83_get_dsi_range() ? >>>>>> >>>>>>> AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just >>>>>>> from DT >>>>>>> properties, while SN65DSI84 is using display mode and number of lanes. >>>>>>> >>>>>>> Is it expected that the DSIM PLL frequencies are set in DT for a >>>>>>> specific >>>>>>> bridge/display setup? >>>>>> >>>>>> No, there should be negotiation between the host and bridge/panel, I >>>>>> tried to propose two variants, but they were all rejected. >>>>> >>>>> For one of Jagan's previous revisions, I added some code to let the >>>>> PHY auto adjust the frequencies instead of being fixed. NXP had this >>>>> in their downstream kernel, but with this patch and another, I was >>>>> able to set a variety of pixel clocks from my HDMI monitor and my >>>>> DSI83. I haven't had time to re-base my work on Jagan's latest work, >>>>> but you can link to the patch I did for the older stuff here: >>>>> >>>>> https://github.com/aford173/linux/commit/e845274b0f22ba3b24813ffd6bb3cb8 >>>>> 8ab4b67e4 and >>>>> https://github.com/aford173/linux/commit/3f90057eb608f96d106029ef6398134 >>>>> 75241936f >>>>> >>>>> I've been traveling a lot lately, so I haven't had time to evaluate >>>>> his series, but I hope to get something like those re-based once the >>>>> DSI stuff has been accepted. >>>> >>>> I have these two attempts, both rejected: >>>> >>>> https://patchwork.freedesktop.org/patch/475207/ >>>> https://patchwork.freedesktop.org/patch/496049/ >>> >>> I have some patches re-based to Jagan's latest branch. It doesn't >>> impact any drivers other than the new samsung-dsim driver, and it >>> doesn't touch any of the drm helper functions either. It adjusts hs >>> clock based on the connected device. I am not sure what the impact >>> will have on the attached Exynos devices, so I am expecting some >>> iterations. Right now it's working with my DSI83 chip, but I need to >>> get it working with my adv7535 part as well. On the older branch, I >>> was able to sync the ad7535 with a variety of resolutions using >>> different pixel clock rates. >>> >>> Once I get it working again with my adv7535 and cleaned up, I'll >>> submit the patches to the drm group, and I'll CC you, Jagan and Marek >>> Szyprowski with a reference to Jagan's series so people wanting to try >>> it can apply it to his branch. >> >> The negotiation has to happen between the host and the bridge/panel, >> otherwise you won't be able to support bridge/panel devices which >> require specific clock rate on the DSI. Only the bridge/panel driver >> knows about such requirement. > > AFAICS using Adam's patch the dynamic DPHY config is done in atomic_pre_enable > callback. So at this point the negotiation has to be finished already. > Wouldn't it be possible to setup 'dsi->format' within a atomic_check for > samsung_dsim? But I don't know how you would get the expected clock frequency > from the downward bridge. Maybe Maxime can comment on this ?
On Wed, Jan 04, 2023 at 04:08:47PM +0100, Marek Vasut wrote: > On 1/3/23 11:59, Alexander Stein wrote: > > Hi, > > > > Am Sonntag, 18. Dezember 2022, 23:28:20 CET schrieb Marek Vasut: > > > On 12/18/22 23:24, Adam Ford wrote: > > > > On Sat, Dec 17, 2022 at 10:33 PM Marek Vasut <marex@denx.de> wrote: > > > > > On 12/18/22 05:23, Adam Ford wrote: > > > > > > On Sat, Dec 17, 2022 at 5:56 PM Marek Vasut <marex@denx.de> wrote: > > > > > > > On 12/16/22 14:25, Alexander Stein wrote: > > > > > > > Hi, > > > > > > > > > > > > > > [...] > > > > > > > > > > > > > > > Oh, nice, thanks for the pointer. When setting > > > > > > > > > > > > > > > > > samsung,burst-clock-frequency = <668250000>; > > > > > > > > > > > > > > > > in imx8mm.dtsi > > > > > > > > I get a non-flickering display using 4 lanes. Although admittedly this > > > > > > > > is just random guessing. I'm not sure which clock exactly has to be > > > > > > > > in the range CHA_DSI_CLK_RANGE is configured to. With 4 lanes > > > > > > > > SN65DSI84 is configured for>>>>> > > > > > > > > 205-210 MHz (0x29), while I get these PLL PMS settings on DSIM: > > > > > > > > > samsung-dsim 32e10000.dsi: PLL freq 668250000, (p 4, m 99, s 0) > > > > > > > > > samsung-dsim 32e10000.dsi: hs_clk = 668250000, byte_clk = 83531250, > > > > > > > > > esc_clk > > > > > > > > > > > > > > > > = 16706250 > > > > > > > > > > > > > > If I recall it right, minimum PLL frequency is: > > > > > > > > > > > > > > fPMS=1.2*width*height*bpp*fps=1.2*800*480*24*60=663.5 MHz > > > > > > > > > > > > > > the link frequency is then > > > > > > > > > > > > > > fHS=fPMS/lanes/2=82.9 MHz (on the DDR clock lane) > > > > > > > > > > > > > > So DSI83 should be in the range of 80..85 MHz input clock if I > > > > > > > calculate > > > > > > > this right. Can you check what is the value of mode->clock, the > > > > > > > mipi_dsi_panel_format_to_bpp() return value, ctx->dsi->lanes in dsi83 > > > > > > > sm65dsi83_get_dsi_range() ? > > > > > > > > > > > > > > > AFAICS DSIM bridge is configurung hs_clk, byte_clk and esc_clk just > > > > > > > > from DT > > > > > > > > properties, while SN65DSI84 is using display mode and number of lanes. > > > > > > > > > > > > > > > > Is it expected that the DSIM PLL frequencies are set in DT for a > > > > > > > > specific > > > > > > > > bridge/display setup? > > > > > > > > > > > > > > No, there should be negotiation between the host and bridge/panel, I > > > > > > > tried to propose two variants, but they were all rejected. > > > > > > > > > > > > For one of Jagan's previous revisions, I added some code to let the > > > > > > PHY auto adjust the frequencies instead of being fixed. NXP had this > > > > > > in their downstream kernel, but with this patch and another, I was > > > > > > able to set a variety of pixel clocks from my HDMI monitor and my > > > > > > DSI83. I haven't had time to re-base my work on Jagan's latest work, > > > > > > but you can link to the patch I did for the older stuff here: > > > > > > > > > > > > https://github.com/aford173/linux/commit/e845274b0f22ba3b24813ffd6bb3cb8 > > > > > > 8ab4b67e4 and > > > > > > https://github.com/aford173/linux/commit/3f90057eb608f96d106029ef6398134 > > > > > > 75241936f > > > > > > > > > > > > I've been traveling a lot lately, so I haven't had time to evaluate > > > > > > his series, but I hope to get something like those re-based once the > > > > > > DSI stuff has been accepted. > > > > > > > > > > I have these two attempts, both rejected: > > > > > > > > > > https://patchwork.freedesktop.org/patch/475207/ > > > > > https://patchwork.freedesktop.org/patch/496049/ > > > > > > > > I have some patches re-based to Jagan's latest branch. It doesn't > > > > impact any drivers other than the new samsung-dsim driver, and it > > > > doesn't touch any of the drm helper functions either. It adjusts hs > > > > clock based on the connected device. I am not sure what the impact > > > > will have on the attached Exynos devices, so I am expecting some > > > > iterations. Right now it's working with my DSI83 chip, but I need to > > > > get it working with my adv7535 part as well. On the older branch, I > > > > was able to sync the ad7535 with a variety of resolutions using > > > > different pixel clock rates. > > > > > > > > Once I get it working again with my adv7535 and cleaned up, I'll > > > > submit the patches to the drm group, and I'll CC you, Jagan and Marek > > > > Szyprowski with a reference to Jagan's series so people wanting to try > > > > it can apply it to his branch. > > > > > > The negotiation has to happen between the host and the bridge/panel, > > > otherwise you won't be able to support bridge/panel devices which > > > require specific clock rate on the DSI. Only the bridge/panel driver > > > knows about such requirement. > > > > AFAICS using Adam's patch the dynamic DPHY config is done in atomic_pre_enable > > callback. So at this point the negotiation has to be finished already. > > Wouldn't it be possible to setup 'dsi->format' within a atomic_check for > > samsung_dsim? But I don't know how you would get the expected clock frequency > > from the downward bridge. I have zero context there, so I'm not sure what proposals have been made already, but why isn't it possible to do it the other way around and make the bridge ask the upstream driver if it can provide the clock frequency the bridge require? It's pretty much how the common clock framework works too: you set the rate on the leaf clock, and it propagates upwards in your tree, adjusting for any constraint we have along the way. It does need to happen at atomic_check time though, otherwise it would be terrible for anyone attempting to use that driver. Maxime