Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp606826rwi; Thu, 27 Oct 2022 05:38:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM487qnYQrkMU6muUWNTdRYYJPwCKzET/PlUcdlPeO0kld803Hwmsr5n0oSpNxL4Rv6uVMEz X-Received: by 2002:a05:6a00:1acd:b0:56b:8181:d78d with SMTP id f13-20020a056a001acd00b0056b8181d78dmr28084043pfv.50.1666874307142; Thu, 27 Oct 2022 05:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666874307; cv=none; d=google.com; s=arc-20160816; b=qxr7SG58ZF0zCq4LY+RW0SbC+9E7319/ZSemixr1M2xIOKsaw015TLzG/6k0ZIeFWg zaK/1lRalKTT9Ue2Xbn7YUxlYcXzJWvk2nxS1u/Ifw21DYioYHzFtMN57f8tSfv6x2YK XRmC2lNCSX5z8WGxyyl4BL3R+05BrpNPidJh6USRJ1piSLr+qJiQMUHQdgALwXnlPGmn D1oaLcfA7L34IgtiW3n9ngfDjGcea2kSkZP/gQCzZx/860hq/OESsRXxdlv2Y3gr99b8 YALcU0/GVJSqHOlp5NaK3h/FdBYrj6ZUGpdbQ28+ZYHb35w8hktWNE0UqZ1CGaQWtNlu n4vA== 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=QyApW52GGWOGnMQtvgaWWVm3IOEOZXDwE9lLItGdiLY=; b=hI3uJ03Q9YrIpuQnDKFBadsEeyWVKJ0IkAKoVG0MguiPsweONSNoEsrWrbL8VL3ukJ jDSsULJhkdsWGSfVNtmPvrXcS4URZoOjcxepibkiK84v5piyYpCQSr16A2RGXUx2yH4A zlE4fwyy4gP+VzA36ttOYO2UXZeswP2cN0EL6YbtBRrkFewnza0xBaqD83xssR7irdQ0 yclvub0ELDeX/W3PdEmGzQvO175e25sRoywoYCE9gX1OYQYU1A0/6EWNhgZHc1lmHqhU akHFtqAVrwRFxLiS5HlFcFbn/bAinyhD8oHOjcOdw2YlUTH/u40xtEN+qrKsKaXnWxjm B8Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b="uF//YRP5"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=X5KOnyeX; 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 l62-20020a638841000000b00429b4bd247asi1459207pgd.397.2022.10.27.05.38.15; Thu, 27 Oct 2022 05:38:27 -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="uF//YRP5"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=X5KOnyeX; 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 S235451AbiJ0L6i (ORCPT + 99 others); Thu, 27 Oct 2022 07:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235456AbiJ0L6g (ORCPT ); Thu, 27 Oct 2022 07:58:36 -0400 Received: from wnew1-smtp.messagingengine.com (wnew1-smtp.messagingengine.com [64.147.123.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45FCB62913 for ; Thu, 27 Oct 2022 04:58:32 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 9AD912B066FE; Thu, 27 Oct 2022 07:58:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 27 Oct 2022 07:58:31 -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=1666871907; x=1666879107; bh=QyApW52GGW OGnMQtvgaWWVm3IOEOZXDwE9lLItGdiLY=; b=uF//YRP5AA3BkLmQtb+sTcWpgH hk2HTy6BCO6QZu5obOUiI2weB0GqkqU7EYohbQTg1XdfrOGCYkVJi+p3vOUopU6I JTXI5dP21OTXqJRlGU/wvVC5PBPw4hYaL2AFhxYgnFTDv36LLn4rA7ytqFXb3zAk bt+FmImAVzuTI2sHRcVQRCv/XjSppxGquUVmshtTICQWRRE3m9az2fp8SqKScgPK TUaI0dfU29NYrX6H/9nIbVVx2ljADhJWJ5B6VvyFLDHVXCDe2q5n3d2htKFfJmAI ItI5qfAu65peUdI4fxjyHl+8YesnAPhZ0KQiGuVQ6WsmAbm8bItIXBigIHYA== 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=1666871907; x=1666879107; bh=QyApW52GGWOGnMQtvgaWWVm3IOEO ZXDwE9lLItGdiLY=; b=X5KOnyeXpFpd9UUPBhTooylt8Bn5VnVl9lyj1OWBqdOT 3eMOeTk76m/uJpIUSNpx/gKUJuCsu4oMVW+2w5uu53DfcAi2dyotu5NiSwMA7zF2 kDpC9DrK+wT9QK/xPGF7J879cPUWSeP+ovy4NIXMMqQrF0uuI+vuw03DlVAz7TQS pt3dbB5A7FyhUe6nG3yGWQ9spnihyotU/dXSS9/Fo8475Urre+4o7TjnCZnzYvrs r73sucWl8RuMrSovYvdUOJfNWjeLek2qCEnfjkR9btgZ9nKZXlS5g5npQPNqoM5K h/RVHWs+mq0A+Pr7hQTRzfRHGu5MGs5r3H83s45SOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdeggdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnheptdelkeejiedufedvhfeiffetlefhiedvleeigfeiuefghfdvleeiffejieeg teejnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Oct 2022 07:58:24 -0400 (EDT) Date: Thu, 27 Oct 2022 13:58:22 +0200 From: Maxime Ripard To: Mateusz Kwiatkowski Cc: Karol Herbst , Emma Anholt , Ben Skeggs , Chen-Yu Tsai , Rodrigo Vivi , Maarten Lankhorst , Jani Nikula , Daniel Vetter , Thomas Zimmermann , Tvrtko Ursulin , Samuel Holland , Jernej Skrabec , David Airlie , Joonas Lahtinen , Lyude Paul , linux-sunxi@lists.linux.dev, intel-gfx@lists.freedesktop.org, Phil Elwell , linux-arm-kernel@lists.infradead.org, nouveau@lists.freedesktop.org, Hans de Goede , Dom Cobley , dri-devel@lists.freedesktop.org, Dave Stevenson , linux-kernel@vger.kernel.org, Noralf =?utf-8?Q?Tr=C3=B8nnes?= , Geert Uytterhoeven Subject: Re: [PATCH v6 22/23] drm/vc4: vec: Add support for more analog TV standards Message-ID: <20221027115822.5vd3fqlcpy4gfq5v@houat> References: <20220728-rpi-analog-tv-properties-v6-0-e7792734108f@cerno.tech> <20220728-rpi-analog-tv-properties-v6-22-e7792734108f@cerno.tech> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ysfbxxbxsmqctfb3" 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 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 --ysfbxxbxsmqctfb3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Thu, Oct 27, 2022 at 12:32:50AM +0200, Mateusz Kwiatkowski wrote: > I've seen that you've incorporated my PAL60 patch. Thanks! >=20 > I still yet need to test your v6 changes, but looking at this code with j= ust my > mental static analysis, it seems to me that the vc4_vec_encoder_atomic_ch= eck() > should have the tv_mode validation. I should've added it to the PAL60 pat= ch, > but it somehow slipped my mind then. >=20 > Anyway, I mentioned it previously here: > https://lore.kernel.org/dri-devel/0f2beec2-ae8e-5579-f0b6-a73d9dae1af4@gm= ail.com/ >=20 > It would look something like this, inside vc4_vec_encoder_atomic_check(): >=20 > + const struct vc4_vec_tv_mode *tv_mode =3D > + vc4_vec_tv_mode_lookup(conn_state->tv.mode); > + > + if (!tv_mode) > + return -EINVAL; >=20 > Without this, it's possible to set e.g. 480i mode and SECAM, which will f= ail - > but with the current version it will only fail in vc4_vec_encoder_enable(= ), > which cannot return an error, and in my experience that causes a rather l= engthy > lockup. ACK, I'll add it. > But, like I said, I still need to actually test that with this version. > > Anyway, I was also thinking about adding support for the more "exotic" > non-standard modes. NTSC-50 is, unfortunately, impossible with VEC, but > PAL-N-60 and PAL-M-50 should work. The necessary vc4_vec_tv_modes entries= would > look something like: >=20 > @@ -325,12 +325,28 @@ static const struct vc4_vec_tv_mode vc4_vec_tv_mode= s[] =3D { > .config0 =3D VEC_CONFIG0_PAL_M_STD, > .config1 =3D VEC_CONFIG1_C_CVBS_CVBS, > }, > + { > + /* PAL-M-50 */ > + .mode =3D DRM_MODE_TV_MODE_PAL, > + .expected_htotal =3D 864, > + .config0 =3D VEC_CONFIG0_PAL_BDGHI_STD, > + .config1 =3D VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ, > + .custom_freq =3D 0x21e6efe3, > + }, > { > .mode =3D DRM_MODE_TV_MODE_PAL_N, > .expected_htotal =3D 864, > .config0 =3D VEC_CONFIG0_PAL_N_STD, > .config1 =3D VEC_CONFIG1_C_CVBS_CVBS, > }, > + { > + /* PAL-N-60 */ > + .mode =3D DRM_MODE_TV_MODE_PAL_N, > + .expected_htotal =3D 858, > + .config0 =3D VEC_CONFIG0_PAL_M_STD, > + .config1 =3D VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ, > + .custom_freq =3D 0x21f69446, > + }, > { > .mode =3D DRM_MODE_TV_MODE_SECAM, > .expected_htotal =3D 864, >=20 > I'm not sure if we actually want to add that. The two arguments for doing= so > I can think of is 1. it should work, so "why not", 2. it means that more = modes > will result in _some_ kind of a valid signal, rather than erroring out, w= hich > is always a plus in my book. I can also think of a hypothetical use case,= like > someone in South America with an old PAL-N-only set that would neverthele= ss > still sync at 60 Hz (perhaps with the help of messing with vertical hold = knob), > who would like to play retro games at 60 Hz in color. >=20 > But on the other hand, I admit that this scenario is likely a stretch and= the > number of people who would actually use it is probably close to the prove= rbial > two ;) So it's your call, I'm just leaving those settings here just in ca= se. This series is already pretty massive and is difficult to merge, so I'd rather avoid to add new stuff in at every version. The changes look easy enough to be a follow-up patch, so I'd prefer to do it that way. Maxime --ysfbxxbxsmqctfb3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY1pyXgAKCRDj7w1vZxhR xUhMAP0XpvpKwMyQUT0qv5zm8wU1Oj1FqnHhCXeuVVO8jcNQEQEA3oyfkhXsxwGB 0XwSRrhGDf0kHcwS9XXqBCQFEgMYgww= =04yJ -----END PGP SIGNATURE----- --ysfbxxbxsmqctfb3--