Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4739701rwb; Mon, 8 Aug 2022 06:21:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR460StYBRkHwu5FIkwyc11qWdt5bsupxvRer7S6qJCZ6xOTTtaHaKg3Ue+edzJ6vOYmgOky X-Received: by 2002:a17:90a:6b45:b0:1e3:3cfa:3104 with SMTP id x5-20020a17090a6b4500b001e33cfa3104mr29466805pjl.113.1659964905005; Mon, 08 Aug 2022 06:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659964904; cv=none; d=google.com; s=arc-20160816; b=b0uGJCFsKZRzx0KvJjOOPpa9ihie4IJ3zyuf/RyslnbYOhPs9plJX6dIYZ64b41yup Tqzfc5ggxZQ/mpuXDermvUtbJwrd0DtgbYgKqX6GjxlESjN4qVxX3HOWYErg7xzYr8ef 3DRsrDvtDlM+OEim6zi8mPfnEaSaYZvH2gPgcR3ZIPD75XFBdecNcsZ4DpQNlW2VPEOD 7cMyTNl7280qYVhLfQNoDW8fkKZmieyB/+rH6WKwC1KQnjfjWeeerZco2BfobSyAybbU c55ixwfzbGPnYOeBLtZ5OSWPbSftIlbIW1OtHwoEzO93yOuQ1FP+4eb3fQQ7XSW0xHhy oPfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=G3MaW7kSYZuMclka/Q3KdMVcnRc0tc/Et8yfYULCynQ=; b=xmu7K3AgN507+LW/QTwpezi0Jinkf29SkOgcJ33luGqQJAoRBBBsjBHtxy2MoqhCWj pQVRilnUOCDIJ660GTNv31z6QDi2Kbo6YIOulAz43IOFOU4q/OxVLjSTBaTFXue1gO4B CbweizQphQiUswUucbP7EOdeWnUucpajOpyRjTHH8P4TULl8sUkhEGHxc3clhF3ny92P 5uXU75AJ1cX//cO+M0/IDDO06KUgOI+3tsp483ug2T9I4Ot9lgsm4JPSvwIHGav/EVNY 4ah8ydWFIKV5CweTgIKd6gwQyQ5gTNO9fobS/Y9BOvIXmGa7ITIz4qrASR0DczWKX4yN fN2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tronnes.org header.s=ds202112 header.b=iqw5Csu2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=tronnes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a17090270c600b0016f975e7c89si8050422plt.459.2022.08.08.06.21.28; Mon, 08 Aug 2022 06:21:44 -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=fail header.i=@tronnes.org header.s=ds202112 header.b=iqw5Csu2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=tronnes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237718AbiHHMtP (ORCPT + 99 others); Mon, 8 Aug 2022 08:49:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233836AbiHHMtO (ORCPT ); Mon, 8 Aug 2022 08:49:14 -0400 Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6571FB89 for ; Mon, 8 Aug 2022 05:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org ; s=ds202112; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=G3MaW7kSYZuMclka/Q3KdMVcnRc0tc/Et8yfYULCynQ=; b=iqw5Csu28VnoEc7vARcIhbwfqu yMk2QZCnoa7Y+Nq1c4OYg/on/3g0JXfDfDVLkVT2gtS65R3lLIJjJhdlyn2NwE6tl6/gyCfDid9h4 oIxM+W1wXM2ysGLQkxbxjtCH4eD9j2zbJs96qAMuUGEl6tM0J2RrWRu7hNGpJYGyTTfkkolsJkQCz NIFEpFgOiD9VVYG62zaxc+mn35nfaigoFiS4zh2ZrIhBTzBFyah/nnlJviuqjYXYv3SjClAAfMtAq nITFsMIMI8UCuXYMcJjdvJAfgfbH14cvX/qrbI5IYd9pj1EpH/C9qok5onYfzdunbnNb5WbCuDH2e krpv+m2w==; Received: from [2a01:799:961:d200:fd91:af1e:9da7:f964] (port=64771) by smtp.domeneshop.no with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oL2By-0006Tp-QU; Mon, 08 Aug 2022 14:49:10 +0200 Message-ID: Date: Mon, 8 Aug 2022 14:49:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1 06/35] drm/connector: Only register TV mode property if present To: Maxime Ripard , Jernej Skrabec , Martin Blumenstingl , Chen-Yu Tsai , Philipp Zabel , Jerome Brunet , Samuel Holland , Thomas Zimmermann , Daniel Vetter , Emma Anholt , David Airlie , Maarten Lankhorst , Kevin Hilman , Neil Armstrong , Maxime Ripard Cc: linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Phil Elwell , Mateusz Kwiatkowski , linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven , Dave Stevenson , linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, Dom Cobley References: <20220728-rpi-analog-tv-properties-v1-0-3d53ae722097@cerno.tech> <20220728-rpi-analog-tv-properties-v1-6-3d53ae722097@cerno.tech> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= In-Reply-To: <20220728-rpi-analog-tv-properties-v1-6-3d53ae722097@cerno.tech> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,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 Den 29.07.2022 18.34, skrev Maxime Ripard: > The drm_create_tv_properties() will create the TV mode property > unconditionally. > > However, since we'll gradually phase it out, let's register it only if we > have a list passed as an argument. This will make the transition easier. > > Signed-off-by: Maxime Ripard > I don't understand why this makes the transition easier, but if you think so: Acked-by: Noralf Trønnes > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c > index 68a4e47f85a9..d73a68764b6e 100644 > --- a/drivers/gpu/drm/drm_connector.c > +++ b/drivers/gpu/drm/drm_connector.c > @@ -1684,7 +1684,6 @@ int drm_mode_create_tv_properties(struct drm_device *dev, > struct drm_property *tv_selector; > struct drm_property *tv_subconnector; > struct drm_property *tv_norm; > - unsigned int i; > > if (dev->mode_config.tv_select_subconnector_property) > return 0; > @@ -1723,15 +1722,19 @@ int drm_mode_create_tv_properties(struct drm_device *dev, > goto nomem; > dev->mode_config.tv_norm_property = tv_norm; > > - dev->mode_config.tv_mode_property = > - drm_property_create(dev, DRM_MODE_PROP_ENUM, > - "mode", num_modes); > - if (!dev->mode_config.tv_mode_property) > - goto nomem; > + if (num_modes) { > + unsigned int i; > > - for (i = 0; i < num_modes; i++) > - drm_property_add_enum(dev->mode_config.tv_mode_property, > - i, modes[i]); > + dev->mode_config.tv_mode_property = > + drm_property_create(dev, DRM_MODE_PROP_ENUM, > + "mode", num_modes); > + if (!dev->mode_config.tv_mode_property) > + goto nomem; > + > + for (i = 0; i < num_modes; i++) > + drm_property_add_enum(dev->mode_config.tv_mode_property, > + i, modes[i]); > + } > > dev->mode_config.tv_brightness_property = > drm_property_create_range(dev, 0, "brightness", 0, 100); >