From patchwork Thu Nov 17 09:28:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13046464 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 2678DC4332F for ; Thu, 17 Nov 2022 09:37:21 +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=Q6iFQxl8BVlmTQtmaWP/kzl+z7+VTKmXACggXUCUGp8=; b=jhGrGhespPCe+T xcw/kbVnyYliK/kBZ8+hewfuMoP9wTm/VqQAW+JWAx2+GAk/9Ud1m6fKXdW3cyq52B/A8VxOTsF5t jKEd1JDuWfd22KMg7k3wzLSl+pbfztFvAJ57Knkm3AmNheeiK7OC4qt1PIeiok70MCV+dQwJNTNpM YOPXKIHsR8u77EQ/46txAVRGPJPG1n+PpZCVHFdRP/cXlkNtGI9djK46dgNo3IA/sKV9J/e2ZwBJM jUMPhV7Vqucbhj0pQATcImGLH3OTcR5JUFvBzuM4k/Zdi0jrXaySUxwcvSiiLMwKlbsJPkFgvHo3u U2b6ONnELo/cesJuSn3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovbJL-00C8zT-Jq; Thu, 17 Nov 2022 09:35:56 +0000 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovbDO-00C6Em-Io for linux-arm-kernel@lists.infradead.org; Thu, 17 Nov 2022 09:29:48 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 034172B069CB; Thu, 17 Nov 2022 04:29:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 17 Nov 2022 04:29:46 -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=1668677383; x= 1668684583; bh=MuHDE3CNOIfNo4O4bODhOYE0EIhImjC2RP9g5kZQp6U=; b=W ll5nv9xGW9HRiPBXpExG43R05eFNjBTiOiCV0elYLOt2EajtfZo33N7Z5uFre26O 7tH/rPFVKbPGWn18ayA70oFiASZufasPOIts7dvjrvkAZ9E3BVnGx9ixpVirnxIU U+IqA64no37VpkUwduAiAu20IQ06BETccRj5XRAEq1Oiok/6vgYbsrLgWfkoxgXF ZD2nKwV0mLWvxpJV7XX5HaDgIQtWz3YQcmO27PYrfqwCGHjZRNQu40w3xWY3yvr4 sK9PcTYjrLKXhxxPwsCUd6cRBvythMdR6UMHKxAtTiJk2fzYEepxnGSrGUN1L+cg G5wzSkCvZE6vQPBzn7YFA== 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=1668677383; x= 1668684583; bh=MuHDE3CNOIfNo4O4bODhOYE0EIhImjC2RP9g5kZQp6U=; b=b e1InmLbhcIBIZrXGUcoSEYMFO4kWATvGXU2d3Zm0Pkjym5rLYF/JXKy2gjH4kdqQ S+pD9b9aVjxgzJbn7RwN5locWV8+D0tRReJOXozP+pjrKZIBztyHk9u6gUZBsYfb 34gcW5d10PjsYSvrmJ1vGvFxOnKhMTYwTWcvYJYErpTjqfiY7CToSIb1GNySMGiw er8zM5UItFcWhFA2S7zEfCNSRv2WMiRldXvI4LMGQqL6F2M5dTtr8HzwN9B8HpeE ssNPDHpAjZmd8zhtQE869wJqn/tbDeJrLs0cPTfTSJLX/GnbryEeLmg7c7BEDhip gw+ZpoK67lOJ4lP5wU2bg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeekgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffuggfgtgfkfhgjvfevofesthekredtredtjeenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpedvgfevjefhtdetveevhfelieeuueetgfdvgeevkeegudejffegfffgtedt leelhfenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Nov 2022 04:29:43 -0500 (EST) From: Maxime Ripard Date: Thu, 17 Nov 2022 10:28:54 +0100 Subject: [PATCH v10 11/19] drm/modes: Introduce more named modes MIME-Version: 1.0 Message-Id: <20220728-rpi-analog-tv-properties-v10-11-256dad125326@cerno.tech> References: <20220728-rpi-analog-tv-properties-v10-0-256dad125326@cerno.tech> In-Reply-To: <20220728-rpi-analog-tv-properties-v10-0-256dad125326@cerno.tech> To: Samuel Holland , Jernej Skrabec , Maarten Lankhorst , Rodrigo Vivi , Joonas Lahtinen , Maxime Ripard , Ben Skeggs , Chen-Yu Tsai , David Airlie , Jani Nikula , Tvrtko Ursulin , Emma Anholt , Karol Herbst , Lyude Paul , Thomas Zimmermann , Daniel Vetter Cc: =?unknown-8bit?q?Dave_Stevenson_=3Cdave=2Estevenson=40raspberrypi=2Ecom?= =?unknown-8bit?q?=3E=2C_Hans_de_Goede_=3Chdegoede=40redhat=2Ecom=3E=2C_nouv?= =?unknown-8bit?q?eau=40lists=2Efreedesktop=2Eorg=2C?= =?unknown-8bit?q?_intel-gfx=40lists=2Efreedesktop=2Eorg=2C_Noralf_Tr=C3=B8nn?= =?unknown-8bit?q?es_=3Cnoralf=40tronnes=2Eorg=3E=2C_dri-devel=40lists=2Efre?= =?unknown-8bit?q?edesktop=2Eorg=2C?= =?unknown-8bit?q?_Mateusz_Kwiatkowski_=3Ckfyatek+publicgit=40gmail=2Ecom=3E?= =?unknown-8bit?q?=2C_linux-kernel=40vger=2Ekernel=2Eorg=2C_linux-arm-kernel?= =?unknown-8bit?q?=40lists=2Einfradead=2Eorg=2C?= =?unknown-8bit?q?_linux-sunxi=40lists=2Elinux=2Edev=2C_Maxime_Ripard_=3Cmaxi?= =?unknown-8bit?q?me=40cerno=2Etech=3E=2C_Dom_Cobley_=3Cdom=40raspberrypi=2E?= =?unknown-8bit?q?com=3E=2C?= =?unknown-8bit?q?_Phil_Elwell_=3Cphil=40raspberrypi=2Ecom=3E=2C_Geert_Uytter?= =?unknown-8bit?q?hoeven_=3Cgeert=40linux-m68k=2Eorg=3E?= 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=jaOBr4CmxYNe7drN+2/eXasdFgIKLEEd//OdC+esHKM=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMml/y5IOj1yLuDry85oS/ISCUwRTPdoXjx7yaPYf23rdmlN bZnVUcrCIMbFICumyBIjbL4k7tSs151sfPNg5rAygQxh4OIUgImkMzEydIRKnTpVklartllnY2lw4K uSq294fM/MsfVnn/fVYunMnwz/iw9frq0qts3VffuyMj/35uXAi9/P6jRc//bkr/DyD5/CeAE= 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-20221117_012946_676768_F5D99920 X-CRM114-Status: GOOD ( 12.32 ) 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 3d410be8db69..699c66e54668 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -2274,7 +2274,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 fe1f6be097a2..52929536a158 100644 --- a/drivers/gpu/drm/tests/drm_client_modeset_test.c +++ b/drivers/gpu/drm/tests/drm_client_modeset_test.c @@ -150,7 +150,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