Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3262137imw; Mon, 11 Jul 2022 05:25:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tnj9/1EAuI7Xc2pX+9yxvvyQr3tpQKB5iKdljt/gBTzMYCPfzTHMxF/PIsGDtnOyU4702l X-Received: by 2002:a17:902:d2d1:b0:16c:223e:a3db with SMTP id n17-20020a170902d2d100b0016c223ea3dbmr18544278plc.37.1657542344357; Mon, 11 Jul 2022 05:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657542344; cv=none; d=google.com; s=arc-20160816; b=ajHsO2r25QN5kpgxzAQpS6fBe5SPfsyaRYglhtTkrZ+i84tP9LsTnm/YKofBm/qPs4 N433eOotNA6IfvB27h2ULf/rZmRCpPOm3jllQ0BxdWF0bmBd3eyCQPo6CTW6851laypr GtIbTnEhwQlZKh/G+jhHi1tor+498INqQQn/eyDQtX0mjWXc3NAZ5yxH0Gb/5Z+QW9wp vdkos7JdlpPqBLK4Zpxqn0famtOUKsLueCV4nCj+TaRkruITs9UdVMoZRwe3EThMw0H6 z2E5jPPdU5kTyprFgjL/C9gK+R2zrHNh1SOkpCa+DmzvbvhfT7A7rZ/aoAtauKDoIU8l bYqQ== 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=SNJeB4/Dhxl49TyIs9UIYt5Da1GYDJCoWXl/+bNAjSg=; b=B2yB8diIDGaD8WyW09I5f2jyodkyoFrXe8V/i2tGn1Km0wQ95wQ3zlcpw+7NFgx9/I 0R+fvVmpklPW+JBrfmKw9D0cuKmejHcI6SdQMF5Cry858IMrszqCpgmFOu4cm2WbfbS+ xcGw3xrmBbqscpFSMOVaIdhintfJEYRyj+wWF5rkYZ9qlXm3aA0GD77QDen5ZOC8Grrk 5YKwPGDoiSr5FlkEHVftQ1oltZ0os3C6bpDVZru6zm4mCVxLYlClCUCYMJQfsHiB47Mk TPdp+c8D33Bf5o/lYGnEuXOpYKZxPcwfsT3MzW7++df65oPI1yEaedXIT8+Ce//fV2MU UL6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=d2zQM0TT; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ZYyBOd45; 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 66-20020a630045000000b00415d68030basi9457056pga.598.2022.07.11.05.25.32; Mon, 11 Jul 2022 05:25:44 -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=fm2 header.b=d2zQM0TT; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ZYyBOd45; 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 S231187AbiGKMC4 (ORCPT + 99 others); Mon, 11 Jul 2022 08:02:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbiGKMCs (ORCPT ); Mon, 11 Jul 2022 08:02:48 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05C733AB39; Mon, 11 Jul 2022 05:02:47 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 672965C011B; Mon, 11 Jul 2022 08:02:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 11 Jul 2022 08:02:46 -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=fm2; t=1657540966; x=1657627366; bh=SNJeB4/Dhx l49TyIs9UIYt5Da1GYDJCoWXl/+bNAjSg=; b=d2zQM0TT+dVDBVoO9zhQd5acBb lV4fTkkCb28HElRT+KGK2pLBIVLxOi0QsQY5xxT71YneRVlAOsFjRXHSsMiuXcmQ c1OwSHReUuZQT3QfyyHS1DqVf54kwb/UJfw7jDSkw9p1Y94RUAu8Xs+1pfPgmTg+ 2PCAWqyRrYbGepm2u4dpz0vi950hXhtYlhnroZRXydd3Kmep/tPvnfSUt0hbe08T LmsWD4B4p1OH/ULW8cbln3QdFAeYRJ8+RGz7vNs0txGQSqsz9RVyZzFtmrQsx792 UrJYWW1yi082WuhQvzKnLurg4bA8N+frEbubTvTcN9tiCjS0L6jfwr9MFIvQ== 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=1657540966; x=1657627366; bh=SNJeB4/Dhxl49TyIs9UIYt5Da1GY DJCoWXl/+bNAjSg=; b=ZYyBOd45wTxQq8HnbyQvvMyDUdp1d4uBVDXUdw7wFbPS NNsFd5LREx0AcBhzv67bZ5RJF/uxNWPwFlVyGrp1q2dkNuIiI922TIf9+aDNwIAR J0VnS8e/xNmmeTgNnEzxfLt1J5s1DHgObR3ckiarHARw/VQ/0NK9qxVCBXdA3LoL b6vFr4KPuRnUtPDtCh3Uk/Mv2FeXlc1BKQglZlV9FiUUo+isUPcpfNoXbNPyxz48 q7lpTpn0G7plK9HoJic0XHjamTsSNXqgllJaXc+8FEVTzlKhBKUXUN+JS9qRWSgR J/BQH6OjxocBl1dtecYTwxBFxFg4XHKmHScJvLBAmg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejfedggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpefgkeevueetgffhueeujefhgeejiefgiedtveefgfdugefhteejgedufedv geeukeenucffohhmrghinhepsghoohhtlhhinhdrtghomhdpfihikhhiphgvughirgdroh hrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehm rgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Jul 2022 08:02:45 -0400 (EDT) Date: Mon, 11 Jul 2022 14:02:43 +0200 From: Maxime Ripard To: Geert Uytterhoeven Cc: Thomas Zimmermann , Maarten Lankhorst , David Airlie , Daniel Vetter , Hans de Goede , DRI Development , Linux Fbdev development list , Linux/m68k , Linux Kernel Mailing List Subject: Re: [PATCH 4/5] drm/modes: Add support for driver-specific named modes Message-ID: <20220711120243.v6lwoynqigle2aot@houat> References: <68923c8a129b6c2a70b570103679a1cf7876bbc2.1657301107.git.geert@linux-m68k.org> <20220711093513.wilv6e6aqcuyg52w@houat> <43d75dce-988a-0a95-cb0a-0d0a7c81ca63@suse.de> <20220711114206.sawqdl54ibuxsxp4@houat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="x3skiy3qyum7i2u6" 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 --x3skiy3qyum7i2u6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 11, 2022 at 01:59:28PM +0200, Geert Uytterhoeven wrote: > Hi Maxime, >=20 > On Mon, Jul 11, 2022 at 1:42 PM Maxime Ripard wrote: > > On Mon, Jul 11, 2022 at 01:11:14PM +0200, Thomas Zimmermann wrote: > > > Am 11.07.22 um 11:35 schrieb Maxime Ripard: > > > > On Mon, Jul 11, 2022 at 11:03:38AM +0200, Thomas Zimmermann wrote: > > > > > Am 08.07.22 um 20:21 schrieb Geert Uytterhoeven: > > > > > > The mode parsing code recognizes named modes only if they are e= xplicitly > > > > > > listed in the internal whitelist, which is currently limited to= "NTSC" > > > > > > and "PAL". > > > > > > > > > > > > Provide a mechanism for drivers to override this list to suppor= t custom > > > > > > mode names. > > > > > > > > > > > > Ideally, this list should just come from the driver's actual li= st of > > > > > > modes, but connector->probed_modes is not yet populated at the = time of > > > > > > parsing. > > > > > > > > > > I've looked for code that uses these names, couldn't find any. Ho= w is this > > > > > being used in practice? For example, if I say "PAL" on the comman= d line, is > > > > > there DRM code that fills in the PAL mode parameters? > > > > > > > > We have some code to deal with this in sun4i: > > > > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/sun4= i/sun4i_tv.c#L292 > > > > > > > > It's a bit off topic, but for TV standards, I'm still not sure what= the > > > > best course of action is. There's several interactions that make th= is a > > > > bit troublesome: > > > > > > > > * Some TV standards differ by their mode (ie, PAL vs NSTC), but = some > > > > other differ by parameters that are not part of drm_display_mo= de > > > > (NTSC vs NSTC-J where the only difference is the black and bla= nking > > > > signal levels for example). > > > > > > > > * The mode names allow to provide a fairly convenient way to add= that > > > > extra information, but the userspace is free to create its own= mode > > > > and might omit the mode name entirely. > > > > > > > > So in the code above, if the name has been preserved we match by na= me, > > > > but we fall back to matching by mode if it hasn't been, which in th= is > > > > case means that we have no way to differentiate between NTSC, NTSC-= J, > > > > PAL-M in this case. > > > > > > > > We have some patches downstream for the RaspberryPi that has the TV > > > > standard as a property. There's a few extra logic required for the > > > > userspace (like setting the PAL property, with the NTSC mode) so I'= m not > > > > sure it's preferable. > > > > > > > > Or we could do something like a property to try that standard, and > > > > another that reports the one we actually chose. > > > > > > > > > And another question I have is whether this whitelist belongs int= o the > > > > > driver at all. Standard modes exist independent from drivers or h= ardware. > > > > > Shouldn't there simply be a global list of all possible mode name= s? Drivers > > > > > would filter out the unsupported modes anyway. > > > > > > > > We should totally do something like that, yeah > > > > > > That sun code already looks like sometihng the DRM core/helpers shoul= d be > > > doing. And if we want to support named modes well, there's a long lis= t of > > > modes in Wikipedia. > > > > > > https://en.wikipedia.org/wiki/Video_Graphics_Array#/media/File:Vector= _Video_Standards2.svg > > > > Yeah, and NTSC is missing :) >=20 > And that diagram is about the "digital" variant of PAL. > If you go the analog route, the only fixed parts are vfreq/hfreq, > number of lines, and synchronization. Other parameters like overscan > can vary. The actual dot clock can vary wildly: while there is an > upper limit due to bandwidth limitations, you can come up with an > almost infinite number of video modes that can be called PAL, which > is one of the reasons why I don't want hardware-specific variants to > end up in a global video mode database. Do you have an example of what that would look like? Maxime --x3skiy3qyum7i2u6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHQEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYswRYwAKCRDj7w1vZxhR xZyoAQCvlU6ptYDqlD+5OSnBEW8SlJn/EIzhjLez9dXEBiIMzAD4+ipmQOM8LYFe Zmp1HcwEg3Jc/z7O6MErAiPEQdITAA== =pcXa -----END PGP SIGNATURE----- --x3skiy3qyum7i2u6--