Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3663900rwb; Tue, 16 Aug 2022 06:59:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR5D7iRuOKbH6AupsYRUmOGkKYt7C5SSXYEiI2m7DpzkxtGto9PKoEjI0kGb5Ji2ZbYoAmJE X-Received: by 2002:a17:907:c0d:b0:730:a85d:8300 with SMTP id ga13-20020a1709070c0d00b00730a85d8300mr13683448ejc.558.1660658379451; Tue, 16 Aug 2022 06:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660658379; cv=none; d=google.com; s=arc-20160816; b=vnGQnsMjQ5MKH1iPpbtG7LKDOHaTwV7+2P/+Gpq2k+7NPcvom6O7dMeCVHnjIPLoMp CnvpJaezx5W6lyrBH2EFNZfEnBQhr8sWlksnG2fCH/Qam9Uw703ZINcTar9cYl5HdIfp JIT9LcAuib+puawE/P/jSk5m79gZL+np9DKsdMYzkXCsSWycSUecR/l1Qmv56DppP+QE bn/wk92vRJ070nBBtOSpZjG/z/YXSGx1HO1/SYS8R9bXW8FiJgHymNbc7zhFJvnBy4GP KZSKyWvaoQN6L+7rxJC4SbabDr0KJueOQgp2btoIi37emfV6Na7mXexAB03Mw1JjGL0K exmA== 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=gHbL+MytjJsZvOVGVzDN1GM9hKYjC7rxGk40WyTKaIo=; b=m7DC4Doj08LwyrypKltvXuwTAUkyoqfa2dwD1gGE9K5rjlJtpIg9zhFO0GKE4jyyJ5 f65hDs+2rLx6t7rVyGAO1z429MYGkhgKVm37rXdE90G31yqx4LmnXD+EVwEW4vqRvyVK Gie6KJdxMdTWbZo8gze81WfXSBY5a2e9HAde4o8SSa4GteuYl5TnoaUoGwG0hngzVQUF i//rxypL889ZnPAGx3nylaF2BG/2EFah21LULr1uqx/1ujuxvPmOLEjT2OARf+aKitjm OxWkPXsKZzy/VAiEiyQtygfg3R1ZHf0HDpdu+GNIWu9Ary2qqtHUOqWECt4YrTxTnjI4 lPTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=g5XU3Y09; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=kmAgyWxk; 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 q15-20020a056402518f00b0043ad32fcc93si12107331edd.565.2022.08.16.06.59.13; Tue, 16 Aug 2022 06:59:39 -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=g5XU3Y09; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=kmAgyWxk; 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 S230416AbiHPNqe (ORCPT + 99 others); Tue, 16 Aug 2022 09:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234278AbiHPNqb (ORCPT ); Tue, 16 Aug 2022 09:46:31 -0400 Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5AFF90C5B for ; Tue, 16 Aug 2022 06:46:28 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id CF7A85803B8; Tue, 16 Aug 2022 09:46:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 16 Aug 2022 09:46:27 -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=1660657587; x=1660664787; bh=gHbL+MytjJ sZvOVGVzDN1GM9hKYjC7rxGk40WyTKaIo=; b=g5XU3Y09Fp0m6twECmjiDPgoD8 SlSF+LAfJbkef44m7fWMWdW6HV2pS8Rl6yMS4aqsH+reDeg0xYhJpkyl06HlSiGS NhkqwOPuDcU5X5mmwbKdFkJSLfL3xMUbf1VSrJij1t1lgyNtXf4d3JaAEK1djaHV 955s/W/wAZCpzb/9Dma0gBHmULtU7/xrZL49O6Sp0gQcze1wdeHTgqmhWEurWo86 CHU43FOJBFSeXSfJftsTiUJx+aHQm5s1GJSuQYoE43+LVuQnW1WzOkmmGyBSOTmm FdcDkO+sLNBuPxXgd1oHCa0Z01GatPcRdW5mlyldKfx9mnTSDbuvYIWrZYwg== 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= fm1; t=1660657587; x=1660664787; bh=gHbL+MytjJsZvOVGVzDN1GM9hKYj C7rxGk40WyTKaIo=; b=kmAgyWxk9CRWsdlOPMowrQ81I+xu32+X9sXWngkrs64D SpOvcWAlxbw4Z7Ks4uXYyMx5fSC0RmtNSYud9WV7FPvtPCdlXlRCwWUXW8mJVN1G RmUrd8KXTue9ZVbBDHQXUwylRMHzD4wm0u60mUJ+imY8cTogoOd734xD19lkT/LJ KX8tO6ikVBnZSRUERu3BcC7LJ6/Ux9czDptrE4aGzhssG7V3TWFjaeufH9waKDyN SeXuuL4AGKV2dr03uawgCjnZL6ltWaXMrMs1StJtc5ATl112Gbz+Hth1PAp4J3pl 8r+eaBxJ3JQvPIuuyo2otHLpBAhF80CIdzeSgYQiLA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehgedgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpedtleekjeeiudefvdfhieffteelhfeivdeliefgieeugffhvdelieffjeei geetjeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggt hh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Aug 2022 09:46:26 -0400 (EDT) Date: Tue, 16 Aug 2022 15:46:24 +0200 From: Maxime Ripard To: Geert Uytterhoeven Cc: Jernej Skrabec , Martin Blumenstingl , Chen-Yu Tsai , Philipp Zabel , Jerome Brunet , Samuel Holland , Thomas Zimmermann , Daniel Vetter , Emma Anholt , David Airlie , Maarten Lankhorst , Noralf =?utf-8?Q?Tr=C3=B8nnes?= , Kevin Hilman , Neil Armstrong , linux-sunxi@lists.linux.dev, Linux Kernel Mailing List , Phil Elwell , Mateusz Kwiatkowski , Linux ARM , Dave Stevenson , "open list:ARM/Amlogic Meson..." , DRI Development , Dom Cobley Subject: Re: [PATCH v1 09/35] drm/modes: Move named modes parsing to a separate function Message-ID: <20220816134624.cmb5s6i6pkdhu3qj@houat> References: <20220728-rpi-analog-tv-properties-v1-0-3d53ae722097@cerno.tech> <20220728-rpi-analog-tv-properties-v1-9-3d53ae722097@cerno.tech> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xbotrfh2f6jawwvu" 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,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 --xbotrfh2f6jawwvu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 12, 2022 at 03:27:17PM +0200, Geert Uytterhoeven wrote: > Hi Maxime, >=20 > On Fri, Jul 29, 2022 at 6:36 PM Maxime Ripard wrote: > > The current construction of the named mode parsing doesn't allow to ext= end > > it easily. Let's move it to a separate function so we can add more > > parameters and modes. > > > > Signed-off-by: Maxime Ripard >=20 > Thanks for your patch, which looks similar to my "[PATCH v2 2/5] > drm/modes: Extract drm_mode_parse_cmdline_named_mode()" > (https://lore.kernel.org/dri-devel/1371554419ae63cb54c2a377db0c1016fcf200= bb.1657788997.git.geert@linux-m68k.org > ;-) Indeed, I forgot about that one, sorry :/ I think I'd still prefer to have the check for refresh + named mode outside of the function, since I see them as an "integration" issue, not a parsing one. It's not the named mode parsing that fails, but the fact that we both have a valid refresh and a valid named mode. >=20 > > --- a/drivers/gpu/drm/drm_modes.c > > +++ b/drivers/gpu/drm/drm_modes.c > > @@ -1773,6 +1773,28 @@ static const char * const drm_named_modes_whitel= ist[] =3D { > > "PAL", > > }; > > > > +static bool drm_mode_parse_cmdline_named_mode(const char *name, > > + unsigned int name_end, > > + struct drm_cmdline_mode *= cmdline_mode) > > +{ > > + unsigned int i; > > + > > + for (i =3D 0; i < ARRAY_SIZE(drm_named_modes_whitelist); i++) { > > + int ret; > > + > > + ret =3D str_has_prefix(name, drm_named_modes_whitelist[= i]); > > + if (ret !=3D name_end) > > + continue; > > + > > + strcpy(cmdline_mode->name, drm_named_modes_whitelist[i]= ); > > + cmdline_mode->specified =3D true; > > + > > + return true; > > + } > > + > > + return false; >=20 > What's the point in returning a value, if it is never checked? > Just make this function return void? Yeah, it's something I went back and forth to between the dev, and it's an artifact. I'll drop that patch, take your version and move the refresh check to drm_mode_parse_command_line_for_connector if that's alright for you? Maxime --xbotrfh2f6jawwvu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYvufsAAKCRDj7w1vZxhR xRvYAP9DR7LzVwd0ITVjjsOrO+BQ9andM/0A4P6qCsx/ywFipQEA+bV9F+NyoFUN oNXdDnnG7g+hOqMsx28nmzB45wcO6w0= =uJzR -----END PGP SIGNATURE----- --xbotrfh2f6jawwvu--