Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2120841rwi; Sat, 15 Oct 2022 08:14:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6OaWkVJLRfWSfmbbQz1VtkUiNgwsp7XWkL6uudpmB/Fhv25bjLasS95qqig5f3Pz8BdQR7 X-Received: by 2002:a17:907:724a:b0:78d:b3bb:9ca7 with SMTP id ds10-20020a170907724a00b0078db3bb9ca7mr2356830ejc.86.1665846887073; Sat, 15 Oct 2022 08:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846887; cv=none; d=google.com; s=arc-20160816; b=omqdWYeq1p01a8rZPgN76YPeeP+F7N04Ys5iW+QwhlPTjaZ9WiXkMbcQnuZ18s+Wal HvMjA+W+xcTxz4wub+BiCGzbjFYQf3QKMmc7wnSmfpCy3LvJ5Fdgjck27E7fce16mZLA TwL1ytE076YvwcRdrF5SCkh3vyUwl2mU91EePLZu6lm8wvFoyf8psZ1gpOhgsYm6p4ya KvStQ1Yluw+FB1d97g2JY0bX8kKxmJBneihI71xCGz1XIEs9gcHI3baTX1+e91orwfwy 5nObFawrwgD11QS6tw38j+iyjDngdFpMFXw89ZsVYi+lczMxfFQwwguKQ3x8ZsJ/wSCq M2aQ== 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=P7pRTxq7KYO3k44s3qhhCAVY4oTb2mw2IirE3FSx1ng=; b=Pw/8AYZsDcUb0CWpfsqAR1jF7fYp84WCcNypI9mDDvAqAC+blz8WFgHyzEbaTyuiXI QFlZrpElhHcGypd8XJ5PNJk+pQli9/w5bvIEwpIWD72tdGGeqXOVVFELmWpf9tY8w3VV kKH55CV86vgW9SRx59I3DWA99MzZE5IVP5AklO/zWW4DDHVyuMVVron8DrBA5+848661 YHkQ+4Ue6YNowAB3SRDCkTquX0VQbngY+QzKALXNJP3babTWKetT29EDLO06fLY5xukW hoF3ttzpuRyCvCUPQ/cYDpNtwPicX8cyu6YS69PD2uT3mPEw+Lg80ykVSDhc4MOmX4L+ 4QrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tronnes.org header.s=ds202112 header.b=GxgJFEJB; 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 hb41-20020a170907162900b0078e1d1d5fffsi5478640ejc.753.2022.10.15.08.14.21; Sat, 15 Oct 2022 08:14:47 -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=GxgJFEJB; 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 S229711AbiJOPFH (ORCPT + 99 others); Sat, 15 Oct 2022 11:05:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbiJOPFF (ORCPT ); Sat, 15 Oct 2022 11:05:05 -0400 Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 279363846D for ; Sat, 15 Oct 2022 08:05:03 -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=P7pRTxq7KYO3k44s3qhhCAVY4oTb2mw2IirE3FSx1ng=; b=GxgJFEJBFZcqMt7jvrGYCAAGvx DhywpEK9lBqlpQmTL4JiLK3wR0cIB5uIM7Vt45U6b7uvvqRM17u4wpNFNJ+6HWbBXQB2B8bPvXXcc SF6kMCb+eFJkntalEPfxQRkTmvEAT5YSt+VnrxWIv835yQ0c5WBfTxfdeZW3tPWyZRRGZJQj7T8m0 Nwjnxm9d/Kec3pBZRybCzuqaSZT7YWXxBDldAQ0+bMLTxvqNh/nPKfl9IKbpdXGAnTgVbO6w4Iei4 xE654Ew2Owk/VskBBICvPXnHWLrbN62n6D61UnEqU0XnG0aVsZ7niE1H3xvX8rAikZ5owhybXqkb3 8dPL05TQ==; Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:64825 helo=[192.168.10.61]) by smtp.domeneshop.no with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojiih-0008O3-ML; Sat, 15 Oct 2022 17:04:59 +0200 Message-ID: <71e53906-ae9b-55b9-7a93-7bb04a891423@tronnes.org> Date: Sat, 15 Oct 2022 17:04:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v4 11/30] drm/modes: Add a function to generate analog display modes To: Maxime Ripard 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 , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= 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> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= In-Reply-To: <20221013083638.kloiaxervnhii7ew@houat> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.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 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 13.10.2022 10.36, skrev Maxime Ripard: > Hi Noralf, > > On Sat, Oct 01, 2022 at 02:52:06PM +0200, Noralf Trønnes 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 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. >>> >>> 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 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. >> >> 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+m03JbnY8fBYzRYyWDuNm5=g@mail.gmail.com/ > 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. Noralf.