Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5591707rwb; Wed, 7 Sep 2022 05:20:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR7QwJu97t0z4G/DuSuXIID9pvJnOV1FJp/fqDERrlSjhIkktncfj/e4rqogfwXdk+9roCHG X-Received: by 2002:a17:907:84a:b0:733:735:2b1a with SMTP id ww10-20020a170907084a00b0073307352b1amr2154335ejb.290.1662553216745; Wed, 07 Sep 2022 05:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662553216; cv=none; d=google.com; s=arc-20160816; b=bTmBMFb+5UHspR/bn0Ufjmid4pTCFet/I3RN7gEwKSZnxl/n3TPlgqBAfp2pcUaxQy 4qVoP/gTg2scsWRuPMfg0vj72cnh6iAy+10DNKJukSPMUsBbkKRskAU1G2KKdKLPze6N yw84qr+e4pvphxVpapM5w/2W7m7hilsOXpG3FZ3+QrbHr17ydUbdzOso3pdkj4HZYJsD EEumfglsOBCDKUzELZ5ERCbafgKzIGmmvh4N4Ogvy0WuEPBlDDMlE2sVa95bbb0qVsRV z/v1xJK/wGxZcJW3ehP2EXChqiPX0eeXi646GgfRiWL4zcHuLabjgMSnzvrT/2aybXRH eV/A== 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=mO0DxpIxEIaEUkrFxNz04g9y84A96XbiPwxWwzTH7i4=; b=JUX6PrH5LKhmtwja6LTWXTGK3l05FoxhwBf0tgjT+YKEPJFAljY/bZkN94ybIGgCaK jwfq8bgJdt5PCZcIlVrrn6ttzDpcs9h19XVfBrOTduX2cskGu5hzYcECW67TMg1aIk9w gaXzG/hY8gdQss5iZjzGj6cchaXRhbSFDo7KVMIXaHobSoav6sFOQF/jpdUC2HLou7ua ShK4Th8udxrDJ4eboEnvWzSETsN6U/NhDoMsWhAWi8dBT3XkVjvjvZiM/6aXHw1RDmT3 yrgaWg1S1DVFGWzIZ/Xl2XRjEKLNkCBG+YYftE+U7USC4amTvZf6bTcRmcDUk4s6bddl yR7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b="fom/8HSs"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="FbB8/owo"; 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 qk34-20020a1709077fa200b0072b1964e54esi12818437ejc.1007.2022.09.07.05.19.48; Wed, 07 Sep 2022 05:20:16 -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="fom/8HSs"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="FbB8/owo"; 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 S229436AbiIGMK0 (ORCPT + 99 others); Wed, 7 Sep 2022 08:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiIGMKX (ORCPT ); Wed, 7 Sep 2022 08:10:23 -0400 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA821754BD for ; Wed, 7 Sep 2022 05:10:15 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id CB3B45802A6; Wed, 7 Sep 2022 08:10:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 07 Sep 2022 08:10:14 -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=1662552614; x=1662559814; bh=mO0DxpIxEI aEUkrFxNz04g9y84A96XbiPwxWwzTH7i4=; b=fom/8HSsBSNM55Lsdc1X75CCSP PN8l87PDFyGp8TPirwp7/NKdyQyE9MOsckYzTIfsGD/eOWGZT1IjEvwX6zRlR0c8 xyd4O5AWtoc0+t62PjFtQ3RhOXb+bOnAEcfbMUfDuJAjQ6zjcXBUAvby3kG2w20b j4yfradaLCNCQ4z9shorYr//Dwuft/CPwPoHfm1ruXd0ff7C+O0fdT/9xlZ8Fyd+ LKIrBSAPvoJbYjAYVRV4xsznzw5wgSElrFDRTMXlahcPKe4Y7zn2SQlqk2E5IL40 z9dpaDBbJUAmczQMZsMKwA3iTktpgYhzh2IM5IlJ4gdMKNv+HNHxTqw5tVvw== 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= fm2; t=1662552614; x=1662559814; bh=mO0DxpIxEIaEUkrFxNz04g9y84A9 6XbiPwxWwzTH7i4=; b=FbB8/owoOO+ZLDH3EfniBXdqyJiFnJp0Jors+WaT5pLQ 82yMu72iyNa3D+sLEkaOfuaQPmMu4qBDEhaw1y1E2VPqQsh39Vmnp2mu+yG65exK 9XCM6Ux2cTtPelDoWnm1jZ1K4lzccmE2LL/qG3GEJPQqpHeu4UVuOiGf65nzurBx OqflA4TM4RlvQWplqnrEGlVYw2fqBkDA5EBlljW+t7sG6IOihkY/kmK8wdQS67Sx J8GsmdY3H98n5BVGhwvoOrB+W0CZFuKn6e5bMYUTQKobszQuLNN7oh3oDwv8gUEz kJIqZqo7NoK9rL6MFL+hUomoXuhay/dgEfYX5A+HQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedttddggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtudenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeejveefheefkeeiffegveelveetgffffeektdefuefhtedtgeejhefggedu ffffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Sep 2022 08:10:11 -0400 (EDT) Date: Wed, 7 Sep 2022 14:10:09 +0200 From: Maxime Ripard To: Mateusz Kwiatkowski Cc: Ben Skeggs , David Airlie , Chen-Yu Tsai , Thomas Zimmermann , Jani Nikula , Lyude Paul , Philipp Zabel , Maarten Lankhorst , Rodrigo Vivi , Tvrtko Ursulin , Jernej Skrabec , Samuel Holland , Karol Herbst , Noralf =?utf-8?Q?Tr=C3=B8nnes?= , Emma Anholt , Daniel Vetter , Joonas Lahtinen , Hans de Goede , linux-arm-kernel@lists.infradead.org, Phil Elwell , intel-gfx@lists.freedesktop.org, Dave Stevenson , dri-devel@lists.freedesktop.org, Dom Cobley , linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, linux-sunxi@lists.linux.dev, Geert Uytterhoeven Subject: Re: [PATCH v2 09/41] drm/connector: Add TV standard property Message-ID: <20220907121009.toizfolruuazcrns@houat> References: <20220728-rpi-analog-tv-properties-v2-0-459522d653a7@cerno.tech> <20220728-rpi-analog-tv-properties-v2-9-459522d653a7@cerno.tech> <30a9d7cd-d9ff-3177-ac6c-e7c1f966d89a@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="nqpndwa6reldojsu" Content-Disposition: inline In-Reply-To: <30a9d7cd-d9ff-3177-ac6c-e7c1f966d89a@gmail.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_TEMPERROR 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 --nqpndwa6reldojsu Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Sep 02, 2022 at 12:00:33AM +0200, Mateusz Kwiatkowski wrote: > W dniu 29.08.2022 o 15:11, Maxime Ripard pisze: > > The TV mode property has been around for a while now to select and get = the > > current TV mode output on an analog TV connector. > > > > Despite that property name being generic, its content isn't and has been > > driver-specific which makes it hard to build any generic behaviour on t= op > > of it, both in kernel and user-space. > > > > Let's create a new bitmask tv norm property, that can contain any of the > > analog TV standards currently supported by kernel drivers. Each driver = can > > then pass in a bitmask of the modes it supports. >=20 > This is not a bitmask property anymore, you've just changed it to an enum. > The commit message is now misleading. >=20 > > +static const struct drm_prop_enum_list drm_tv_mode_enum_list[] =3D { > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_NTSC_443, "NTSC-443" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_NTSC_J, "NTSC-J" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_NTSC_M, "NTSC-M" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_60, "PAL-60" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_B, "PAL-B" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_D, "PAL-D" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_G, "PAL-G" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_H, "PAL-H" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_I, "PAL-I" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_M, "PAL-M" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_N, "PAL-N" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_PAL_NC, "PAL-Nc" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_SECAM_60, "SECAM-60" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_SECAM_B, "SECAM-B" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_SECAM_D, "SECAM-D" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_SECAM_G, "SECAM-G" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_SECAM_K, "SECAM-K" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_SECAM_K1, "SECAM-K1" }, > > +=A0=A0 =A0{ DRM_MODE_TV_MODE_SECAM_L, "SECAM-L" }, > > +}; >=20 > I did not comment on it the last time, but this list looks a little bit r= andom. >=20 > Compared to the standards defined by V4L2, you also define SECAM-60 (a go= od > thing to define, because why not), but don't define PAL-B1, PAL-D1, PAL-K, > SECAM-H, SECAM-LC (whatever that is - probably just another name for SECA= M-L, > see my comment about PAL-Nc below), or NTSC-M-KR (a Korean variant of NTS= C). >=20 > Like I mentioned previously, I'm personally not a fan of including all th= ose > CCIR/ITU system variants, as they don't mean any difference to the output= unless > there is an RF modulator involved. But I get it that they have already be= en used > and regressing probably wouldn't be a very good idea. But in that case ke= eping > it consistent with the set of values used by V4L2 would be wise, I think. Ack. What would be the list of standards we'd absolutely need? NSTC-M, NTSC-J, PAL-60, PAL-B, PAL-M, SECAM-60 and SECAM-B? > > +/** > > + * drm_mode_create_tv_properties - create TV specific connector proper= ties > > + * @dev: DRM device > > + * @supported_tv_modes: Bitmask of TV modes supported (See DRM_MODE_TV= _MODE_*) > > + > > + * Called by a driver's TV initialization routine, this function creat= es > > + * the TV specific connector properties for a given device.=A0 Caller = is > > + * responsible for allocating a list of format names and passing them = to > > + * this routine. > > + * > > + * Returns: > > + * 0 on success or a negative error code on failure. > > + */ > > +int drm_mode_create_tv_properties(struct drm_device *dev, > > +=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 unsigned int supported_tv_= modes) >=20 > supported_tv_modes is supposed to be a bitmask of BIT(DRM_MODE_TV_MODE_*) > (or (1< is not said explicitly anywhere in this doc comment. The argument doc mentions that it's a "Bitmask of TV modes supported (See DRM_MODE_TV_MODE_*)", how would you improve it? Thanks! Maxime --nqpndwa6reldojsu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYxiKIQAKCRDj7w1vZxhR xQFFAQDXwgKR9pMVMn84nPWIY7c88Fvo8DwU/8cFYEx48+uZKwEAjifIFr4Dz1pH ltskjsJPqZk1PnFrApehWE8PzkjhpAc= =FzGO -----END PGP SIGNATURE----- --nqpndwa6reldojsu--