Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp394555rwb; Wed, 9 Nov 2022 04:05:28 -0800 (PST) X-Google-Smtp-Source: AMsMyM7eKX1JhLMb83w4xWM9Ysw2+P6aa86kf1g0Oa+TzHWQvHIxAhfa0u6RBRatjcbfHOcusFYM X-Received: by 2002:a62:a503:0:b0:56b:cb10:2d87 with SMTP id v3-20020a62a503000000b0056bcb102d87mr61309780pfm.79.1667995528353; Wed, 09 Nov 2022 04:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667995528; cv=none; d=google.com; s=arc-20160816; b=UwmWCwTTkqXMcr8eEpzoInqZQDzQqKtVTum51Uj30ctdi/GuzWyE8/Iwb23vwY5bKw vKVx+xUihZ5ZmFShJ8MJU0jJrp2frq6yv674QO6zMfovSayPWIu07cNZ+ebkMArufjNG RT2o8fKdd/sst+xz58r9zwawIUvMws8NmsqJ23hv+7MtDl//oMzCBlXZTo1+A9A5gODh iGuHLD+boyI5iMb673Z58nInVn5J+msMj2XT03+ZOTbAXEmrSrhCLh2AmaEF4eF/Op63 TLJXueZjmo8YBvRXWNdTDncoPRnsKZ1astJtRsxVkesJM4WpJx7u6euPjVMAwOnPh6Un 9dXA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=cpSERR+FK9P7ebGFjATnLVrDN6DOeEdblTQYZr4G17o=; b=yC0324+bMv5JpKC+vXq+WuXej2EBhganfdXDC6wD3p9HxC6fXMmwYNRZMgYrB5T0DS uFyC1jGHJ8E2K1xbOtcIXy77f5on0v+c7cGTcx9L757aWdSaSJq2QLJQCDZ69/P4RrP0 k2g20gPQYvZbpEYMu27+IU57zacLY00bVrn0JHqTYfBBJEtwAKdm9G4LfgdfiSHZl8A1 8zJcMKgwG+Xl8ufwoU0zDJCUdeayKR1vmQ/x+s08CzUl+ybVKQrWOddysgggk6syWDHh AC/LVUkAT7X+45BmsgdWtCDFyYIOMO62rGlI/Hrjmiu3tXmdGoNvAXBLiRO4Q9pte5CZ Bc6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=TFl+QG10; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=duMtVZ+5; 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 d1-20020a170902cec100b00183f6ff535dsi21609872plg.490.2022.11.09.04.05.15; Wed, 09 Nov 2022 04:05:28 -0800 (PST) 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=TFl+QG10; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=duMtVZ+5; 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 S231216AbiKILT1 (ORCPT + 93 others); Wed, 9 Nov 2022 06:19:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbiKILSs (ORCPT ); Wed, 9 Nov 2022 06:18:48 -0500 Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAC7517AB6 for ; Wed, 9 Nov 2022 03:18:47 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 49C755803FC; Wed, 9 Nov 2022 06:18:47 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 09 Nov 2022 06:18:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding: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=1667992727; x= 1667999927; bh=cpSERR+FK9P7ebGFjATnLVrDN6DOeEdblTQYZr4G17o=; b=T Fl+QG10PPJjyqbLv7utqEfzNtwLor8oEF2yTMFmRZHKm4urXSwwwtVVoJls3ijLN TZGwJSryG3lX2kfJo1LkfWBvNtXl25oDLriO6JyPMx/Zsocv8wuDzRVJB+jqy07g QUOSBrMSfrge6LynWHCWE1/lV1yjZbK4yTuD1oMGOnBBq+3FWpOwfmhA2BvIWQpG RAos1g98wq13r4iAbQU5ThqHpZt4x8tDRQXVhs20koBVF6zKRbK3XruwKa6T445f UPJdRxk9PEJ1mjmw8VS4TxBh1ILLkI+NXFpGCoD5j1H5KRDBJ3PCaJ/0yprraXIE ilDIlX626Xe9eToZoG2gA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1667992727; x= 1667999927; bh=cpSERR+FK9P7ebGFjATnLVrDN6DOeEdblTQYZr4G17o=; b=d uMtVZ+5DS4SQSD5wEMQmNSkiNMJP4Co4dFNFStkseeS8p6I8UchUdcqGmSsvgGxC 4RZ6bcMdPuRLTA0BWbDhBAIt51NSpFXgMJ0eanp/yx4/cXLpRy45fJbbaEZ3G/4M iyqTG3rDfQMqN7xTZBwZggU2VIS0IBURZBB1lbrHL5jFf6ZZEYfn3gt2dVU3Yeol lcGQZL/uLfEmt35zmb9Tderps113BIXOMqQVwSxyL3x8oBdo8StWUaW3xV1L2m4n hBePcSN+Xldp9A/ERXwotiMGuXGFHEzOg6uM3w/4xD0dZGkID2FivMHmtWBOPdAk Rn/JJK1MJS1fA5u29rNGQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfedvgddvhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtugfgjgesthhqredttddtudenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeelleefieelleetteefvdeikeeffeffvefhtdevgfehveduveehjedvvdei ledtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Nov 2022 06:18:45 -0500 (EST) Date: Wed, 9 Nov 2022 12:18:43 +0100 From: Maxime Ripard To: kfyatek+publicgit@gmail.com Cc: Noralf =?utf-8?Q?Tr=C3=B8nnes?= , Jani Nikula , Joonas Lahtinen , Tvrtko Ursulin , Ben Skeggs , Rodrigo Vivi , Samuel Holland , Jernej Skrabec , Maarten Lankhorst , Emma Anholt , Karol Herbst , Daniel Vetter , Chen-Yu Tsai , Lyude Paul , Thomas Zimmermann , David Airlie , Phil Elwell , Hans de Goede , linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Dave Stevenson , linux-arm-kernel@lists.infradead.org, Dom Cobley , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org Subject: Re: [PATCH v7 15/23] drm/modes: Introduce more named modes Message-ID: <20221109111843.jkufdneexakofa4p@houat> References: <20220728-rpi-analog-tv-properties-v7-0-7072a478c6b3@cerno.tech> <20220728-rpi-analog-tv-properties-v7-15-7072a478c6b3@cerno.tech> <262f0953-1e05-e68e-3e96-2ac2132a1e57@tronnes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 On Tue, Nov 08, 2022 at 10:27:17PM +0100, Mateusz Kwiatkowski wrote: > Hi Noralf, >=20 > W dniu 8.11.2022 o 10:38, Noralf Tr=F8nnes pisze: > > > > Den 07.11.2022 19.03, skrev Noralf Tr=F8nnes: > >> > >> Den 07.11.2022 15.16, skrev Maxime Ripard: > >>> Now that we can easily extend the named modes list, let's add a few m= ore > >>> analog TV modes that were used in the wild, and some unit tests to ma= ke > >>> sure it works as intended. > >>> > >>> Signed-off-by: Maxime Ripard > >>> > >>> --- > >>> Changes in v6: > >>> - Renamed the tests to follow DRM test naming convention > >>> > >>> Changes in v5: > >>> - Switched to KUNIT_ASSERT_NOT_NULL > >>> --- > >>> drivers/gpu/drm/drm_modes.c | 2 + > >>> drivers/gpu/drm/tests/drm_client_modeset_test.c | 54 +++++++++++++++= ++++++++++ > >>> 2 files changed, 56 insertions(+) > >>> > >>> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c > >>> index 49441cabdd9d..17c5b6108103 100644 > >>> --- a/drivers/gpu/drm/drm_modes.c > >>> +++ b/drivers/gpu/drm/drm_modes.c > >>> @@ -2272,7 +2272,9 @@ struct drm_named_mode { > >>> =20 > >>> static const struct drm_named_mode drm_named_modes[] =3D { > >>> NAMED_MODE("NTSC", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MO= DE_TV_MODE_NTSC), > >>> + NAMED_MODE("NTSC-J", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_= MODE_TV_MODE_NTSC_J), > >>> NAMED_MODE("PAL", 13500, 720, 576, DRM_MODE_FLAG_INTERLACE, DRM_MOD= E_TV_MODE_PAL), > >>> + NAMED_MODE("PAL-M", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_M= ODE_TV_MODE_PAL_M), > >>> }; > >> I'm now having second thoughts about the tv_mode commandline option. C= an > >> we just add all the variants to this table and drop the tv_mode option? > >> IMO this will be more user friendly and less confusing. > >> > > One downside of this is that it's not possible to force connector status > > when using named modes, but I think it would be better to have a force > > option than a tv_mode option. A lot of userspace treats unknown status > > as disconnected. > > > > Anyone know if it's possible to set the connector status sysfs file > > using a udev rule? > > > > Noralf. >=20 > I think that leaving named modes only would be a bit limiting. There are = use > cases for custom modes, e.g. we might want progressive 240p "NTSC" (like = 80s/90s > home computers and video game consoles) or the modes with non-13.5MHz pix= el > clock that Geert requested with Amiga in mind. Yeah, it was one of the early requirements that we would be allowed to fill in any analog mode on the command line, so just having the named modes with the 480i and 576i modes won't really work for that. > I'm not sure if the current cmdline-to-drm_mode conversion is flexible en= ough > to meaningfully facilitate those, but we're at least getting the syntax d= own. It might require a bit of plumbing to get drm_mode_create_from_cmdline_mode() to add the mode if tv_mode_specified is set, but it's probably it. Maxime