Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3154569rwe; Mon, 29 Aug 2022 06:48:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR5VQXehR07FvufQERfKliiqQIE3to8rRv6NUbyE95YvKcbIzavLytPhm7O1JosForpXF+hN X-Received: by 2002:a17:90b:1b49:b0:1fd:dccc:91f7 with SMTP id nv9-20020a17090b1b4900b001fddccc91f7mr3564948pjb.200.1661780908682; Mon, 29 Aug 2022 06:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661780908; cv=none; d=google.com; s=arc-20160816; b=O3QCjVoA2TEUEK5znXGCHYG8/lj2HsBdq6S7iWtTqw5HGUZg2ncRL/6NLA/Uzu3f8z LV/o/L8OfmrgdjFOF9faeqRUQnUvuZubX9y9KRPPE9EpIil0rUjKtP113cvaNrFqkvmI i/Nb195cEENz54wJfKuAj2dtS1ck00B+L3DYmvWshPrgTIyaKmipP63j+AyGk8/I5Gw8 pv1qU1uOzHSSEGhA7cvYcLYBRv1T5wN7eLAxKfgkGaizayl/n9XyxU4eYlQ8FkbzKNtb NOwsLUWujNw2txaMgmhQTdTWnys1T18XiG4g421cDJCvM2YUiV6chGZ+Xy4Tqp6Kf2F4 11Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=6PNL3E05HqgK9IW/MtDEQBeUSg/jnNc6krZQZz7WWqU=; b=Tu9stJif/yaUI8ioj+fWlUNTUR1FYKbfUoAFI0DPFphjJRSNKTMgbUTagNIDPX3K+Z QK0dPT18b1k8osxv3dC6KoE9u1aeV8hIMnFoDrMyBK4d2uML7is4rHTwHBbNtw6aQ2q7 +3xd8Ea/jzXhbeGA4pSRLWJt9h3RW3rs8i8bhcFwv2htvcCUVh4x5aq1MrwFhnONN4j7 Ou7Nyz+j7UMmrPzo9eCwQP21AopreZVSztcl78YvIQfA0NSDzvuUgGRT1oJpRui7GjQh rmrKtHNjnkFW0HB0zFO2CV1Ij0sW0dIhr5yjwFsozPjAECOrgF/iH52N1gy4eMI7z2qd aqSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=SCrmkmWG; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=sbCXQbOm; 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 ca6-20020a056a00418600b005351ff87f27si2465741pfb.270.2022.08.29.06.48.17; Mon, 29 Aug 2022 06:48:28 -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=SCrmkmWG; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=sbCXQbOm; 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 S229906AbiH2NNZ (ORCPT + 99 others); Mon, 29 Aug 2022 09:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbiH2NNK (ORCPT ); Mon, 29 Aug 2022 09:13:10 -0400 Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AE7458B66 for ; Mon, 29 Aug 2022 06:12:51 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 3A4012B05FD7; Mon, 29 Aug 2022 09:12:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 29 Aug 2022 09:12:50 -0400 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=fm3; t=1661778767; x= 1661785967; bh=6PNL3E05HqgK9IW/MtDEQBeUSg/jnNc6krZQZz7WWqU=; b=S CrmkmWG+i+etfnzZ/jW3Y/UWhtS9n8Tx3Mi1wBI/2ps7AfxEAHmgC9ChWUa9RSX/ fkIfNETMt9ipYhmeM2jNWGAeVHnDQeOdpzSivQXBg1z8viUKEHihiX6qUUwi8Icx WYELVnyFExAByIdK3vMTVoCIHtOiMAjEjtRl6UfBPOHkOQe6AAHqscTYxTunEdBR y0zBUpDKvNbHYKT2yKehiJXJ6DvcdgzrqEtSoOTsNAr6C5frVJGR91FZnsKJcn8S vI/I9R4rWZGVATEVVhWykj/ThLdsDQ5tHmxZy0lbzvkvsU4Soh0ABEuQbyiWyB0I /ko2ZM9j3xfI4EqgtVbfA== 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=1661778767; x= 1661785967; bh=6PNL3E05HqgK9IW/MtDEQBeUSg/jnNc6krZQZz7WWqU=; b=s bCXQbOmwgGQejzwb7lDjTyCP4/nXAv1nQzo9pqqyVqE7JxCZe8fwO/6vxIMhmPS+ 9jXzOHoH56gSFpxXdj6b8NxHUO/m6QWvT9lZjU3TlMXNMttfWoxf+5rrHYMzClzh lRLACh7k0K3BLb/3j0m1/PQ/mKpYfnfaJY62uWUVr/r1eLe8Ww32IMHJNQ3faCf/ G4iCgS8yZ+vB3vDgppF3MWGiUaExqKhHv9UsouScEg7Z+P3fwXRKqb/aqNKtTyyq uv5JMeFR0Dn0IUHQtdJfyQK5Iy8nrdJ5EcvqJLKl+RRGbOtq4ZUkNqTewP+RnYlR V2gQYsmjbYmJz02Pi8Nsw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdekuddgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfogfesthhqredtredtjeenucfhrhhomhepofgr gihimhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtf frrghtthgvrhhnpeefiedvfefggffgffehveejieffuddtgffhjefggeetieduvdeileet lefgveegtdenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Aug 2022 09:12:46 -0400 (EDT) From: Maxime Ripard To: Maxime Ripard , 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 , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Emma Anholt , Daniel Vetter , Joonas Lahtinen Cc: Maxime Ripard , 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, Mateusz Kwiatkowski , Geert Uytterhoeven Subject: [PATCH v2 07/41] drm/connector: Only register TV mode property if present Date: Mon, 29 Aug 2022 15:11:21 +0200 Message-Id: <20220728-rpi-analog-tv-properties-v2-7-459522d653a7@cerno.tech> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220728-rpi-analog-tv-properties-v2-0-459522d653a7@cerno.tech> References: <20220728-rpi-analog-tv-properties-v2-0-459522d653a7@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.10.0-dev-65ba7 X-Developer-Signature: v=1; a=openpgp-sha256; l=1503; i=maxime@cerno.tech; h=from:subject:message-id; bh=360DckfKUI/oiBSyUvmkKcjfDELX/wp7WZq7mSLzHYY=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMk8u+R9F749fcX+URp/0+mNklts/+osLbExydeqlHnk5xCx cO2hjlIWBjEuBlkxRZYYYfMlcadmve5k45sHM4eVCWQIAxenAEzEdwfDf2eNYsvfu42bnU+zT+xnfO Q79+f8ozt6fzV8Prf4WvmC2SGMDP31u7j2GFU3anCHMd34KpJz8v3pBU7M7drctyrSzPUOsgEA X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D Content-Transfer-Encoding: quoted-printable 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 The drm_create_tv_properties() will create the TV mode property=0D unconditionally.=0D =0D However, since we'll gradually phase it out, let's register it only if we=0D have a list passed as an argument. This will make the transition easier.=0D =0D Signed-off-by: Maxime Ripard =0D Acked-by: Noralf Tr=C3=B8nnes =0D =0D diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connecto= r.c=0D index ede6025638d7..17a5913cefe3 100644=0D --- a/drivers/gpu/drm/drm_connector.c=0D +++ b/drivers/gpu/drm/drm_connector.c=0D @@ -1686,15 +1686,18 @@ int drm_mode_create_tv_properties(struct drm_device= *dev,=0D if (drm_mode_create_tv_margin_properties(dev))=0D goto nomem;=0D =0D - dev->mode_config.legacy_tv_mode_property =3D=0D - drm_property_create(dev, DRM_MODE_PROP_ENUM,=0D - "mode", num_modes);=0D - if (!dev->mode_config.legacy_tv_mode_property)=0D - goto nomem;=0D =0D - for (i =3D 0; i < num_modes; i++)=0D - drm_property_add_enum(dev->mode_config.legacy_tv_mode_property,=0D - i, modes[i]);=0D + if (num_modes) {=0D + dev->mode_config.legacy_tv_mode_property =3D=0D + drm_property_create(dev, DRM_MODE_PROP_ENUM,=0D + "mode", num_modes);=0D + if (!dev->mode_config.legacy_tv_mode_property)=0D + goto nomem;=0D +=0D + for (i =3D 0; i < num_modes; i++)=0D + drm_property_add_enum(dev->mode_config.legacy_tv_mode_property,=0D + i, modes[i]);=0D + }=0D =0D dev->mode_config.tv_brightness_property =3D=0D drm_property_create_range(dev, 0, "brightness", 0, 100);=0D =0D -- =0D b4 0.10.0-dev-65ba7=0D