Message ID | 20240205-pinephone-pll-fixes-v2-5-96a46a2d8c9b@oltmanns.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-52895-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp956819dyb; Mon, 5 Feb 2024 07:41:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGUDzKNkTx9yl7BUYj/O4OowAIJPc4tDXfnitZHgA20AVFPHr6R3+2yI9bPGXgwKwei680 X-Received: by 2002:a17:906:ae93:b0:a36:3f34:9476 with SMTP id md19-20020a170906ae9300b00a363f349476mr6397084ejb.44.1707147696328; Mon, 05 Feb 2024 07:41:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707147696; cv=pass; d=google.com; s=arc-20160816; b=Heo3iQRwR7jKuWzIlUgZsZOcDDSwrlnYHXlFnafw8kwUnT/d7h3uR29AM97URFzHBn qL8lHQ26+96Lq0X3vKZgoQRgF6jCQaIEWRGCF0LHhTksCdrMeZhhSndX7XTVsWvUc0U8 w1to72wyupb3lEJ55avrg0mgejZUz133OUReOCU7Q9/1GKRIeoChuvw2i99dFQVYRNGj 7jWujDdJ26eBbF89wHpux9Dew0FFA0pUujOY/MZZM3RrNNKbUpC382wmcszwVlqM6xAL qRc0OwPzWMpLdWjyVhzvvyBswgxE/p1QcKXCgZoEzV94A1JvSEi24VERZZZU8dZfz+nf 9UVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=HMiu8mBySgExM6KnP08YCgNs308ubxzfSD1bMdoSvkY=; fh=eTeBk9xilDHWnK35YWeY92kzsDXPmhpegReCs5mJsVU=; b=Jbj/obP4KvbD+q1/gvgibeguXJcrle6aSz1gn33cM85kFZN0Z0iI6t+HgU2gEBX9Yj GRV+5+YV1R/Km7CkKr6/ZIJHZexXZYHsXY5uGwp3CJlv7M2MFVaTuryUb2ypsxhLBlop LqlsZxl3u83a/hpyPMHJlHgjDTj2CHn3nMuRhs0VbxiruU4+zS5FXwv/MCl2rv8Ip9ei e696T46WIBH+RxzorgrRVyHCobt5mxXUZlRMqo2q6Mw2FyR2IFGX4TPhuPR/XtU4ofhW XG/Pkg/vxEpWaVwJKMyblePr26FMcx5M9Q4quBHJ7TpjBgKpoKcrQywJYiUmgJ73/tjt xRlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oltmanns.dev header.s=MBO0001 header.b=w6kjYLuC; arc=pass (i=1 spf=pass spfdomain=oltmanns.dev dkim=pass dkdomain=oltmanns.dev dmarc=pass fromdomain=oltmanns.dev); spf=pass (google.com: domain of linux-kernel+bounces-52895-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52895-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oltmanns.dev X-Forwarded-Encrypted: i=1; AJvYcCXJqZSYESIzSWrZEiAaBuh706xGzse+DmKdtfqc5+kILVRFxnJ0W5+fJzihEdithdWnUsgUfY7TxgPjMNjfwRELynv8Lw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id kl12-20020a170907994c00b00a37015eae5bsi3839223ejc.903.2024.02.05.07.41.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 07:41:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52895-ouuuleilei=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=@oltmanns.dev header.s=MBO0001 header.b=w6kjYLuC; arc=pass (i=1 spf=pass spfdomain=oltmanns.dev dkim=pass dkdomain=oltmanns.dev dmarc=pass fromdomain=oltmanns.dev); spf=pass (google.com: domain of linux-kernel+bounces-52895-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52895-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oltmanns.dev 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 40BD11F25D8A for <ouuuleilei@gmail.com>; Mon, 5 Feb 2024 15:24:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB0803FE42; Mon, 5 Feb 2024 15:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oltmanns.dev header.i=@oltmanns.dev header.b="w6kjYLuC" Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) (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 DA5473F8CA; Mon, 5 Feb 2024 15:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707146600; cv=none; b=ZBbRTEJ5O2etY6O+Vb/DKzmUYDd5SawtPCgizUQsuLEd0TTwFbPZh0AMgCIfoKfswhLsDjLcEaAK6Mmg/uKsFJr+Ad1QCDbpls8HgbEFG4AevgysFihI+rIPhPZmV7orWTT+ibIln6NTgM286dj53yw10SVJ2W7UW1CczSemFpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707146600; c=relaxed/simple; bh=LSFmengqkqFNIcTkqiKdRYtwv5rLf2wHfu4gB3QVAfo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lAwEviHVlc9FxtP83SZ9lbx+diYIrulYjoKp+zBxYxh92WfpE8dcU+LxxNwzuBKxvQj6Er8KhDE4polMZg5bstrmxMJG6En+3HHyjgtp3kcUfxPpBcqi9t5R+F/6SGy+rEXgz9INeupMv06duVzDwQFf5fHvScuxrzS+GCOz41Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oltmanns.dev; spf=pass smtp.mailfrom=oltmanns.dev; dkim=pass (2048-bit key) header.d=oltmanns.dev header.i=@oltmanns.dev header.b=w6kjYLuC; arc=none smtp.client-ip=80.241.56.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oltmanns.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oltmanns.dev Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4TT9BB6x4Vz9sSw; Mon, 5 Feb 2024 16:23:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oltmanns.dev; s=MBO0001; t=1707146595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HMiu8mBySgExM6KnP08YCgNs308ubxzfSD1bMdoSvkY=; b=w6kjYLuCRS3PYRkS6IqG9bJQWNXSkIeBNUQ0a/K9Q3EmD2SqZ9dyoKN1X+kvFkc+kcq0fE 3ZGSTlVdQ/emHV4ZSXkzYMw2jzA5Iw2bYOgs4f37ss5kISEkby6ruKD05m3dWKM9djXBFp KDVFgvoHsC+IjL7XKQ0qmMQSAh2B15bNpriFEe/YhwrORFqQBr1f73CSwMCWkAE7lao7Ke mOt0Wmkqh+lKRt8KZ+uKLgFRaLYnA+s4L9VoFjydLO3dj1SznAntvNjJ9+ERCruWlLlZW5 xqFmQEqzkRe5F1W4sTAdkVKOCN62t1issOg6UbWjwLLrqnD9jz8CGWJMyUhByQ== From: Frank Oltmanns <frank@oltmanns.dev> Date: Mon, 05 Feb 2024 16:22:28 +0100 Subject: [PATCH v2 5/6] drm/panel: st7703: Drive XBD599 panel at higher clock rate Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240205-pinephone-pll-fixes-v2-5-96a46a2d8c9b@oltmanns.dev> References: <20240205-pinephone-pll-fixes-v2-0-96a46a2d8c9b@oltmanns.dev> In-Reply-To: <20240205-pinephone-pll-fixes-v2-0-96a46a2d8c9b@oltmanns.dev> To: Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>, Purism Kernel Team <kernel@puri.sm>, Ondrej Jirman <megi@xff.cz>, Neil Armstrong <neil.armstrong@linaro.org>, Jessica Zhang <quic_jesszhan@quicinc.com>, Sam Ravnborg <sam@ravnborg.org>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Frank Oltmanns <frank@oltmanns.dev> X-Developer-Signature: v=1; a=openpgp-sha256; l=2123; i=frank@oltmanns.dev; h=from:subject:message-id; bh=LSFmengqkqFNIcTkqiKdRYtwv5rLf2wHfu4gB3QVAfo=; b=owEB7QES/pANAwAIAZppogiUStPHAcsmYgBlwP0/wUrDb0L4eaQ3AOCfpz1m+nA/BCEEvgN2u 7U9SQoHUPmJAbMEAAEIAB0WIQQC/SV7f5DmuaVET5aaaaIIlErTxwUCZcD9PwAKCRCaaaIIlErT x4kRC/4rCGnrv1sdHdQhxuE+E7Qs/Ixz80c+RlRevhWxSLuchp7r/ZRPGL8HBukk/gTMbsbHW9m B+eVzGS02ZXLAmI1dwPxqdojPbw7i1L2aBa9yfm0MGh1YBRlHA4PXiFJ51RT3Vbb3GZG4OMp528 o/z5QdRbg+0ArhHok8ahCtbtArSEkBIk3NmOmd+u7m2Ei21wXiN5/fPLILnLLutplZfYd3BqE59 4QkwFX7Iq2mjK/2rpnLEilhv76Bh5hwBrL46RchB/NgflkWArkO1TImCQWM+c8lOOhND1ws6wCH J5kgYo7XlEtqxOL18kcu7AkIbr1lg3etPq5xoSrefTZlJcmRK4jm7BKVJ6E5yIZUYJwOSl6dyra Zt+Cs/Ciow0CWZxUZmwdYgTYhO96y9Nf30Xu3ffDTS305T6Kf1PooAdFnOyLwDArpj3XtfM6cdZ ukgrNAsTLOicxp0C6hGAxj+yWW+ISTaRwNyREGjCvAAbafE/Dy+25QHlzPnSM++ROsQ7c= X-Developer-Key: i=frank@oltmanns.dev; a=openpgp; fpr=02FD257B7F90E6B9A5444F969A69A208944AD3C7 X-Rspamd-Queue-Id: 4TT9BB6x4Vz9sSw X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790074102937142521 X-GMAIL-MSGID: 1790074102937142521 |
Series |
Pinephone video out fixes (flipping between two frames)
|
|
Commit Message
Frank Oltmanns
Feb. 5, 2024, 3:22 p.m. UTC
This panel is used in the pinephone that runs on a Allwinner A64 SOC.
The SOC requires pll-mipi to run at more than 500 MHz.
This is the relevant clock tree:
pll-mipi
tcon0
tcon-data-clock
tcon-data-clock has to run at 1/4 the DSI per-lane bit rate. The XBD599
has 24 bpp and 4 lanes. Therefore, the resulting requested
tcon-data-clock rate is:
crtc_clock * 1000 * (24 / 4) / 4
tcon-data-clock runs at tcon0 / 4 (fixed divisor), so it requests a
parent rate of
4 * (crtc_clock * 1000 * (24 / 4) / 4)
Since tcon0 is a ccu_mux, the rate of tcon0 equals the rate of pll-mipi.
pll-mipi's constraint to run at 500MHz or higher forces us to have a
crtc_clock >= 83333 kHz if we want a 60 Hz vertical refresh rate.
Change [hv]sync_(start|end) so that we reach a clock rate of 83502 kHz
so that it is high enough to align with pll-pipi limits.
Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
---
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Comments
Dne ponedeljek, 05. februar 2024 ob 16:22:28 CET je Frank Oltmanns napisal(a): > This panel is used in the pinephone that runs on a Allwinner A64 SOC. > The SOC requires pll-mipi to run at more than 500 MHz. > > This is the relevant clock tree: > pll-mipi > tcon0 > tcon-data-clock > > tcon-data-clock has to run at 1/4 the DSI per-lane bit rate. The XBD599 > has 24 bpp and 4 lanes. Therefore, the resulting requested > tcon-data-clock rate is: > crtc_clock * 1000 * (24 / 4) / 4 > > tcon-data-clock runs at tcon0 / 4 (fixed divisor), so it requests a > parent rate of > 4 * (crtc_clock * 1000 * (24 / 4) / 4) > > Since tcon0 is a ccu_mux, the rate of tcon0 equals the rate of pll-mipi. > > pll-mipi's constraint to run at 500MHz or higher forces us to have a > crtc_clock >= 83333 kHz if we want a 60 Hz vertical refresh rate. > > Change [hv]sync_(start|end) so that we reach a clock rate of 83502 kHz > so that it is high enough to align with pll-pipi limits. Typo: pll-pipi -> pll-mipi Best regards, Jernej > > Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> > --- > drivers/gpu/drm/panel/panel-sitronix-st7703.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c > index b55bafd1a8be..6886fd7f765e 100644 > --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c > +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c > @@ -320,14 +320,14 @@ static int xbd599_init_sequence(struct st7703 *ctx) > > static const struct drm_display_mode xbd599_mode = { > .hdisplay = 720, > - .hsync_start = 720 + 40, > - .hsync_end = 720 + 40 + 40, > - .htotal = 720 + 40 + 40 + 40, > + .hsync_start = 720 + 65, > + .hsync_end = 720 + 65 + 65, > + .htotal = 720 + 65 + 65 + 65, > .vdisplay = 1440, > - .vsync_start = 1440 + 18, > - .vsync_end = 1440 + 18 + 10, > - .vtotal = 1440 + 18 + 10 + 17, > - .clock = 69000, > + .vsync_start = 1440 + 30, > + .vsync_end = 1440 + 30 + 22, > + .vtotal = 1440 + 30 + 22 + 29, > + .clock = (720 + 65 + 65 + 65) * (1440 + 30 + 22 + 29) * 60 / 1000, > .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, > .width_mm = 68, > .height_mm = 136, > >
Hi Frank, On Mon, Feb 05, 2024 at 04:22:28PM +0100, Frank Oltmanns wrote: > This panel is used in the pinephone that runs on a Allwinner A64 SOC. > The SOC requires pll-mipi to run at more than 500 MHz. > > This is the relevant clock tree: > pll-mipi > tcon0 > tcon-data-clock > > tcon-data-clock has to run at 1/4 the DSI per-lane bit rate. The XBD599 > has 24 bpp and 4 lanes. Therefore, the resulting requested > tcon-data-clock rate is: > crtc_clock * 1000 * (24 / 4) / 4 > > tcon-data-clock runs at tcon0 / 4 (fixed divisor), so it requests a > parent rate of > 4 * (crtc_clock * 1000 * (24 / 4) / 4) > > Since tcon0 is a ccu_mux, the rate of tcon0 equals the rate of pll-mipi. > > pll-mipi's constraint to run at 500MHz or higher forces us to have a > crtc_clock >= 83333 kHz if we want a 60 Hz vertical refresh rate. > > Change [hv]sync_(start|end) so that we reach a clock rate of 83502 kHz > so that it is high enough to align with pll-pipi limits. > > Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> That commit log is great, but it's kind of off-topic. It's a panel driver, it can be used on any MIPI-DSI controller, the only relevant information there should be the panel timings required in the datasheet. The PLL setup is something for the MIPI-DSI driver to adjust, not for the panel to care for. Maxime
On 2024-02-08 at 20:05:08 +0100, Maxime Ripard <mripard@kernel.org> wrote: > [[PGP Signed Part:Undecided]] > Hi Frank, > > On Mon, Feb 05, 2024 at 04:22:28PM +0100, Frank Oltmanns wrote: >> This panel is used in the pinephone that runs on a Allwinner A64 SOC. >> The SOC requires pll-mipi to run at more than 500 MHz. >> >> This is the relevant clock tree: >> pll-mipi >> tcon0 >> tcon-data-clock >> >> tcon-data-clock has to run at 1/4 the DSI per-lane bit rate. The XBD599 >> has 24 bpp and 4 lanes. Therefore, the resulting requested >> tcon-data-clock rate is: >> crtc_clock * 1000 * (24 / 4) / 4 >> >> tcon-data-clock runs at tcon0 / 4 (fixed divisor), so it requests a >> parent rate of >> 4 * (crtc_clock * 1000 * (24 / 4) / 4) >> >> Since tcon0 is a ccu_mux, the rate of tcon0 equals the rate of pll-mipi. >> >> pll-mipi's constraint to run at 500MHz or higher forces us to have a >> crtc_clock >= 83333 kHz if we want a 60 Hz vertical refresh rate. >> >> Change [hv]sync_(start|end) so that we reach a clock rate of 83502 kHz >> so that it is high enough to align with pll-pipi limits. >> >> Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> > > That commit log is great, but it's kind of off-topic. It's a panel > driver, it can be used on any MIPI-DSI controller, the only relevant > information there should be the panel timings required in the datasheet. > > The PLL setup is something for the MIPI-DSI driver to adjust, not for > the panel to care for. > I absolutely agree. It even was the reason for my submission of a sunxi-ng patch series last year that was accepted, to make pll-mipi more flexible. :) The only remaining option I currently see for adjusting the sunxi-ng driver to further accomodate the panel, is trying to use a higher divisor than 4 for calculating tcon-data-clock from tcon0. I remember reading a discussion about this, but as far as I remember that proposal was rejected (by you, IIRC). While I appreciate other suggestion as well, I'll look into options for using a different divisor than 4. Best regards, Frank > > Maxime > > [[End of PGP Signed Part]]
On 2024-02-11 at 16:42:43 +0100, Frank Oltmanns <frank@oltmanns.dev> wrote: > On 2024-02-08 at 20:05:08 +0100, Maxime Ripard <mripard@kernel.org> wrote: >> [[PGP Signed Part:Undecided]] >> Hi Frank, >> >> On Mon, Feb 05, 2024 at 04:22:28PM +0100, Frank Oltmanns wrote: >>> This panel is used in the pinephone that runs on a Allwinner A64 SOC. >>> The SOC requires pll-mipi to run at more than 500 MHz. >>> >>> This is the relevant clock tree: >>> pll-mipi >>> tcon0 >>> tcon-data-clock >>> >>> tcon-data-clock has to run at 1/4 the DSI per-lane bit rate. The XBD599 >>> has 24 bpp and 4 lanes. Therefore, the resulting requested >>> tcon-data-clock rate is: >>> crtc_clock * 1000 * (24 / 4) / 4 >>> >>> tcon-data-clock runs at tcon0 / 4 (fixed divisor), so it requests a >>> parent rate of >>> 4 * (crtc_clock * 1000 * (24 / 4) / 4) >>> >>> Since tcon0 is a ccu_mux, the rate of tcon0 equals the rate of pll-mipi. >>> >>> pll-mipi's constraint to run at 500MHz or higher forces us to have a >>> crtc_clock >= 83333 kHz if we want a 60 Hz vertical refresh rate. >>> >>> Change [hv]sync_(start|end) so that we reach a clock rate of 83502 kHz >>> so that it is high enough to align with pll-pipi limits. >>> >>> Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> >> >> That commit log is great, but it's kind of off-topic. It's a panel >> driver, it can be used on any MIPI-DSI controller, the only relevant >> information there should be the panel timings required in the datasheet. >> >> The PLL setup is something for the MIPI-DSI driver to adjust, not for >> the panel to care for. >> > > I absolutely agree. It even was the reason for my submission of a > sunxi-ng patch series last year that was accepted, to make pll-mipi more > flexible. :) > > The only remaining option I currently see for adjusting the sunxi-ng > driver to further accomodate the panel, is trying to use a higher > divisor than 4 for calculating tcon-data-clock from tcon0. I remember > reading a discussion about this, but as far as I remember that proposal > was rejected (by you, IIRC). > > While I appreciate other suggestion as well, I'll look into options for > using a different divisor than 4. I tried the following: --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -391,7 +391,7 @@ static void sun4i_tcon0_mode_set_cpu(struct sun4i_tcon *tcon, * dclk is required to run at 1/4 the DSI per-lane bit rate. */ tcon->dclk_min_div = SUN6I_DSI_TCON_DIV; - tcon->dclk_max_div = SUN6I_DSI_TCON_DIV; + tcon->dclk_max_div = 127; clk_set_rate(tcon->dclk, mode->crtc_clock * 1000 * (bpp / lanes) / SUN6I_DSI_TCON_DIV); On the pinephone, this selects a divisor of 6 resulting in a 25% frame drop. I.e., unless I'm missing something using a divisor other than 4 is not an option. This also matches your report from 2019: "Well, it's also breaking another panel." [1] I can currently see the following options: a. Drive PLL-MIPI outside spec and panel within spec (current situation, but missing a small patch [2] that fixes the crtc_clock and nothing else) and live with the fact that some pinephones will run unreliably. b. Drive PLL-MIPI and panel within spec and shove data into the panel at a too high rate (i.e., apply the rest of this series but not this specific patch). This seems to mostly work, but hasn't seen any long term testing. Short term testing showed that this approach results in a slight but noticable unsmooth scrolling behavior. c. Drive PLL-MIPI within spec and panel outside spec (i.e., apply a future version of the whole series). This has been tested for over a month on three devices that I know of. There are no reports of panels not working with the suggested parameters. All options require additional work on the GPU rate which is currently being discussed in a parallel thread of this series. Unless somebody comes up with a better idea, I will pause working on fixing PLL-MIPI and focus on the GPU instead. While I doubt it, maybe fixing the GPU is sufficient and continuing to drive PLL-MIPI outside spec proves to be ok. [1]: https://lore.kernel.org/all/20190828130341.s5z76wejulwdgxlc@flea/ [2]: https://lore.kernel.org/all/20230219114553.288057-2-frank@oltmanns.dev/ Best regards, Frank > > Best regards, > Frank > >> >> Maxime >> >> [[End of PGP Signed Part]]
On Sun, Feb 11, 2024 at 04:42:43PM +0100, Frank Oltmanns wrote: > > On 2024-02-08 at 20:05:08 +0100, Maxime Ripard <mripard@kernel.org> wrote: > > [[PGP Signed Part:Undecided]] > > Hi Frank, > > > > On Mon, Feb 05, 2024 at 04:22:28PM +0100, Frank Oltmanns wrote: > >> This panel is used in the pinephone that runs on a Allwinner A64 SOC. > >> The SOC requires pll-mipi to run at more than 500 MHz. > >> > >> This is the relevant clock tree: > >> pll-mipi > >> tcon0 > >> tcon-data-clock > >> > >> tcon-data-clock has to run at 1/4 the DSI per-lane bit rate. The XBD599 > >> has 24 bpp and 4 lanes. Therefore, the resulting requested > >> tcon-data-clock rate is: > >> crtc_clock * 1000 * (24 / 4) / 4 > >> > >> tcon-data-clock runs at tcon0 / 4 (fixed divisor), so it requests a > >> parent rate of > >> 4 * (crtc_clock * 1000 * (24 / 4) / 4) > >> > >> Since tcon0 is a ccu_mux, the rate of tcon0 equals the rate of pll-mipi. > >> > >> pll-mipi's constraint to run at 500MHz or higher forces us to have a > >> crtc_clock >= 83333 kHz if we want a 60 Hz vertical refresh rate. > >> > >> Change [hv]sync_(start|end) so that we reach a clock rate of 83502 kHz > >> so that it is high enough to align with pll-pipi limits. > >> > >> Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> > > > > That commit log is great, but it's kind of off-topic. It's a panel > > driver, it can be used on any MIPI-DSI controller, the only relevant > > information there should be the panel timings required in the datasheet. > > > > The PLL setup is something for the MIPI-DSI driver to adjust, not for > > the panel to care for. > > > > I absolutely agree. It even was the reason for my submission of a > sunxi-ng patch series last year that was accepted, to make pll-mipi more > flexible. :) > > The only remaining option I currently see for adjusting the sunxi-ng > driver to further accomodate the panel, is trying to use a higher > divisor than 4 for calculating tcon-data-clock from tcon0. I remember > reading a discussion about this, but as far as I remember that proposal > was rejected (by you, IIRC). > > While I appreciate other suggestion as well, I'll look into options for > using a different divisor than 4. Like I said, I'm not against the patch at all, it looks great to me on principle. I just think you should completely rephrase the commit log using the datasheet as the only reliable source of the display timings. Whether sun4i can work around the panel requirements is something completely orthogonal to the discussion, and thus the commit log. Maxime
Hi Maxime, On 2024-02-22 at 11:29:51 +0100, Maxime Ripard <mripard@kernel.org> wrote: > [[PGP Signed Part:Undecided]] > On Sun, Feb 11, 2024 at 04:42:43PM +0100, Frank Oltmanns wrote: >> >> On 2024-02-08 at 20:05:08 +0100, Maxime Ripard <mripard@kernel.org> wrote: >> > [[PGP Signed Part:Undecided]] >> > Hi Frank, >> > >> > On Mon, Feb 05, 2024 at 04:22:28PM +0100, Frank Oltmanns wrote: >> >> This panel is used in the pinephone that runs on a Allwinner A64 SOC. >> >> The SOC requires pll-mipi to run at more than 500 MHz. >> >> >> >> This is the relevant clock tree: >> >> pll-mipi >> >> tcon0 >> >> tcon-data-clock >> >> >> >> tcon-data-clock has to run at 1/4 the DSI per-lane bit rate. The XBD599 >> >> has 24 bpp and 4 lanes. Therefore, the resulting requested >> >> tcon-data-clock rate is: >> >> crtc_clock * 1000 * (24 / 4) / 4 >> >> >> >> tcon-data-clock runs at tcon0 / 4 (fixed divisor), so it requests a >> >> parent rate of >> >> 4 * (crtc_clock * 1000 * (24 / 4) / 4) >> >> >> >> Since tcon0 is a ccu_mux, the rate of tcon0 equals the rate of pll-mipi. >> >> >> >> pll-mipi's constraint to run at 500MHz or higher forces us to have a >> >> crtc_clock >= 83333 kHz if we want a 60 Hz vertical refresh rate. >> >> >> >> Change [hv]sync_(start|end) so that we reach a clock rate of 83502 kHz >> >> so that it is high enough to align with pll-pipi limits. >> >> >> >> Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> >> > >> > That commit log is great, but it's kind of off-topic. It's a panel >> > driver, it can be used on any MIPI-DSI controller, the only relevant >> > information there should be the panel timings required in the datasheet. >> > >> > The PLL setup is something for the MIPI-DSI driver to adjust, not for >> > the panel to care for. >> > >> >> I absolutely agree. It even was the reason for my submission of a >> sunxi-ng patch series last year that was accepted, to make pll-mipi more >> flexible. :) >> >> The only remaining option I currently see for adjusting the sunxi-ng >> driver to further accomodate the panel, is trying to use a higher >> divisor than 4 for calculating tcon-data-clock from tcon0. I remember >> reading a discussion about this, but as far as I remember that proposal >> was rejected (by you, IIRC). >> >> While I appreciate other suggestion as well, I'll look into options for >> using a different divisor than 4. > > Like I said, I'm not against the patch at all, it looks great to me on > principle. I just think you should completely rephrase the commit log > using the datasheet as the only reliable source of the display timings. > Whether sun4i can work around the panel requirements is something > completely orthogonal to the discussion, and thus the commit log. > I was trying to follow the guidelines [1] for describing the reason behind my changes to the panel. My original commit message was a lot shorter, which, understandably, resulted in follow up questions [2]. With the current commit log, I'm trying to address those questions. According to the device tree, the panel is only used in the pinephone. The only reason for the change is that the SoC used by the only user of this panel can not provide the rate the panel requests with the current values. I think this information is relevant. Unfortunately, as described in [2], I cannot back these values with any datasheets because I couldn't find any. I could only find hints that they are not publicly available. Icenowy (added to CC) submitted the original values. Best regards, Frank [1]: https://www.kernel.org/doc/html/v6.7/process/submitting-patches.html#describe-your-changes [2]: https://lore.kernel.org/lkml/87wmsvo0fh.fsf@oltmanns.dev/ > > Maxime > > [[End of PGP Signed Part]]
在 2024-02-25星期日的 17:46 +0100,Frank Oltmanns写道: > Hi Maxime, > > On 2024-02-22 at 11:29:51 +0100, Maxime Ripard <mripard@kernel.org> > wrote: > > [[PGP Signed Part:Undecided]] > > On Sun, Feb 11, 2024 at 04:42:43PM +0100, Frank Oltmanns wrote: > > > > > > On 2024-02-08 at 20:05:08 +0100, Maxime Ripard > > > <mripard@kernel.org> wrote: > > > > [[PGP Signed Part:Undecided]] > > > > Hi Frank, > > > > > > > > On Mon, Feb 05, 2024 at 04:22:28PM +0100, Frank Oltmanns wrote: > > > > > This panel is used in the pinephone that runs on a Allwinner > > > > > A64 SOC. > > > > > The SOC requires pll-mipi to run at more than 500 MHz. > > > > > > > > > > This is the relevant clock tree: > > > > > pll-mipi > > > > > tcon0 > > > > > tcon-data-clock > > > > > > > > > > tcon-data-clock has to run at 1/4 the DSI per-lane bit rate. > > > > > The XBD599 > > > > > has 24 bpp and 4 lanes. Therefore, the resulting requested > > > > > tcon-data-clock rate is: > > > > > crtc_clock * 1000 * (24 / 4) / 4 > > > > > > > > > > tcon-data-clock runs at tcon0 / 4 (fixed divisor), so it > > > > > requests a > > > > > parent rate of > > > > > 4 * (crtc_clock * 1000 * (24 / 4) / 4) > > > > > > > > > > Since tcon0 is a ccu_mux, the rate of tcon0 equals the rate > > > > > of pll-mipi. > > > > > > > > > > pll-mipi's constraint to run at 500MHz or higher forces us to > > > > > have a > > > > > crtc_clock >= 83333 kHz if we want a 60 Hz vertical refresh > > > > > rate. > > > > > > > > > > Change [hv]sync_(start|end) so that we reach a clock rate of > > > > > 83502 kHz > > > > > so that it is high enough to align with pll-pipi limits. > > > > > > > > > > Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> > > > > > > > > That commit log is great, but it's kind of off-topic. It's a > > > > panel > > > > driver, it can be used on any MIPI-DSI controller, the only > > > > relevant > > > > information there should be the panel timings required in the > > > > datasheet. > > > > > > > > The PLL setup is something for the MIPI-DSI driver to adjust, > > > > not for > > > > the panel to care for. > > > > > > > > > > I absolutely agree. It even was the reason for my submission of a > > > sunxi-ng patch series last year that was accepted, to make pll- > > > mipi more > > > flexible. :) > > > > > > The only remaining option I currently see for adjusting the > > > sunxi-ng > > > driver to further accomodate the panel, is trying to use a higher > > > divisor than 4 for calculating tcon-data-clock from tcon0. I > > > remember > > > reading a discussion about this, but as far as I remember that > > > proposal > > > was rejected (by you, IIRC). > > > > > > While I appreciate other suggestion as well, I'll look into > > > options for > > > using a different divisor than 4. > > > > Like I said, I'm not against the patch at all, it looks great to me > > on > > principle. I just think you should completely rephrase the commit > > log > > using the datasheet as the only reliable source of the display > > timings. > > Whether sun4i can work around the panel requirements is something > > completely orthogonal to the discussion, and thus the commit log. > > > > I was trying to follow the guidelines [1] for describing the reason > behind my changes to the panel. My original commit message was a lot > shorter, which, understandably, resulted in follow up questions [2]. > With the current commit log, I'm trying to address those questions. > According to the device tree, the panel is only used in the > pinephone. > The only reason for the change is that the SoC used by the only user > of > this panel can not provide the rate the panel requests with the > current > values. I think this information is relevant. > > Unfortunately, as described in [2], I cannot back these values with > any > datasheets because I couldn't find any. I could only find hints that > they are not publicly available. Icenowy (added to CC) submitted the > original values. Sorry but this kind of things are just magic from the vendor that I could hardly explain... > > Best regards, > Frank > > [1]: > https://www.kernel.org/doc/html/v6.7/process/submitting-patches.html#describe-your-changes > [2]: https://lore.kernel.org/lkml/87wmsvo0fh.fsf@oltmanns.dev/ > > > > > Maxime > > > > [[End of PGP Signed Part]] >
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c index b55bafd1a8be..6886fd7f765e 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c @@ -320,14 +320,14 @@ static int xbd599_init_sequence(struct st7703 *ctx) static const struct drm_display_mode xbd599_mode = { .hdisplay = 720, - .hsync_start = 720 + 40, - .hsync_end = 720 + 40 + 40, - .htotal = 720 + 40 + 40 + 40, + .hsync_start = 720 + 65, + .hsync_end = 720 + 65 + 65, + .htotal = 720 + 65 + 65 + 65, .vdisplay = 1440, - .vsync_start = 1440 + 18, - .vsync_end = 1440 + 18 + 10, - .vtotal = 1440 + 18 + 10 + 17, - .clock = 69000, + .vsync_start = 1440 + 30, + .vsync_end = 1440 + 30 + 22, + .vtotal = 1440 + 30 + 22 + 29, + .clock = (720 + 65 + 65 + 65) * (1440 + 30 + 22 + 29) * 60 / 1000, .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, .width_mm = 68, .height_mm = 136,