From patchwork Mon Nov 14 13:00:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13042379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52DA7C433FE for ; Mon, 14 Nov 2022 13:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fdB0n1hvdzOGbGDn91CpgKvWUUmahuxiIwpaSSb6+VQ=; b=tvSLvCW+8DT2la GKcqw18Fx6FrNx0Hwc539QIyvZEQ8YUgAoNJpvr1WQoBUxvYf1DLFdPkAhJtK0B22G/paWw/O533D RFsBvo+KM2mzdz2vyuF1WDTDhhNIn66WVVmxGa1v3Xk0K7HEihV3RKj5Sts79zcD2y4eyuZx0RsCo B1j5/CKM1BKet0QdP+Y874uksPSZpq9FI8a0v8BtBE5Ek926eDi0q/kKNd/m+BxegZLlGiaDo8XJN KDvp301XtIf2SqWA/nDmbGNpMsAoJvsNwbs1gPNK87rc2X3EIA7PTdWbeL61HQuvfXqHWAic/nzdW SVgreN+RaAdcDkuipY2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouZIJ-0017p6-Ue; Mon, 14 Nov 2022 13:14:37 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouZ5N-0010nn-AB for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 13:01:15 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id A4C56580258; Mon, 14 Nov 2022 08:01:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 14 Nov 2022 08:01:12 -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=1668430872; x= 1668438072; bh=GR8yd3xkp3m5q5171NoosfT+Q8zFyHZNiQ3LsD+pUAI=; b=e vfeTfdx3VbsWridfxOAut2CxYhXTDDqAz+SBNWqLWoIFByDRjcDsw6pP2gVYkVBX 1ba8VrkByVCW04MUlMngyZYwNEoKKuwvcVS9/cPpyT5aIxNbz7chD71JJTac/2kb fQAe8GNdFX/PJAuB9B/Y7VIB2sxiZwALkWIBisYYoCoP9jx9RhQX5yZfnxJAapEb e1h6oNvqSzdDHWGOfTxXeK7u/Dv86u8bj8FH2GgMvnHeCngRtUSqtBF/vs0rG92k 4vnhkXuwmmEqW8PMw/nuzTvWViwvvIIEmAbfACSq+CkF11wM6x/3TIAM/HiUK11m JQakidVSz7aBE+6687ODQ== 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=1668430872; x= 1668438072; bh=GR8yd3xkp3m5q5171NoosfT+Q8zFyHZNiQ3LsD+pUAI=; b=L GltnB2tHtM5E1HOCi6AuEVFF+VXwQN3h3gWi3ZoJd+r6IptZzG9ocUYl9icQOH8I JMDuEoCHqfZcOgFQG7ilqG/Io+ocfQCGVznTVeBMxS/ZTxRiP5csSHwEtfh7YlEC 2WTwzl0u6hRgfDHo7hS60gT+90vS+oOQTgvXHFlxTcCFyI4/yxE13EPGo8hQEDSv X4VPF8/raIdjFMP7nev8RpzDBb5YtGDhpJJnlKvEeFq62H+s8ehmb3lDOW95wqI6 wy0e+x+HvHUqBXV/PK8QFrtibAYqN1sQ+GzAB99lsnPT0y0OQ+d6F+op2vSTRMzM +yuhrSpL0MZe84eSSNfCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedvgddvtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffuggfgtgfkfhgjvfevofesthekredtredtjeenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpedvgfevjefhtdetveevhfelieeuueetgfdvgeevkeegudejffegfffgtedt leelhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Nov 2022 08:01:11 -0500 (EST) From: Maxime Ripard Date: Mon, 14 Nov 2022 14:00:36 +0100 Subject: [PATCH v9 17/25] drm/modes: Introduce more named modes MIME-Version: 1.0 Message-Id: <20220728-rpi-analog-tv-properties-v9-17-24b168e5bcd5@cerno.tech> References: <20220728-rpi-analog-tv-properties-v9-0-24b168e5bcd5@cerno.tech> In-Reply-To: <20220728-rpi-analog-tv-properties-v9-0-24b168e5bcd5@cerno.tech> To: Maxime Ripard , Karol Herbst , Samuel Holland , Joonas Lahtinen , Daniel Vetter , Chen-Yu Tsai , Maarten Lankhorst , Lyude Paul , Thomas Zimmermann , Emma Anholt , Jani Nikula , Rodrigo Vivi , Ben Skeggs , Tvrtko Ursulin , David Airlie , Jernej Skrabec Cc: =?unknown-8bit?q?Dom_Cobley_=3Cdom=40raspberrypi=2Ecom=3E=2C_Phil_Elwell?= =?unknown-8bit?q?_=3Cphil=40raspberrypi=2Ecom=3E=2C?= =?unknown-8bit?q?_Mateusz_Kwiatkowski_=3Ckfyatek+publicgit=40gmail=2Ecom=3E?= =?unknown-8bit?q?=2C_nouveau=40lists=2Efreedesktop=2Eorg=2C?= =?unknown-8bit?q?_Dave_Stevenson_=3Cdave=2Estevenson=40raspberrypi=2Ecom=3E?= =?unknown-8bit?q?=2C_Hans_de_Goede_=3Chdegoede=40redhat=2Ecom=3E=2C_intel-g?= =?unknown-8bit?q?fx=40lists=2Efreedesktop=2Eorg=2C?= =?unknown-8bit?q?_dri-devel=40lists=2Efreedesktop=2Eorg=2C_linux-kernel=40vg?= =?unknown-8bit?q?er=2Ekernel=2Eorg=2C_linux-arm-kernel=40lists=2Einfradead?= =?unknown-8bit?q?=2Eorg=2C?= =?unknown-8bit?q?_Noralf_Tr=C3=B8nnes_=3Cnoralf=40tronnes=2Eorg=3E=2C_Geert_?= =?unknown-8bit?q?Uytterhoeven_=3Cgeert=40linux-m68k=2Eorg=3E=2C_Maxime_Ripa?= =?unknown-8bit?q?rd_=3Cmaxime=40cerno=2Etech=3E=2C?= =?unknown-8bit?q?_linux-sunxi=40lists=2Elinux=2Edev?= X-Mailer: b4 0.11.0-dev-99e3a X-Developer-Signature: v=1; a=openpgp-sha256; l=2971; i=maxime@cerno.tech; h=from:subject:message-id; bh=OCASaZ5ypeWqDlW0Op+nk7Cu54z43oCV4OVNt9wlZv4=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMlF1m9OHF1gFKNTG7/map5uYenzWd8ktCfOfPXw5mLZxdMd 1h791lHKwiDGxSArpsgSI2y+JO7UrNedbHzzYOawMoEMYeDiFICJFP9mZJiys7P3WGk6d+KXXIYjDz c818lrNTtZ4iW/UiLuu56Wwg1Ghit/alOrvDncsyyV/3zWbRV77rj04KeuIxIV91sZlCaf5AUA X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_050113_481717_674FA788 X-CRM114-Status: GOOD ( 12.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that we can easily extend the named modes list, let's add a few more analog TV modes that were used in the wild, and some unit tests to make sure it works as intended. Reviewed-by: Noralf Trønnes Tested-by: Mateusz Kwiatkowski Signed-off-by: Maxime Ripard --- Changes in v9: - Document the new supported names Changes in v6: - Renamed the tests to follow DRM test naming convention Changes in v5: - Switched to KUNIT_ASSERT_NOT_NULL --- Documentation/fb/modedb.rst | 3 +++ drivers/gpu/drm/drm_modes.c | 2 ++ drivers/gpu/drm/tests/drm_client_modeset_test.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/Documentation/fb/modedb.rst b/Documentation/fb/modedb.rst index bebfe61caa77..bb2889c6ea27 100644 --- a/Documentation/fb/modedb.rst +++ b/Documentation/fb/modedb.rst @@ -29,7 +29,10 @@ Things between square brackets are optional. Valid names are:: - NSTC: 480i output, with the CCIR System-M TV mode and NTSC color encoding + - NTSC-J: 480i output, with the CCIR System-M TV mode, the NTSC color + encoding, and a black level equal to the blanking level. - PAL: 576i output, with the CCIR System-B TV mode and PAL color encoding + - PAL-M: 480i output, with the CCIR System-M TV mode and PAL color encoding If 'M' is specified in the mode_option argument (after and before and , if specified) the timings will be calculated using diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index d3f0a3559812..855569a269b8 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -2272,7 +2272,9 @@ struct drm_named_mode { static const struct drm_named_mode drm_named_modes[] = { NAMED_MODE("NTSC", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_NTSC), + NAMED_MODE("NTSC-J", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_NTSC_J), NAMED_MODE("PAL", 13500, 720, 576, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_PAL), + NAMED_MODE("PAL-M", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_PAL_M), }; static int drm_mode_parse_cmdline_named_mode(const char *name, diff --git a/drivers/gpu/drm/tests/drm_client_modeset_test.c b/drivers/gpu/drm/tests/drm_client_modeset_test.c index 497434cc56cd..f2e18392a953 100644 --- a/drivers/gpu/drm/tests/drm_client_modeset_test.c +++ b/drivers/gpu/drm/tests/drm_client_modeset_test.c @@ -151,7 +151,9 @@ static void drm_test_pick_cmdline_named(struct kunit *test) static const struct drm_connector_pick_cmdline_mode_test drm_connector_pick_cmdline_mode_tests[] = { TEST_CMDLINE("NTSC", drm_mode_analog_ntsc_480i), + TEST_CMDLINE("NTSC-J", drm_mode_analog_ntsc_480i), TEST_CMDLINE("PAL", drm_mode_analog_pal_576i), + TEST_CMDLINE("PAL-M", drm_mode_analog_ntsc_480i), }; static void