From patchwork Mon Aug 29 13:11:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12957901 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 E0F4BC0502C for ; Mon, 29 Aug 2022 13:26:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9BAC010F2E8; Mon, 29 Aug 2022 13:26:02 +0000 (UTC) Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7FDE110F299; Mon, 29 Aug 2022 13:25:49 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id A60042B0605D; Mon, 29 Aug 2022 09:13:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 29 Aug 2022 09:13:51 -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=1661778828; x= 1661786028; bh=AAvXImFRqhXK3wzdRCgVDl9APZWKjeBdFuiGKB1+8lA=; b=O 3Ju7lSD9HBG2Jp2F5aPP1xNX7MinO6GQLZ1QfrCnLDMSS1OaLPtEww6liBm0C7AK 1W25pMbOBRD59a1kpko5mU92VQHgrxQn3NKxVuIUdL3vjbS/AnhQ33yp0PQS/Azp HfUI7mD2BILNiCwU4Y08fqhBmgIpxDHG57SaMG+muUzCCeab2JL0FAAwqzp6DpRO AtGZM+wAyNl02LsE7VrB446RlL95Y+Ab1KYOyGy6Y+zlrY2tBZjKZLv9nr0SeivU sxwhkaV80DT55n+8ot86G1y7T1QFeWQJe6bzM7fHnxrgH313kAXBY8jcVm0tRCYu 4GYWR2GWwuOn9oBF842Lg== 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=1661778828; x= 1661786028; bh=AAvXImFRqhXK3wzdRCgVDl9APZWKjeBdFuiGKB1+8lA=; b=r 7HiL1g/pL8NSYTqdGC8mulIobHbDSVRvB90imWhz2bioxrU71fBtvzh2iQhTOD0P fY6OuyimI2YOK6y1EeK+QB+VTylc5tM/G5tJOc2VSLHRvQJYX9gzUL8YPWh3bY2/ WtR/I6DZEHtkCKCQo/a90fKS9hh5DaO47jVEED9d7bqe9HfZeD+RWn50EkmzgnkZ 84RYzBF73EeOumdLJeVNNnQ23pX7csARnQ+HUc4qtQtD4VpGCWklnU8jTXKSwUJ6 /OMtztafTFh9AqrLgmCSfuJ2FAaLyCK8AhqcQt/ZpNz8dHQLoEKhvek1zLvtTBXg VtL+udw+acHjQqUK7ybhA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdekuddgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfogfesthhqredtredtjeenucfhrhhomhepofgr gihimhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtf frrghtthgvrhhnpeefiedvfefggffgffehveejieffuddtgffhjefggeetieduvdeileet lefgveegtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Aug 2022 09:13:47 -0400 (EDT) From: Maxime Ripard To: Maxime Ripard , Ben Skeggs , David Airlie , Chen-Yu Tsai , Thomas Zimmermann , Jani Nikula , Lyude Paul , Philipp Zabel , Maarten Lankhorst , Rodrigo Vivi , Tvrtko Ursulin , Jernej Skrabec , Samuel Holland , Karol Herbst , =?utf-8?q?Noralf_Tr=C3=B8nnes?= , Emma Anholt , Daniel Vetter , Joonas Lahtinen Date: Mon, 29 Aug 2022 15:11:30 +0200 Message-Id: <20220728-rpi-analog-tv-properties-v2-16-459522d653a7@cerno.tech> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220728-rpi-analog-tv-properties-v2-0-459522d653a7@cerno.tech> References: <20220728-rpi-analog-tv-properties-v2-0-459522d653a7@cerno.tech> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-65ba7 X-Developer-Signature: v=1; a=openpgp-sha256; l=1645; i=maxime@cerno.tech; h=from:subject:message-id; bh=cx3bZ2Z+vnsINoBvMJVTM9LZ3rHQTrc0mEfL62Vz/88=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMk8u+Rzt3OsVsjbJGv7UNrGwSXJqZuBm/2ZUZuby4QFFz5Y NU7tKGVhEONikBVTZIkRNl8Sd2rW6042vnkwc1iZQIYwcHEKwESW8jMyHI33m2VpfF5wnZj/uaSObg 7Z31KKeUJrtxS89ApY86M4gZGhQUtZ/lNcn530bpOoYvOQe/8nLJQ+8uHtTHt94Td/M3ayAgA= X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D Subject: [Intel-gfx] [PATCH v2 16/41] drm/modes: Fill drm_cmdline mode from named modes X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dom Cobley , Dave Stevenson , nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, Geert Uytterhoeven , Maxime Ripard , Mateusz Kwiatkowski , Phil Elwell , linux-arm-kernel@lists.infradead.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The current code to deal with named modes will only set the mode name, and then it's up to drivers to try to match that name to whatever mode or configuration they see fit. The plan is to remove that need and move the named mode handling out of drivers and into the core, and only rely on modes and properties. Let's start by properly filling drm_cmdline_mode from a named mode. Signed-off-by: Maxime Ripard diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 1fdfa004b139..5e898699b532 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -2208,11 +2208,22 @@ static int drm_mode_parse_cmdline_options(const char *str, struct drm_named_mode { const char *name; + unsigned int xres; + unsigned int yres; + unsigned int flags; }; +#define NAMED_MODE(_name, _x, _y, _flags) \ + { \ + .name = _name, \ + .xres = _x, \ + .yres = _y, \ + .flags = _flags, \ + } + static const struct drm_named_mode drm_named_modes[] = { - { "NTSC", }, - { "PAL", }, + NAMED_MODE("NTSC", 720, 480, DRM_MODE_FLAG_INTERLACE), + NAMED_MODE("PAL", 720, 576, DRM_MODE_FLAG_INTERLACE), }; static int drm_mode_parse_cmdline_named_mode(const char *name, @@ -2254,6 +2265,9 @@ static int drm_mode_parse_cmdline_named_mode(const char *name, continue; strcpy(cmdline_mode->name, mode->name); + cmdline_mode->xres = mode->xres; + cmdline_mode->yres = mode->yres; + cmdline_mode->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); cmdline_mode->specified = true; return 1;