Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp791716rwb; Wed, 9 Nov 2022 08:39:20 -0800 (PST) X-Google-Smtp-Source: AMsMyM4bmWyMY8GjSdWVaX19BWVkWX+1pEMpP7r7Vt1fEuNBu7iaXesQFpaB6gz3KZc9AypXtFpw X-Received: by 2002:a63:ce54:0:b0:46a:e2a9:c7f6 with SMTP id r20-20020a63ce54000000b0046ae2a9c7f6mr51677893pgi.264.1668011960291; Wed, 09 Nov 2022 08:39:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668011960; cv=none; d=google.com; s=arc-20160816; b=B1J4eXSWlrzetQmn8jquomJo28XEnVYdztvCmAh2VwIlGO6Xs3yuPUWa7sesRBCAH0 H1OJNG9Uqk/h+uX/MrfGUUKvfY38oYDjwUVQpvNBdR6+aHD/gHwQbhlIDyAzr4ad1hkf DUdUaBankKkdb4JdG02SIugoNyjAvibnyl9xUiHOhoY3psAMgOi2ni0lhS+8WwoEsNfS +wg+Wv1rgx1kD0SYxTOqoRIKY40wu90h9xEFO1r8EpQoiU2OaaS9cCnPJ7xHSaMdAvdG xPnRmE4klDLrTYAvE6aYcgFCRo5vclhNpeT9iAs3ufd1G1fT39ZNE+u6G9McfvIDXg1C pQRw== 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=RCyshHC41nd39fvXLSqmZArQb870AHZw66GwFRxnroM=; b=wHHD+SaaSH1zGTQ6r+RxB1nmQvOrshElQtY1qBgxk7gBcrB5IjdOQpG3Nmx5M+QG9u HwaCZvFbwVLREAzlyeb5YtcdLDgYfSjK3n9zwqeuZasA2KH1dlQ6L4ML/ECBiDrO/cfU VhJt6BwE5IfEiam1fR4RCUfU7gmWVij5AApaIq0Xc3UDTpdqWe8tnkDKKI0c1iM+sW+/ NyxduvP7DL2urf+KmzMjNLQaC5vNW3RcxqswsC+BG5uoIgEp5UCy/DVDFlKV/mxqmnsv ujP7EFyXT1gKnjF0104HXO2PcGs57of5LCYs6UK5YObJ/x+GnAO+nmZ83n8J7uM9FFT6 oI9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=m6M99+0E; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="Q1/HqsQB"; 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 my12-20020a17090b4c8c00b00212e2e1b626si1999544pjb.164.2022.11.09.08.39.07; Wed, 09 Nov 2022 08:39:20 -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=m6M99+0E; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="Q1/HqsQB"; 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 S230261AbiKIPlq (ORCPT + 93 others); Wed, 9 Nov 2022 10:41:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiKIPlp (ORCPT ); Wed, 9 Nov 2022 10:41:45 -0500 Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0794AB76 for ; Wed, 9 Nov 2022 07:41:43 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id D93F02B05EA7; Wed, 9 Nov 2022 10:41:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 09 Nov 2022 10:41:41 -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=1668008497; x= 1668015697; bh=RCyshHC41nd39fvXLSqmZArQb870AHZw66GwFRxnroM=; b=m 6M99+0EF+2lM4FWiKahRXCTJ/2TRlz60OSCpfjLh0dwLmJt8UZlGysvW6zVlL2pp Lr+WltoyoR+IUFtxULmpx9V4PwWXUoTK4lT0XrTSj5OvW/EuKUSq5OP7fCPSv/hS wMLhIZFZK8xtnKAD9HRpKE6bFT9+wsAEN69ffr7dSfS1rpaxm7Hu+1woa3Z/o8NN 3pMECxBqnO7uCjXhTY1CIEOjl5zs2PPTo+UtduJ3Rp8RuU/G2ycnUdEQw76dETW2 RAZTS2OHN2xECUNb6NdkAEGXy0l0HrmS51YjeCqALxmBWtJmoeNmXqsRuIUWSADN tB1lVQ/av/uRi0fIEh3kw== 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=1668008497; x= 1668015697; bh=RCyshHC41nd39fvXLSqmZArQb870AHZw66GwFRxnroM=; b=Q 1/HqsQB3psOc+96b6isRXoX5C5ybTom2C7vyqoPLqp6JQbF0UAVFZTxbWo+gL3Z7 y51qQFpEdFsWqcGqsfn/LvJJEjy0xXvTlIm+jkDjJL7W2PUy0KZtNHaHgAbKSzIo EXABW/A3a68xWi6D9zvPbEuQNITYea4uEAs14se9B4WgqQk7704vEkRSEj1hITqn SuwL1/x4lWuzJktnqdj0yaghQoItbO/N1nJd5FeM4RK1VJ6E2U1ERYVRZjBPJq/o oZgqdBUCMtxCDJJqCd3vUbP8Pj6gYNwNSIoi5BMIwLk53Qg+nZqzgdElZRJPx9/p hSuGxkmOWcv95FeDiejzA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfedvgdejlecutefuodetggdotefrodftvf 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 10:41:35 -0500 (EST) Date: Wed, 9 Nov 2022 16:41:33 +0100 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Cc: 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 , Mateusz Kwiatkowski , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org Subject: Re: [PATCH v7 16/23] drm/probe-helper: Provide a TV get_modes helper Message-ID: <20221109154133.koqhn6upwz6jd2oe@houat> References: <20220728-rpi-analog-tv-properties-v7-0-7072a478c6b3@cerno.tech> <20220728-rpi-analog-tv-properties-v7-16-7072a478c6b3@cerno.tech> 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 Hi Noralf, On Mon, Nov 07, 2022 at 07:11:27PM +0100, Noralf Tr=F8nnes wrote: >=20 >=20 > Den 07.11.2022 15.16, skrev Maxime Ripard: > > From: Noralf Tr=F8nnes > >=20 > > Most of the TV connectors will need a similar get_modes implementation > > that will, depending on the drivers' capabilities, register the 480i and > > 576i modes. > >=20 > > That implementation will also need to set the preferred flag and order > > the modes based on the driver and users preferrence. > >=20 > > This is especially important to guarantee that a userspace stack such as > > Xorg can start and pick up the preferred mode while maintaining a > > working output. > >=20 > > Signed-off-by: Noralf Tr=F8nnes > > Signed-off-by: Maxime Ripard > >=20 > > --- > > Changes in v7: > > - Used Noralf's implementation > >=20 > > Changes in v6: > > - New patch > > --- > > drivers/gpu/drm/drm_probe_helper.c | 97 ++++++++++++++++++++++++++++++= ++++++++ > > include/drm/drm_probe_helper.h | 1 + > > 2 files changed, 98 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_p= robe_helper.c > > index 2fc21df709bc..edb2e4c4530a 100644 > > --- a/drivers/gpu/drm/drm_probe_helper.c > > +++ b/drivers/gpu/drm/drm_probe_helper.c > > @@ -1147,3 +1147,100 @@ int drm_connector_helper_get_modes(struct drm_c= onnector *connector) > > return count; > > } > > EXPORT_SYMBOL(drm_connector_helper_get_modes); > > + > > +static bool tv_mode_supported(struct drm_connector *connector, > > + enum drm_connector_tv_mode mode) > > +{ > > + struct drm_device *dev =3D connector->dev; > > + struct drm_property *property =3D dev->mode_config.tv_mode_property; > > + > > + unsigned int i; > > + > > + for (i =3D 0; i < property->num_values; i++) > > + if (property->values[i] =3D=3D mode) > > + return true; > > + > > + return false; > > +} >=20 > This function is not used in the new implementation. > > I hope you have tested this patch since I didn't even compile test my > implementation (probably should have said so...) You nailed it ;) I had tested it (but missed the warning), and added unit tests to make sure it was behaving properly, and it did. I'll send the unit tests in my next version. Thanks Maxime