Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp607945rwb; Thu, 18 Aug 2022 09:05:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR5xeYUebbEzn06nKWmBB+By2vjYIrUDUEhN0CYoK23YguKoGDweJLS6piLQkJFM2dOg5cYy X-Received: by 2002:a17:903:32d2:b0:172:66e4:ba68 with SMTP id i18-20020a17090332d200b0017266e4ba68mr3544824plr.116.1660838711687; Thu, 18 Aug 2022 09:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660838711; cv=none; d=google.com; s=arc-20160816; b=GOZKJCHPIusQDwlW77q4IwWw5akmsfsfnM2tWBOUkpWW4rPGrBgTrLRCIruQHIZ9qp D0IXlvgBLBz618kWVX98w2xaYkW6pq6uwOdXef4eONZDZIOFCi7f4DwpE5W3mLmOfHrD iAew7l6f+edz2Kx3TqTeHY5QtVdIMpcLEE3Pfp8M//hplUVcOkitbjlfBHazyD9WeMH8 jQWNZsEDCJfzUGVwdF+ojCJ2XJVzfjxB21fa5yT2THwFKKRycEa0dvbpprGmY8GV+rdP f6pIGILCho4H9AaGu83IVhxhTlNj+vdztf2y50q40dxELhOhelWyu0gWkaONMAfBsGKn 65Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=b+/4XKYZvCQW1iIK8ho6QWAG+uMl9W6+CRBA3Lg1ULk=; b=RaIz0Hv6fwKkFCnk5kCHoag3yvXy5FTbGqYk6OMA1Q7qdAuZI0XrQYsBc/w8NVuU57 Yd2aljW+8y+ry0u2KDo+usZqxKsu/IUZou6ea5eBRL3j8msPOV/zVLCtyvudyQFOg0Qa ouZPMqfBYqUV8dvk5GZkXgCbOEVgkF+qqxC3UKCMeCXUPRFWn8FFW7v3VAfWo8PLGOov fqt4e4wftPErilBZDtToCbPdMssuSb0ovkCx7lLqrg/ZuOdHEAiH/z2TKBwGjKQl/jqN svXfKZZYfFypabvuaA+2K3ZfJc4OIwZ5aMyNnNKptyYvDKsjiCmFd/5ZH6LT2eYDikBH AQVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=GPte4KZl; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=jy1wv7Cj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 135-20020a63028d000000b0041c4ca899fcsi1628167pgc.775.2022.08.18.09.04.42; Thu, 18 Aug 2022 09:05:11 -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; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=GPte4KZl; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=jy1wv7Cj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244985AbiHRPqu (ORCPT + 99 others); Thu, 18 Aug 2022 11:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240240AbiHRPqt (ORCPT ); Thu, 18 Aug 2022 11:46:49 -0400 Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE0E8BA177 for ; Thu, 18 Aug 2022 08:46:47 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 43BD22B05E43; Thu, 18 Aug 2022 11:46:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 18 Aug 2022 11:46:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1660837604; x=1660844804; bh=b+/4XKYZvC QW1iIK8ho6QWAG+uMl9W6+CRBA3Lg1ULk=; b=GPte4KZl6gvUcVzP4rOaqokssj N62gm4Y81chhoe1qqWXYqlQPuEp24xTqIfFHeEnT9LYtqHD0prLS0j+JUy4tqT9Q ghDmFlMgpNK10YYofgLnuqKxveTifY30oWdevHy61vDNatV4739RJffrqbzviitH IjlRTXD9Ezk7jPYizMdBAO4kvC8KeNjte1W88Ib3mCDp3VvJtAwYJlWWoZs04lDK FmV92lzTBbER7qejG2BiODlxwNiUHoUCl5WJNMtCTpvtRMLswCgejS/W9HfPIm68 Zmz4+erOHT0fG69niqxqi+o2PQK4p/6txhwqtqo8ylL2Ons+jThAp79ocuuw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660837604; x=1660844804; bh=b+/4XKYZvCQW1iIK8ho6QWAG+uMl 9W6+CRBA3Lg1ULk=; b=jy1wv7CjN8hvToyslWcw4PYz/wak4/e3Jcl7hzgs34wn HBp+2wBNpeQeNaBg74HdLfJ3MkaMM1w1ejwv16Ljau6swbXywFaSx8KCxNGTrz6z 8tAvqFWIirGcQgN0kxfReORpacj0rTmB8N5ny4e3bPBz5uokLPczb1EyrQONtYHX gg/3ntVdEWM++5S5eG8DuNwBczlv471cI0lrnb8o3FvwT3PSw9Cd9Dn++UeSatcM dnXl9bvgl0YCB2ledBn2csbFisqZxFjWrnXngKw4nicwRUJimQkWp/vSQfDdbLYZ lYgaJo5ukPNOlvhyo89k1ErTLh3v+cUuXLFx89F1MQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehledgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpedvfeevudfgvefhtdefjedtfeelheeigfeghfeijedvgfegffevkefggfff ueejtdenucffohhmrghinhephhhinhhnvghrrdhinhhfohenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgv tghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Aug 2022 11:46:43 -0400 (EDT) Date: Thu, 18 Aug 2022 17:46:41 +0200 From: Maxime Ripard To: Geert Uytterhoeven Cc: Jernej Skrabec , Martin Blumenstingl , Chen-Yu Tsai , Philipp Zabel , Jerome Brunet , Samuel Holland , Thomas Zimmermann , Daniel Vetter , Emma Anholt , David Airlie , Maarten Lankhorst , Noralf =?utf-8?Q?Tr=C3=B8nnes?= , Kevin Hilman , Neil Armstrong , linux-sunxi@lists.linux.dev, Linux Kernel Mailing List , Phil Elwell , Mateusz Kwiatkowski , Linux ARM , Dave Stevenson , "open list:ARM/Amlogic Meson..." , DRI Development , Dom Cobley Subject: Re: [PATCH v1 04/35] drm/modes: Introduce 480i and 576i modes Message-ID: <20220818154641.ouvrar5s74qu74zn@houat> References: <20220816132636.3tmwqmrox64pu3lt@houat> <20220817075351.4xpsqdngjgtiqvob@houat> <20220817131454.qcuywcuc4ts4hswm@houat> <20220818123934.eim2bfrgbxsmviqx@houat> <20220818134200.cr22bftmjn226ehn@houat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="asnvi4arox2gwpwk" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 --asnvi4arox2gwpwk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 18, 2022 at 05:34:30PM +0200, Geert Uytterhoeven wrote: > On Thu, Aug 18, 2022 at 3:42 PM Maxime Ripard wrote: > > On Thu, Aug 18, 2022 at 02:57:55PM +0200, Geert Uytterhoeven wrote: > > > On Thu, Aug 18, 2022 at 2:39 PM Maxime Ripard wro= te: > > > > On Wed, Aug 17, 2022 at 04:01:48PM +0200, Geert Uytterhoeven wrote: > > > > > > I've looked around and it looks like the entire blanking area is > > > > > > supposed to be 40 pixels in interlaced, but I couldn't find any= where how > > > > > > > > > > 625 lines - 575[*] visible lines =3D 50 lines. > > > > > > > > > > [*] BT.656 uses 576 visible lines as that's a multiple of 2, for = splitting > > > > > a frame in two fields of equal size. > > > > > > > > > > "visible" is relative, as it includes the overscan region. > > > > > Some PAL monitors used with computers had knobs to control width/= height > > > > > and position of the screen, so you could make use of most or all = of > > > > > the overscan region > > > > > > > > It brings back some memories :) > > > > > > > > > but on a real TV you're limited to ca. 640x512 (on PAL) which is = what > > > > > an Amiga used by default (with a 14 MHz pixclock). > > > > > > > > > > it's supposed to be split between the upper and lower margins a= nd the > > > > > > sync period. > > > > > > > > > > "Field Synchronization of PAL System" on > > > > > http://martin.hinner.info/vga/pal.html shows the split. > > > > > > > > Thanks, that's excellent as well. > > > > > > > > I'm mostly done with a function that creates a PAL mode, but I still > > > > have one question. > > > > > > > > If I understand well, the blanking period is made up (interlace) of= 16 > > > > pulses for the first field, 14 for the second, each pulse taking ha= lf a > > > > line. That amount to 30 pulses, so 15 lines. > > > > > > > > I first assumed that the pre-equalizing pulses would be the back po= rch, > > > > the long sync pulses the vsync, and the post-equalizing pulses the = front > > > > porch. But... we're still missing 35 lines to amount to 625 lines, = that > > > > seems to be counted in the field itself (305 lines =3D=3D (575 + 35= ) / 2) > > > > > > > > So I guess my assumption was wrong to begin with. > > > > > > The back porch is the number of lines between the last "visible" line > > > and the start of the synchronization pulse, i.e. "l" in the "Field > > > Synchronization of PAL System" drawing. > > > Virtual sync length is "m". > > > The front porch is the number of lines between the end of > > > the synchronization pulse, and the first "visible" line, i.e. > > > "j - l - m" (I think you used "n", thus missing lines 6-23 and 319-33= 5). > > > > Ah, yes, that makes sense > > > > > > You seem to have used a fixed vsync in amifb to 4 lines, and I don't > > > > > > Actually "m" is 2.5 lines in the first field, and 3 lines in the seco= nd field, > > > so "4" is not that much off of 2.5 + 3. > > > > Is it? If I'm reading that drawing well, l before the first field starts > > on the second half of line 623 and stops at the end of line 625, so 2.5 > > line, and on the second field starts at the beginning of line 311, and > > stops half-way through 313 so 2.5 line again. > > > > Then, for the first field, m starts at the beginning of line 1, stops > > half-way through line 3, so 2.5 line indeed, and then on the second > > field starts on the second half of 313 and stops at the end of line 315. > > So 2.5 again? > > > > Thus, both should be 5? >=20 > Possibly. Note that this for the official broadcast PAL. >=20 > I never looked at these signals with a scope, but I wouldn't be > surprised if some > device on't bother implementing the "half-line-sync", and synchronize > the start and stop of the vertical > sync signal with the start of a horizontal. Yeah... official PAL looks like a good enough target to me :) We'll always be able to tweak it if needed later on. > > > > understand how you come up with the upper and lower margins (or rat= her, > > > > how they are linked to what's described in that page) > > > > > > These margins probably came from the Amiga hardware reference manual, > > > for the default 640x512 (PAL) and 640x400 (NTSC) modes. > > > > Ok. > > > > I started adding more sanity checks to my code, and I just realised I > > don't seem to be able to reach 720 pixels over a single line though. If > > I understood it properly, and according to [1] the active part of a line > > is supposed to be 51.95us, and the blanking period taking 12.05us. [2] > > in the timing section has pretty much the same numbers, so it looks > > sane. > > > > At 13.5Mhz, a pixel is going to take roughly 74ns, and 51950 / 74 =3D 7= 02 > > pixels > > > > It seems we can go push it to 52350 ns, but that still gives us only 706 > > pixels. > > > > Similarly, if I just choose to ignore that limit and just take the > > active time I need, 720 * 74 =3D 53280ns > > > > That leaves us 10720ns for the blanking period, and that's not enough to > > fit even the minimum of the front porch, hsync and back porch (1.55 + > > 4.5 + 5.5 =3D 11.55us). > > > > Are those constraints merely recommendations, or am I missing something? >=20 > You are missing that the parts near the borders of the full image are > part of the overscan range, and may or may not be visible, depending > on your actual display. > The full 768x576 image size from BT.656 is not visible on a typical PAL d= isplay, > and is more of an "absolute maximum rating", guaranteed to cover more > than analog PAL. So the overscan range is not part of the active area, unlike what HDMI is doing for example? Is there some minimal timings available somewhere to fit those absolute maximum ratings? Maxime --asnvi4arox2gwpwk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYv5e4QAKCRDj7w1vZxhR xdoZAQCbqkPywoyDbtajYaiOHUV0j7a0MU8PppJpqkU6bEekJwD+LOGb9NiLuLPY A19L6AEdMVCgURJ3CwdOZElsdjus2gw= =rYCU -----END PGP SIGNATURE----- --asnvi4arox2gwpwk--