Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp397074imn; Fri, 29 Jul 2022 10:09:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uFtEF7Dfgezj8+y6KHN1ujnJLEaoqY0JxIPABBDJUp+pHYXJjU9lo4KMMPH13V5Virioe+ X-Received: by 2002:a05:6402:1d48:b0:43c:13fc:d01 with SMTP id dz8-20020a0564021d4800b0043c13fc0d01mr4546571edb.207.1659114593503; Fri, 29 Jul 2022 10:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659114593; cv=none; d=google.com; s=arc-20160816; b=FeouvFF/HwikovRBqC55z3Uf9nmKz9U6nZSa6wq38vrQnR/z+wYVCqzNdIKp2hlmwx hUMuwqEaJnfvP443ENfSsitjydW/vtlt5ViM+ugmVoKwjQTat7QKUOdfKBA65l9lXsBY C9U+YHp+T9//qC102BoCIZ1F3NjYmE+QtBTB60Zl/5FpABTMp0liLe596hAZjJyF7VU3 hR0hDnJ7l4UDK+1Kg/0rtg4VVmO2u11zBkWAcd2g+W/n2AryNu19Zmyg0uw5uYIvrucS bAOB388jBAIRawqU6UvDdXcKYBd2RiKX51BJW0ghiWo+ZFskuuxexdLFvx9Va9B1ruXj ZSVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=xVYLKG9KFFYmuOaTAKRLm+p8P7z09nrupInjkJzNlvg=; b=rQwtB6sP/UZPKfXqUYNpzTy88am2UuPVlVJKot6Dfv7V0pBPU4s/g5LiSpFg/LWyTq 6JicpVDLi5+pbjYGyCDmJzajHZAWPA0Dbg2y3dUbg515ZB0lbbNywCJi9SgMOEjqT4u/ 78PqjhWMkCSgDXYkbcsQZHhMq2Dq7MO7reJ6tdGe8VDefEcaXPI35im1ZcHd/dDNAmY8 xy0zY0llSSaosPM49b0Sgj+IDiLcVhV9a6EP9U86REZiZwA9XlITNHN5O21X9VpgisH7 wY1ydqOgg8S1Q697K6SWZVENh3I8UC57+TIRAEA48p+luir0u/WS0Q2u9nNc45Teu9D5 2CvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=peGkvPp9; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=1D201QYH; 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 l19-20020a170906795300b0072edee8a633si4306833ejo.187.2022.07.29.10.09.28; Fri, 29 Jul 2022 10:09:53 -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=fm2 header.b=peGkvPp9; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=1D201QYH; 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 S238269AbiG2Qqr (ORCPT + 99 others); Fri, 29 Jul 2022 12:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238152AbiG2Qpu (ORCPT ); Fri, 29 Jul 2022 12:45:50 -0400 Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5677888F37 for ; Fri, 29 Jul 2022 09:45:49 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 6BA35580942; Fri, 29 Jul 2022 12:36:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 29 Jul 2022 12:36:06 -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=fm2; t=1659112566; x= 1659119766; bh=xVYLKG9KFFYmuOaTAKRLm+p8P7z09nrupInjkJzNlvg=; b=p eGkvPp9VkszCbBMSvqhe2K521WOU5cEUHToD9XxGzIfDWbJJPr+H6dqaUzk9G1cD b+08PM7zxoIsqqCRGLR/+8JyZo7zz6gfIC9xafnA8b43D8b0P676C9/mvdSWwUhs aLkF29Fx77MbrU9rlTgCTmKH+1P7yKWYEnn9KVOxM+uGkY2IoDonvMIwEBaP5PDS 81X3ki1IHhB5/j4yJNDCZkFI1SAiPHDGlhgCy04HWUYpPZI0Dtd/ebYaVH68rnI0 BPRidxXjFSG8Wr3nj1KBE0j8xzoZ1M/y1EXVAyomt6GrZbNd1edgUKsoibSys3Js /tFDmLl6UiTlh5ad5u01g== 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=1659112566; x= 1659119766; bh=xVYLKG9KFFYmuOaTAKRLm+p8P7z09nrupInjkJzNlvg=; b=1 D201QYH+jhj5T7xGEgRqCS2cA0hqz3QnILFtJywMR6tcMSnaMUNqJVTnSMxZqoym 76NEZOpWqd1ED/RqqPj/570LsmIdurCy5MfUNPPVPscoUNQyKJv9hdsekYMOd7Oo EWTMyenmGaPtXNCn7zp4WbNAWijODYgqbyiDOtquvbEkMdrH3thr8Zd7ltQFBo/k mKMrTy6nP/ZRA38kysqG8lX2ujjF5UDO1idAZOlO5SWTjcY4E4EyMGBvLzvRwVom EM8zVhrXQ5N1/nL0gxSmTtOsKcxmZbYxEcXK5Z+grTPSC0MQ6xkJnsj+h/dlYxIs 0Pe1Q4po+xlRn9Ggwv+JQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddujedguddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfgggtoffgsehtkeertdertdejnecuhfhrohhmpefo rgigihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecugg ftrfgrthhtvghrnhepgfffgfetffduudelhfevieffffduleevgfegkeeutefgffejheel leekjeefhfejnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrh homhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 29 Jul 2022 12:36:05 -0400 (EDT) From: Maxime Ripard To: Jernej Skrabec , Martin Blumenstingl , Chen-Yu Tsai , Philipp Zabel , Jerome Brunet , Samuel Holland , Thomas Zimmermann , Daniel Vetter , Emma Anholt , David Airlie , Maarten Lankhorst , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Kevin Hilman , Neil Armstrong , Maxime Ripard Cc: Maxime Ripard , linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Phil Elwell , Mateusz Kwiatkowski , linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven , Dave Stevenson , linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, Dom Cobley Subject: [PATCH v1 11/35] drm/modes: Fill drm_cmdline mode from named modes Date: Fri, 29 Jul 2022 18:34:54 +0200 Message-Id: <20220728-rpi-analog-tv-properties-v1-11-3d53ae722097@cerno.tech> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220728-rpi-analog-tv-properties-v1-0-3d53ae722097@cerno.tech> References: <20220728-rpi-analog-tv-properties-v1-0-3d53ae722097@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.10.0-dev-49460 X-Developer-Signature: v=1; a=openpgp-sha256; l=1439; i=maxime@cerno.tech; h=from:subject:message-id; bh=NWuztsnfEBMwtrwGZAZ89RBSXbuMUAK6h8TPssl7ueY=; b=owGbwMvMwCHc4XzqmfnC7acZT6slMSQ94VFatr10tcm+HI8krRuTQr8mfAkyKmqcsXSbdwP31w2/ Y08UdpSyMAhzMMiKKbJcF3xrxxcW5RbB82EzzBxWJpAhDFycAjCR/YcZGR7ppvMEqYY8j2Pa/WDVgf lCS/ZWCwarVn+adbx93vncny8YGWa5Bx3lusat82xuXLT5NsZ/P2LCRU37244JmZ0wnDn9SBUA X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D Content-Transfer-Encoding: 8bit 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 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 1421e5da49e0..78ea520f2822 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -1770,11 +1770,12 @@ static int drm_mode_parse_cmdline_options(const char *str, struct drm_named_mode { const char *name; + const struct drm_display_mode *mode; }; static const struct drm_named_mode drm_named_modes[] = { - { "NTSC", }, - { "PAL", }, + { "NTSC", &drm_mode_480i, }, + { "PAL", &drm_mode_576i, }, }; static bool drm_mode_parse_cmdline_named_mode(const char *name, @@ -1792,6 +1793,9 @@ static bool drm_mode_parse_cmdline_named_mode(const char *name, continue; strcpy(cmdline_mode->name, mode->name); + cmdline_mode->xres = mode->mode->hdisplay; + cmdline_mode->yres = mode->mode->vdisplay; + cmdline_mode->interlace = !!(mode->mode->flags & DRM_MODE_FLAG_INTERLACE); cmdline_mode->specified = true; return true; -- b4 0.10.0-dev-49460