Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3170332imw; Mon, 11 Jul 2022 03:26:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t4kJdAaA0QU7sOMGSz7jngETy62yUm++Wm4vwS7PbLpL2cKzNdSonNTz/g6XrucA7HnrY8 X-Received: by 2002:a17:906:11d:b0:712:abf:3210 with SMTP id 29-20020a170906011d00b007120abf3210mr17519700eje.292.1657535189405; Mon, 11 Jul 2022 03:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657535189; cv=none; d=google.com; s=arc-20160816; b=U5uRR6E5WSidYyQDkRq0no1JA4VXh2R6eOWRVsKV+R0fDZNM/aWtalgSuoQuRra5+x rBGsFlXL8M9jnjZLBwBvEJqyWhD4WdYWwIR0cX4e5KDYBs17gzFq92ho5OaLBlf3oiyw QXC5R1SmoMr/tDtpO7QRHgBIR2DNUJ1l7DVTQDfL0WL/LBOTbEq++8FNJUdzMBFZmfC2 eIe53ERJiC2boJUr3CWfeOW+5wRJROAA/qfiIg25oTT5M1FX2ep/S1VjIWpFgXx0hHsY 6GASamZEbiH5QTRZpFhMwXKByT62u4ThFA83WO/hGhgNwjihFCGtiVvo8SF0EIlBr8Qy 3+Bw== 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=XbWPLMD2EmuATKpk1FD3KGRJwxeaul3Brd4v6K9DrL4=; b=y0PVMSOL0C0C4IeKKrnnVodhxCpPhfye3ZYl+eG4qPZLI1sCOYStWl27MXG//2lb7s jDyFGHkMGYSxoyQStIZJwlkR06CXpw/h0/cG6Uo9OXlq561owgCJhia6Zvt8EBM9QlwJ VQoUbYAuYTVObTTQXny4jXpBriJvBpANOwxePkQXptVEedHfXC4fW4r8Uf5vw/8IJKCR EQRQg1qB9rknzFx4SSE0roLUR7M/DSqLcNo+2jVEjlN0P+uKc5Gt4rw5X6UyADVvBjH2 EkTT/j+xXCEc29eEM4EpmcpUvOBM9457U8c29wg+KPyvORz7cGw9x9MG5YC44BI9Q7Pz DO5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=OTp3vytl; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=wzqDE7Xj; 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 j5-20020aa7c0c5000000b0043586d19cf9si8357667edp.465.2022.07.11.03.26.04; Mon, 11 Jul 2022 03:26:29 -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=OTp3vytl; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=wzqDE7Xj; 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 S230225AbiGKKRU (ORCPT + 99 others); Mon, 11 Jul 2022 06:17:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbiGKKQx (ORCPT ); Mon, 11 Jul 2022 06:16:53 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDD93C1FD1; Mon, 11 Jul 2022 02:35:21 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C91F35C013F; Mon, 11 Jul 2022 05:35:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 11 Jul 2022 05:35:17 -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=1657532117; x=1657618517; bh=XbWPLMD2Em uATKpk1FD3KGRJwxeaul3Brd4v6K9DrL4=; b=OTp3vytlqDJB+2vPD994rtzUSQ jOws1ocqG9aslbnxMmio9bk1vaHERJXD7S921jfGSwXU7mfjCLmOJsp6N4kPa1nS WV+bhI42L3Q1gasRfbu21/LfY0yp4ykbp2LLnIpmwPlgl5kS7zo7bJ4wOXab1QmX nyqjD3zURMq1PW+SdxxfC3ISp70/EUiHicvVmCyCQV/8aMYfjd4PkHbR7IdFHaw1 l3sQN0VEICD8f2wFihwiBH0UnLrKFGcIj2U33+YPCUoYu7jxye3iHB5GmE+3o3q4 xjqnlZ7ZKympcszm3AzbT4jgpbqHFAbRu622d4YeNYOFHoQdsc4ArFJPEIww== 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=1657532117; x=1657618517; bh=XbWPLMD2EmuATKpk1FD3KGRJwxea ul3Brd4v6K9DrL4=; b=wzqDE7Xj1fV2ovXBsdHnlLejf5Lp0LnnASBzLWnrAtd6 I1mRZmLfKZaPTBJA36z0FJdpWVDlOTxgEBXWk337UKwjnJS/CELoL+exFpjxhnny Bn/mYvq8yOSUTmsz5RCnSp/pWCXhiEuhvq84r6RvnzBlaz4CLB04jvetRtl7dzEV Ff02JrIeEvpdBOGVR7rKxmTK8YbouQ8NWTDCS3c5CnCD3t4JJA5+PbWS8Bwp75MC Qbo69Cm0TQrkaGTODiop7u90HKRB8S4dF//8t2U/V4ZDitxKL673K+6czR9mfhri OI0O1tctbPEc19fxRRFH1rEH2YKJdYe8RtxptgNqdw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejfedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpefgueeutdefgfevveehjeefgeehvdejjeefheekffduteeutdfgieeiieff uedtffenucffohhmrghinhepsghoohhtlhhinhdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgv tghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Jul 2022 05:35:16 -0400 (EDT) Date: Mon, 11 Jul 2022 11:35:13 +0200 From: Maxime Ripard To: Thomas Zimmermann Cc: Geert Uytterhoeven , Maarten Lankhorst , David Airlie , Daniel Vetter , Hans de Goede , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] drm/modes: Add support for driver-specific named modes Message-ID: <20220711093513.wilv6e6aqcuyg52w@houat> References: <68923c8a129b6c2a70b570103679a1cf7876bbc2.1657301107.git.geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="x625msex36qfkynz" 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 --x625msex36qfkynz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Thomas, 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 explicitly > > listed in the internal whitelist, which is currently limited to "NTSC" > > and "PAL". > >=20 > > Provide a mechanism for drivers to override this list to support custom > > mode names. > >=20 > > Ideally, this list should just come from the driver's actual list of > > modes, but connector->probed_modes is not yet populated at the time of > > parsing. >=20 > I've looked for code that uses these names, couldn't find any. How is this > being used in practice? For example, if I say "PAL" on the command 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/sun4i/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 this 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_mode (NTSC vs NSTC-J where the only difference is the black and blanking 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 name, but we fall back to matching by mode if it hasn't been, which in this 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 into the > driver at all. Standard modes exist independent from drivers or hardware. > Shouldn't there simply be a global list of all possible mode names? Drive= rs > would filter out the unsupported modes anyway. We should totally do something like that, yeah Maxime --x625msex36qfkynz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYsvu0QAKCRDj7w1vZxhR xYfLAQCE7tFL3DFGFWWg7d+mu+PlmSZLGOBUYGT1QXAXIgy1PAEAszxH3TfwGPT4 YhVwpShCkoqgvPRPCUVP/woGKYyuWAM= =5GMd -----END PGP SIGNATURE----- --x625msex36qfkynz--