Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5611074rwi; Tue, 18 Oct 2022 01:20:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM780nW/JpYotSolk4uzbO3e0c378p60WjZSGoiieHxp6alh7vy5bEdbSXrZGEC7vhh/dhlz X-Received: by 2002:a17:907:2c4b:b0:78d:8621:c113 with SMTP id hf11-20020a1709072c4b00b0078d8621c113mr1349200ejc.364.1666081209579; Tue, 18 Oct 2022 01:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666081209; cv=none; d=google.com; s=arc-20160816; b=OOMdYDK/ZH3vwHz0ca97eOhgrKEHiimyObQ62gZRVG67I1/AXoAISXEOyH3pVsSK5W sb0GzKFjEhB7jIIrZQ9KekZh8Z+7yeqKr7zam7pdt7uB7qg7SoNq7THi7vq7Px8+QbA1 SwMStE3L286i3XxFUW0ioZfDVZjHn/yjD+yP+9D79/50mrmDHkV1l1d2jYpmfUVEhJKZ 4uj5Omeeub6rus+7E/GJTDOgYT15JaJZ16zdo405HLTA8Gp5hGFl6pJnn+d999QocQmC zcUUTCo1mjyrct5lDRH6S27DBjxCim3bvzGmZTT7jEiG9YvdEpBt6ieKaI2gsiPdFwV2 YFLw== 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=QyIR2mU70I1YwkwOLa0CmZ/17qlaxKeUVXrXvltnm30=; b=qeAlrnCJqPQ2jUg/zJVzxz3/k2xE/8WuhtXN6ozcQuOBGXxe6bCWVpyKk/9lWsTR1U TUlIOLWz2XzECX0CTQD0z7acqy4XQQR6gJlS0esQR5/V3ZhcQU6FJPACNOw7vY6QcgDW WuJwEftNqpgzKswlcVHtudz3NA2afEtvLBEBJ9Y2IEcl6tCpWiP9Bx8kYkq2MnagTUla hqbieFZLaH0SuDCFk0MnwrRHSgPnwuMg/fe+HLXBMu/y8wkwnTFKsOFL2Vs5rV794fq6 jFWQzgRQCWnaymMBh/0U43EuXCbBjlDRfJRUE7Hly7DhKhID6SoqDnMbGs2srpsx9Rv4 YtKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=GFjusIHg; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ZH1+1s4a; 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 qw5-20020a1709066a0500b00780a240cfd7si11204080ejc.493.2022.10.18.01.19.44; Tue, 18 Oct 2022 01:20:09 -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=GFjusIHg; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ZH1+1s4a; 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 S230401AbiJRIIc (ORCPT + 99 others); Tue, 18 Oct 2022 04:08:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiJRIIR (ORCPT ); Tue, 18 Oct 2022 04:08:17 -0400 Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAED289971 for ; Tue, 18 Oct 2022 01:08:14 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 0EDFD2B05993; Tue, 18 Oct 2022 04:08:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 18 Oct 2022 04:08:14 -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=1666080489; x=1666087689; bh=QyIR2mU70I 1YwkwOLa0CmZ/17qlaxKeUVXrXvltnm30=; b=GFjusIHgj8xz/yi7jFvMKNEQxw HZ7+9YtYcFDKPj4XhMSDNdoNg/sq2vcXZOu9JUJQNrnfSNhv3FzbuQxvyTe7zxv6 HNmaCAy+x3F8INAsxCFyjYbN1zyXSznVuvbVd4WvSDSSfB22mp4BjmYOkJmMCop4 c1zma+hOzfeHlhisprEz6BF7/WdlcDHPoui4ePgJ9+iTrBn7LuNWHOpfCyU43RMZ 9MWeUivxIiVvXOW+9NvBgpukWnqglECw5oQu01fWdHAZtkMyAEHB6cdf76bEC7Uc fUq5aW+BidlQZg4CgEQ37ngnY/EzqNA1p95Hy5fsAV1QBg65BD9ITLEjG/AQ== 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= fm3; t=1666080489; x=1666087689; bh=QyIR2mU70I1YwkwOLa0CmZ/17qla xKeUVXrXvltnm30=; b=ZH1+1s4aJx7OrygMRTnrhV+LMcQ0Fl5Kp6pyvkYoBkNo GmwWfybSd1z+VI69F79wLXYaoim/Qfyfzn7n/MB2+IRbKrZ+/b0QOLeRsZgAb8Fd 8PqGjo137EOY7CpjWJOeILZb5MjokJbqjUopRfiibgZuUB8FSPF0/jVkgsaLmZG8 6n0wJBtTYqEA+1IaLVqwIbLsA2onk7csRjzUKB8isgB3AEspSi0yKiQX04nzOXNX QiiD4owR9mc4e3meKqg462agLHz3WMQCHWoqPbZ7itzrI8V5rg6/UmHyfqxXmP5G /cd+qux90phW4qVWeCFzCmteS3SOHvJV9HsRIxHA3w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeludcutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhmvgcu tfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvg hrnhepteefffefgfektdefgfeludfgtdejfeejvddttdekteeiffejvdfgheehfffhvedu necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgi himhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Oct 2022 04:08:08 -0400 (EDT) Date: Tue, 18 Oct 2022 10:08:06 +0200 From: Maxime Ripard To: kfyatek+publicgit@gmail.com Cc: Karol Herbst , Jani Nikula , Tvrtko Ursulin , Daniel Vetter , Maarten Lankhorst , David Airlie , Joonas Lahtinen , Lyude Paul , Emma Anholt , Chen-Yu Tsai , Samuel Holland , Ben Skeggs , Thomas Zimmermann , Rodrigo Vivi , Jernej Skrabec , Dom Cobley , linux-sunxi@lists.linux.dev, Dave Stevenson , Noralf =?utf-8?Q?Tr=C3=B8nnes?= , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Hans de Goede , Phil Elwell Subject: Re: [PATCH v5 06/22] drm/modes: Add a function to generate analog display modes Message-ID: <20221018080806.mkw4zbzchlatxgwq@houat> References: <20220728-rpi-analog-tv-properties-v5-0-d841cc64fe4b@cerno.tech> <20220728-rpi-analog-tv-properties-v5-6-d841cc64fe4b@cerno.tech> <30dbbcc8-1d14-0fc8-ed7c-0c3f7d094ea3@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bz2m37ekv7hmvzdb" Content-Disposition: inline In-Reply-To: <30dbbcc8-1d14-0fc8-ed7c-0c3f7d094ea3@gmail.com> 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 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 --bz2m37ekv7hmvzdb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sun, Oct 16, 2022 at 07:34:12PM +0200, Mateusz Kwiatkowski wrote: > Hi Maxime & everyone, >=20 > Sorry for being inactive in the discussions about this patchset for the l= ast > couple of weeks. >=20 > > +const static struct analog_parameters tv_modes_parameters[] =3D { > > + TV_MODE_PARAMETER(DRM_MODE_ANALOG_NTSC, > > + NTSC_LINES_NUMBER, > > + NTSC_LINE_DURATION_NS, > > + PARAM_RANGE(NTSC_HACT_DURATION_MIN_NS, > > + NTSC_HACT_DURATION_TYP_NS, > > + NTSC_HACT_DURATION_MAX_NS), > > + PARAM_RANGE(NTSC_HFP_DURATION_MIN_NS, > > + NTSC_HFP_DURATION_TYP_NS, > > + NTSC_HFP_DURATION_MAX_NS), > > + PARAM_RANGE(NTSC_HSLEN_DURATION_MIN_NS, > > + NTSC_HSLEN_DURATION_TYP_NS, > > + NTSC_HSLEN_DURATION_MAX_NS), > > + PARAM_RANGE(NTSC_HBP_DURATION_MIN_NS, > > + NTSC_HBP_DURATION_TYP_NS, > > + NTSC_HBP_DURATION_MAX_NS), > > + PARAM_RANGE(NTSC_HBLK_DURATION_MIN_NS, > > + NTSC_HBLK_DURATION_TYP_NS, > > + NTSC_HBLK_DURATION_MAX_NS), > > + 16, > > + PARAM_FIELD(3, 3), > > + PARAM_FIELD(3, 3), > > + PARAM_FIELD(16, 17)), > > + TV_MODE_PARAMETER(DRM_MODE_ANALOG_PAL, > > + PAL_LINES_NUMBER, > > + PAL_LINE_DURATION_NS, > > + PARAM_RANGE(PAL_HACT_DURATION_MIN_NS, > > + PAL_HACT_DURATION_TYP_NS, > > + PAL_HACT_DURATION_MAX_NS), > > + PARAM_RANGE(PAL_HFP_DURATION_MIN_NS, > > + PAL_HFP_DURATION_TYP_NS, > > + PAL_HFP_DURATION_MAX_NS), > > + PARAM_RANGE(PAL_HSLEN_DURATION_MIN_NS, > > + PAL_HSLEN_DURATION_TYP_NS, > > + PAL_HSLEN_DURATION_MAX_NS), > > + PARAM_RANGE(PAL_HBP_DURATION_MIN_NS, > > + PAL_HBP_DURATION_TYP_NS, > > + PAL_HBP_DURATION_MAX_NS), > > + PARAM_RANGE(PAL_HBLK_DURATION_MIN_NS, > > + PAL_HBLK_DURATION_TYP_NS, > > + PAL_HBLK_DURATION_MAX_NS), > > + 12, > > + > > + /* > > + * The front porch is actually 6 short sync > > + * pulses for the even field, and 5 for the > > + * odd field. Each sync takes half a life so > > + * the odd field front porch is shorter by > > + * half a line. > > + * > > + * In progressive, we're supposed to use 6 > > + * pulses, so we're fine there > > + */ > > + PARAM_FIELD(3, 2), > > + > > + /* > > + * The vsync length is 5 long sync pulses, > > + * each field taking half a line. We're > > + * shorter for both fields by half a line. > > + * > > + * In progressive, we're supposed to use 5 > > + * pulses, so we're off by half > > + * a line. > > + * > > + * In interlace, we're now off by half a line > > + * for the even field and one line for the odd > > + * field. > > + */ > > + PARAM_FIELD(3, 3), > > + > > + /* > > + * The back porch starts with post-equalizing > > + * pulses, consisting in 5 short sync pulses > > + * for the even field, 4 for the odd field. In > > + * progressive, it's 5 short syncs. > > + * > > + * In progressive, we thus have 2.5 lines, > > + * plus the 0.5 line we were missing > > + * previously, so we should use 3 lines. > > + * > > + * In interlace, the even field is in the > > + * exact same case than progressive. For the > > + * odd field, we should be using 2 lines but > > + * we're one line short, so we'll make up for > > + * it here by using 3. > > + * > > + * The entire blanking area is supposed to > > + * take 25 lines, so we also need to account > > + * for the rest of the blanking area that > > + * can't be in either the front porch or sync > > + * period. > > + */ > > + PARAM_FIELD(19, 20)), > > +}; >=20 > Nit: setting vbp limits like that makes it impossible to use > drm_analog_tv_mode() to generate modes that include the VBI for e.g. emit= ting > teletext. >=20 > This probably doesn't matter, as it can still be created as a custom mode= from > userspace, hence I'm mentioning it as a nit. Yeah, I think it's out of scope at least for now. Also, the compositor should probably be aware of the margins being used to put the VBI data, so expecting userspace to come up with the mode is probably best? > > + * By convention, NSTC (aka 525/60) systems start with >=20 > Typo: s/NSTC/NTSC/ Fixed, thanks Maxime --bz2m37ekv7hmvzdb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY05e5QAKCRDj7w1vZxhR xR8VAQC+375DtcagkAytZVeOEe9aSmsByYFfuLp2Bt0aRSrhEAD/SoTKGvPkbrp3 DYtTf34PAYs3gXueCuNbfrKzWk9/DgM= =IY6U -----END PGP SIGNATURE----- --bz2m37ekv7hmvzdb--