Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp579334rwi; Thu, 13 Oct 2022 02:14:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Ok2egHoA+qDncMXh9T3nzupoqp3EBHUxE7PxXmQi54xmzqFvOzRTq22sxqvwTv5diPDrZ X-Received: by 2002:a05:6402:1391:b0:459:cb69:9a2b with SMTP id b17-20020a056402139100b00459cb699a2bmr30899515edv.201.1665652462037; Thu, 13 Oct 2022 02:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665652462; cv=none; d=google.com; s=arc-20160816; b=ozwMgNyEdSSJSNm+wCQ4l4k7l7NlW8aT3jBTi+CTHMW2y9xaEDd+0UUjylBqf2VkZO 3xzinq3bRhE+ZcysNk9dPLwyksp5dHFbJjEAnpyX1JXgn1P15KULmraLBCbHR/V8/Eqg L6DCec3zDeN2C2XqcP02zqs8Madt1rUAKMqFMgk9CxbCsOBOn6IOOkV8R04w3EYV0B3d rzaplPn2aqf9QJr0iOtW7SyRThkPY2jB6VSzloMHEgLS+KzW66qEM/GQAMmidWYPSdfe NCT3UuP0lgc5xZJu3kTlENOI8Qf5dXRgKlYdIYRF8JsoZLb46cw+4ntHCRXs6sbr9zIc lkJQ== 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=ysquayv/A7PcL91ZGvk9c45xdKAQrAqStjB+DbTAf4Y=; b=OLJGjjtDMaIQbt2xYR3Rs1d0vZ6gsb6UTYGn9n/WSP4PZw8Khu/DOY59jrzgvr1p3+ SpC+CRSAHUp7g9kyn7q8vTH5UYEhZUb5QTegGL1B/qQkH7//rfycRZ7+SsfbU0Vd4HZA pHFQszRwq5pjN0s89uRO3XO5a5KEguM4u7vgLWgRJ/C+ywuGpeeLewRso3YxBm52p66o Kg6evygv3MCwYIBCEBExNu3cNL6qlxmi4KMBLsnXfeKXhLUeoX+cXnEFBvONmg0emvzI DuBVgYwV2aoAsoCvMfpRs/byoBRdeSV5uxoqc1WS5HY7DUjiScpzkqV7iRQLovH+shBg 8OBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=fGvAjI49; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=UIna1zpH; 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 go11-20020a1709070d8b00b0078dea4159fdsi6053471ejc.491.2022.10.13.02.13.57; Thu, 13 Oct 2022 02:14:22 -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=fGvAjI49; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=UIna1zpH; 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 S229710AbiJMIgo (ORCPT + 99 others); Thu, 13 Oct 2022 04:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbiJMIgn (ORCPT ); Thu, 13 Oct 2022 04:36:43 -0400 Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 260D0104D32 for ; Thu, 13 Oct 2022 01:36:42 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 6EFA258035B; Thu, 13 Oct 2022 04:36:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 13 Oct 2022 04:36:41 -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=1665650201; x=1665657401; bh=ysquayv/A7 PcL91ZGvk9c45xdKAQrAqStjB+DbTAf4Y=; b=fGvAjI49FOoCVdB2M5Hcd/j++r uN93U9tVW2glfFC3Ec4uivVmTIoUp9RyKrzQj9rqlvHgmCRd7k7w6Zlt1tuABskA 4x3SkxmWIavMHV3/kZm+xfhpEHwy8/Bio04nFnSxKdrm0yErAGR6KB8Kh1QknV9g /hsVp0Dz5H6wV2W4I17ytz/klpxpmFO8+cH1fM0WhfOsjz0OA8mR5Kb3zEkefAHZ lzhcX8ym5wGpXcZ98qntF0EqOua/rZpPGqGBrtWSMJzRnXfGoiQqogs8dGIXN3KZ POWt7SZMSJK5HM8Evv5ZvRkqNIQbekuYrO4DwcYMr4in2nAKyq/JfTXedpEg== 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= fm3; t=1665650201; x=1665657401; bh=ysquayv/A7PcL91ZGvk9c45xdKAQ rAqStjB+DbTAf4Y=; b=UIna1zpHZ1vH/wEBK0RE1zIRyKk8c7mWVVtYYnm5tgxC n4RYdAVYlpupi30CudvozDGzmCYDPpPtmH9D0eWIXLCajpR7omgKafbsYcZH4YLs QdsQqYKofIf6uCaX34V6KBjRd/ezHyACFVwO6NzcdD8rb2mW+XJHwJ9Gm0fMxw6+ 402X5BgJ539CgC0DQsbLocznUiImNqOlCFkL3QQodiJ5PX+FkQapOroNBr3T64p6 o69aovrHr/bGBmokirOWWOmlqAvvDus+HBfPAtwgFCCVGmYNHEhB35+kdlOCXu/E uEAVTNdLUmbnG7m9JflUeeeLe6B3/VHckfUgBS4FBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeektddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtudenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeeljeeugfegveetleevkeetffegudevieetieeugeeugeeivddtjeejvdef feetgfenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggt hh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Oct 2022 04:36:39 -0400 (EDT) Date: Thu, 13 Oct 2022 10:36:38 +0200 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Cc: Jernej Skrabec , Chen-Yu Tsai , Karol Herbst , Samuel Holland , Lyude Paul , Jani Nikula , Daniel Vetter , Thomas Zimmermann , Emma Anholt , Joonas Lahtinen , Ben Skeggs , David Airlie , Rodrigo Vivi , Tvrtko Ursulin , Maarten Lankhorst , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Geert Uytterhoeven , intel-gfx@lists.freedesktop.org, linux-sunxi@lists.linux.dev, Hans de Goede , nouveau@lists.freedesktop.org, Mateusz Kwiatkowski , Dave Stevenson , linux-kernel@vger.kernel.org, Dom Cobley , Phil Elwell Subject: Re: [PATCH v4 11/30] drm/modes: Add a function to generate analog display modes Message-ID: <20221013083638.kloiaxervnhii7ew@houat> References: <20220728-rpi-analog-tv-properties-v4-0-60d38873f782@cerno.tech> <20220728-rpi-analog-tv-properties-v4-11-60d38873f782@cerno.tech> <0aa690b8-988a-878f-4d4f-d391295bc591@tronnes.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="l3aewuzyqmtjebmf" Content-Disposition: inline In-Reply-To: <0aa690b8-988a-878f-4d4f-d391295bc591@tronnes.org> 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 --l3aewuzyqmtjebmf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Noralf, On Sat, Oct 01, 2022 at 02:52:06PM +0200, Noralf Tr=F8nnes wrote: > Den 29.09.2022 18.31, skrev Maxime Ripard: > > Multiple drivers (meson, vc4, sun4i) define analog TV 525-lines and > > 625-lines modes in their drivers. > >=20 > > Since those modes are fairly standard, and that we'll need to use them > > in more places in the future, it makes sense to move their definition > > into the core framework. > >=20 > > However, analog display usually have fairly loose timings requirements, > > the only discrete parameters being the total number of lines and pixel > > clock frequency. Thus, we created a function that will create a display > > mode from the standard, the pixel frequency and the active area. > >=20 > > Signed-off-by: Maxime Ripard > >=20 > > --- > >=20 > > Changes in v4: > > - Reworded the line length check comment > > - Switch to HZ_PER_KHZ in tests > > - Use previous timing to fill our mode > > - Move the number of lines check earlier > > --- > > drivers/gpu/drm/drm_modes.c | 474 +++++++++++++++++++++++++= ++++++++ > > drivers/gpu/drm/tests/Makefile | 1 + > > drivers/gpu/drm/tests/drm_modes_test.c | 144 ++++++++++ > > include/drm/drm_modes.h | 17 ++ > > 4 files changed, 636 insertions(+) > >=20 >=20 > I haven't followed the discussion on this patch, but it seems rather > excessive to add over 600 lines of code (including tests) to add 2 fixed > modes. And it's very difficult to see from the code what the actual > display mode timings really are, which would be useful for other > developers down the road wanting to use them. >=20 > Why not just hardcode the modes? Yeah, I have kind of the same feeling tbh, but it was asked back on the v1 to ease the transition of old fbdev drivers, since they will need such a function: https://lore.kernel.org/dri-devel/CAMuHMdUrwzPYjA0wdR7ADj5Ov6+m03JbnY8fBYzR= YyWDuNm5=3Dg@mail.gmail.com/ Maxime --l3aewuzyqmtjebmf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY0fOFgAKCRDj7w1vZxhR xRPTAPsHbpjwggNPU38hdpfJ1NG62HfnGiMtgUpIeY78VLwdvAD+ID6+idT6/neO 8RrFdtowwtZdPyNPHMeV6f3x0uD7BgM= =iymO -----END PGP SIGNATURE----- --l3aewuzyqmtjebmf--