Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5594659rwi; Tue, 18 Oct 2022 01:03:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CciOBTC0XmOFVCkjVCBY9NeBLs5exwEUfh5Edmga149gFE/6yekiQRxDtRYNp/VnSShRW X-Received: by 2002:aa7:8895:0:b0:565:e8b7:8494 with SMTP id z21-20020aa78895000000b00565e8b78494mr2008974pfe.82.1666080209062; Tue, 18 Oct 2022 01:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666080209; cv=none; d=google.com; s=arc-20160816; b=QJxLR0cjR6XQpzs65LA00nw122UVlgj05eWi+3542wwsHiN4q0bqNKXeqSuUauw/vK lR457xmplVHE8c5txEoA1mQTjF5MCbvHxP9fxtqKei070lfGaZCXFC/uG6BxbBj8T6+1 ETPH/T6OUwDT9zpzaRnCKOqQHfsh9AzzTostD+xZKg10HsyjJCQO2Pb/CMOqLq+FFl1o udA3TrJlk0nCG7JnuNQ8pMD971UVXUEGnTQNtXkHzSxJMIFL2ZfP8NKFVIbsd5e3gHLO m+8PtL/AiHhMe12dNEbn66uM4t7k9GSvfpoC08PliA3cGcrsQ5oVb/3Awq4RIq2tIWpE Y3Bg== 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=O28Ra42je2l6WzDm/ZO6o7rlbUD0f6okc6FR7gCx5gY=; b=R7aqh0kdP61u0WeCwaAdL4Hu3Z7Q514yDABvMKBgAQlpRJU28FkTNm08mznPxn/o0W 6JqP0RjQ9oO0LdZvAS526F69I/z2LZq7daYYgulbjVy6GmRNX+M152q2mUBTUlPFP2bH oqWJji7qEiWEgYXCHsubvr8QFCaGRk2p+m3pBsU4Gpkq7tRD8XyDmh6BlvNonc7vx1UB KXGt2r1hy32+73YzYjxo+c2/U0zZpe4dWSLbjplJhYYJWbb2yGTG2OSVBP6gSSHqRRJ4 O2Ctkqo1xWkkUThuSoIKPz7MoEV4cE3OasxVYkgcZcPDPquH+Wh+2nY8unkE/0L/AESA 4l3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=cD7GfdBB; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KAziRhUb; 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 u13-20020a170903124d00b00176ab3bdffdsi16809871plh.536.2022.10.18.01.03.16; Tue, 18 Oct 2022 01:03:29 -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=cD7GfdBB; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KAziRhUb; 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 S229917AbiJRHef (ORCPT + 99 others); Tue, 18 Oct 2022 03:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiJRHe1 (ORCPT ); Tue, 18 Oct 2022 03:34:27 -0400 Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 022E32DC2 for ; Tue, 18 Oct 2022 00:34:24 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id AFA6D2B06898; Tue, 18 Oct 2022 03:34:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 18 Oct 2022 03:34:23 -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=1666078459; x= 1666085659; bh=O28Ra42je2l6WzDm/ZO6o7rlbUD0f6okc6FR7gCx5gY=; b=c D7GfdBBYv+RNoIJNHU7ZMe6/6FlTZtIgN1EVcdn7q+/E/tX8MUYD6cWK70SP+095 HIysOx6U4hzAzd9Oxr1+lfRNMsdTrBALP5TJwpaKAdsT441k54XiJefZoNwksmDX epJn3K0Zl1gXfWdEG3WyJCO0Gf4YYQgf2AUQhy43zcRtbq4ZG8vbW4fHpJJY6cl7 0Q+/7raGCos6wWg5jQEYEg7BQqlsDeJTfOy8H9hEmeU6/YEQZPzEpuEl/LaL/Vj9 qkVpo76vgbxd82LnIZMcIfpuQG5kuH7S0M4AfuBlXTCRA+4FgLH2GFv3vIhwBUIm g/6L/exJNRAJueyn9q0Kw== 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=fm3; t=1666078459; x= 1666085659; bh=O28Ra42je2l6WzDm/ZO6o7rlbUD0f6okc6FR7gCx5gY=; b=K AziRhUbnFvkdSTAUOgSQwizWhJotp/ejPbOhWNRWwnOuNmPW89LQCRyji9fSEqPD 1U1Vltxi+zQuJhVmX9ufaEWhogLUTRpo42yYA/2OigiBIqfDHRcy99ab9ABS3u1S MWPxl+1+f28ZICrHoxJAhEBL+J94+rIw7nBuIcHb7v1ooKaC4Zbinx62GNjEEy6V PxLrPZ0nYSx4mS0ZC0abfrisiOcnTxgGTGK+K0Yj2Xqn9Mat/rJmJALyGyi19B1/ 6whf2Y9wu8Z/7EdAVzlj462ybn51hI35XvXMYfbn7EOh8dHJRLKXFejvqm6ySDRi xJDOsXQ3TH3VGqeNPNL0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeltddguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtugfgjgesthhqredttddtudenucfhrhhomhepofgr gihimhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtf frrghtthgvrhhnpeejvefftdehvedvfeevffffjeektdfgkedviefgfefhfefgtefhjeej ieegieeugeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordht vggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Oct 2022 03:34:17 -0400 (EDT) Date: Tue, 18 Oct 2022 09:34:16 +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: <20221018073416.7tttm6mnbt2pdrpk@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> <20221013083638.kloiaxervnhii7ew@houat> <71e53906-ae9b-55b9-7a93-7bb04a891423@tronnes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <71e53906-ae9b-55b9-7a93-7bb04a891423@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,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, On Sat, Oct 15, 2022 at 05:04:50PM +0200, Noralf Tr=F8nnes wrote: > Den 13.10.2022 10.36, skrev Maxime Ripard: > > 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. > >>> > >>> 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. > >>> > >>> However, analog display usually have fairly loose timings requirement= s, > >>> the only discrete parameters being the total number of lines and pixel > >>> clock frequency. Thus, we created a function that will create a displ= ay > >>> mode from the standard, the pixel frequency and the active area. > >>> > >>> Signed-off-by: Maxime Ripard > >>> > >>> --- > >>> > >>> 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(+) > >>> > >> > >> 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 fix= ed > >> 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. > >> > >> Why not just hardcode the modes? > >=20 > > 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+m03JbnY8f= BYzRYyWDuNm5=3Dg@mail.gmail.com/ > >=20 >=20 > If that's the case I suggest you just hardcode them for now and leave > the complexity to the developer doing the actual conversion of the fbdev > driver. Who knows when that will happen, but that person will have your > well documented and discussed work to fall back on. I'd rather not, tbh. We've collectively spent weeks figuring this out, reviewing it and so on, I very much want to avoid doing this all over again if it's going to be useful at some point. Jani also wanted to expose a function and not a raw mode, so this patch also addresses that: https://lore.kernel.org/dri-devel/8735eeg31e.fsf@intel.com/ Maxime