From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2DE83209 for ; Mon, 7 Nov 2022 12:46:05 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 0478A2B05E55; Mon, 7 Nov 2022 07:45:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 07 Nov 2022 07:46:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc: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=1667825159; x=1667832359; bh=aCBuDDCTfo ZSnelYeWWd5jAjRGm3SKR/gWkf1WzFlvA=; b=fe7Qh9ENKhkuZt9/GPDNxJ2scx spfqCPnmow5kVNVn7V2ZlyYoKqvXQnb5h25X/K6mxkPeTobwsbGdqUauJBjeXsEx rTjZZoxdBoWYC9oG0wnuFbBRgAoo/Y7C243KlPg481Cy+LlCwB78WfBjm6eNFjgg U+Ir/pdrUbm/OxyzaI22gfdkbc4ctncUR5FXTsqDvTZchDF5l5NNGgOjdEZ16YnN tTZao2/Zw8vYM+j3omW0ZUQfaZtI+aoc6CPEFUQFSHdXmSKHAaZrfh4ZhDaU9Poz /Qr4QCnghkjW7G3qtuR9dJwX2RmrQLmW7ntQBQJJThHI5Bmmo5NSrVtxoS4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1667825159; x=1667832359; bh=aCBuDDCTfoZSnelYeWWd5jAjRGm3 SKR/gWkf1WzFlvA=; b=WDiQgo7382zLJ7uJNNFLZLHgcRrYTi04F+A1Z1aIm60d IBxa39Lm0Y3HwsMbX45LSO5jr+II3UEjxpEqShWShLZgzAvnixfeJZVq07ZKkJWQ Y23yt/ZUeLIhSdNYJd9d0nlj5yza1LGU6svN6VqOMaJvpGBrLVDXco/u3pmJi7at m6WNMu+lUl6ovua3FyeL45ByNoue/i5/f9BBc9pa4BWxd5VsKhFj4cy80ssvIxin WTnk4Uc6wxGcVcQ4CKnBxc+r/XlgYR2Si8S5xTvAKnwFuHpAtdovqdT/h5fA1U9D 66yluk5/ZPl0/0nNbbAVHJOH8vMAm57K/3cSyCk19A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdekgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepjeevfeehfeekieffgeevleevtefgffefkedtfeeuhfettdegjeehgfegudff ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 07:45:58 -0500 (EST) Date: Mon, 7 Nov 2022 13:45:56 +0100 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Cc: Karol Herbst , Emma Anholt , Ben Skeggs , Chen-Yu Tsai , Rodrigo Vivi , Maarten Lankhorst , Jani Nikula , Daniel Vetter , Thomas Zimmermann , Tvrtko Ursulin , Samuel Holland , Jernej Skrabec , David Airlie , Joonas Lahtinen , Lyude Paul , linux-sunxi@lists.linux.dev, intel-gfx@lists.freedesktop.org, Phil Elwell , linux-arm-kernel@lists.infradead.org, nouveau@lists.freedesktop.org, Hans de Goede , Dom Cobley , Mateusz Kwiatkowski , dri-devel@lists.freedesktop.org, Dave Stevenson , linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH v6 16/23] drm/probe-helper: Provide a TV get_modes helper Message-ID: <20221107124556.nu6brodxdolh36w2@houat> References: <20220728-rpi-analog-tv-properties-v6-0-e7792734108f@cerno.tech> <20220728-rpi-analog-tv-properties-v6-16-e7792734108f@cerno.tech> <842076aa-8d7c-96d6-ba46-d0e66dacd2df@tronnes.org> <20221107102126.klxrvfe34e6uriyx@houat> <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ottaxywmq5yqznvz" Content-Disposition: inline In-Reply-To: <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> --ottaxywmq5yqznvz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 07, 2022 at 12:29:28PM +0100, Noralf Tr=F8nnes wrote: >=20 >=20 > Den 07.11.2022 11.21, skrev Maxime Ripard: > > Hi Noralf, > >=20 > > I'll leave aside your comments on the code, since we'll use your implem= entation. > >=20 > > On Sun, Nov 06, 2022 at 05:33:48PM +0100, Noralf Tr=F8nnes wrote: > >> Den 26.10.2022 17.33, skrev maxime@cerno.tech: > >>> + > >>> + if (cmdline->tv_mode_specified) > >>> + default_mode =3D cmdline->tv_mode; > >> > >> I realised that we don't verify tv_mode coming from the command line, > >> not here and not in the reset helper. Should we do that? A driver shou= ld > >> be programmed defensively to handle an illegal/unsupported value, but = it > >> doesn't feel right to allow an illegal enum value coming through the > >> core/helpers. > >=20 > > I don't think we can end up with an invalid value here if it's been > > specified. > >=20 > > We parse the command line through drm_mode_parse_tv_mode() (introduced > > in patch 13 "drm/modes: Introduce the tv_mode property as a command-line > > option") that will pick the tv mode part of the command line, and call > > drm_get_tv_mode_from_name() using it. > >=20 > > drm_get_tv_mode_from_name() will return a EINVAL if it's not a value we > > expect, and mode->tv_mode is only set on success. And AFAIK, there's no > > other path that will set tv_mode. > >=20 >=20 > I see now that illegal was the wrong word, but if the driver only > supports ntsc, the user can still set tv_mode=3DPAL right? And that's an > unsupported value that the driver can't fulfill, so it errors out. But > then again maybe that's just how it is, we can also set a display mode > that the driver can't handle, so this is no different in that respect. > Yeah, my argument lost some of its strength here :) I don't think we can handle this better, really. Falling back to NTSC in that case would really be a stretch: it's a different mode, with a different TV mode, etc. It's an even bigger stretch than picking another mode I guess, and like you said we're not doing that if the mode isn't supported Maxime --ottaxywmq5yqznvz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY2j+BAAKCRDj7w1vZxhR xb/7AQCG07KDDgc9kKjA6n8S2OhuHBoykKN7GTSWoyw+kpRAagEAnEdqeUL2OIq4 HN0taVCbFlrBNSZhsZTGM0XTfAsy6Qo= =S84X -----END PGP SIGNATURE----- --ottaxywmq5yqznvz-- From mboxrd@z Thu Jan 1 00:00:00 1970 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 C8636C433FE for ; Mon, 7 Nov 2022 12:46:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C137310E306; Mon, 7 Nov 2022 12:46:12 +0000 (UTC) Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id E48D710E303; Mon, 7 Nov 2022 12:46:05 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 0478A2B05E55; Mon, 7 Nov 2022 07:45:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 07 Nov 2022 07:46:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc: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=1667825159; x=1667832359; bh=aCBuDDCTfo ZSnelYeWWd5jAjRGm3SKR/gWkf1WzFlvA=; b=fe7Qh9ENKhkuZt9/GPDNxJ2scx spfqCPnmow5kVNVn7V2ZlyYoKqvXQnb5h25X/K6mxkPeTobwsbGdqUauJBjeXsEx rTjZZoxdBoWYC9oG0wnuFbBRgAoo/Y7C243KlPg481Cy+LlCwB78WfBjm6eNFjgg U+Ir/pdrUbm/OxyzaI22gfdkbc4ctncUR5FXTsqDvTZchDF5l5NNGgOjdEZ16YnN tTZao2/Zw8vYM+j3omW0ZUQfaZtI+aoc6CPEFUQFSHdXmSKHAaZrfh4ZhDaU9Poz /Qr4QCnghkjW7G3qtuR9dJwX2RmrQLmW7ntQBQJJThHI5Bmmo5NSrVtxoS4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1667825159; x=1667832359; bh=aCBuDDCTfoZSnelYeWWd5jAjRGm3 SKR/gWkf1WzFlvA=; b=WDiQgo7382zLJ7uJNNFLZLHgcRrYTi04F+A1Z1aIm60d IBxa39Lm0Y3HwsMbX45LSO5jr+II3UEjxpEqShWShLZgzAvnixfeJZVq07ZKkJWQ Y23yt/ZUeLIhSdNYJd9d0nlj5yza1LGU6svN6VqOMaJvpGBrLVDXco/u3pmJi7at m6WNMu+lUl6ovua3FyeL45ByNoue/i5/f9BBc9pa4BWxd5VsKhFj4cy80ssvIxin WTnk4Uc6wxGcVcQ4CKnBxc+r/XlgYR2Si8S5xTvAKnwFuHpAtdovqdT/h5fA1U9D 66yluk5/ZPl0/0nNbbAVHJOH8vMAm57K/3cSyCk19A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdekgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepjeevfeehfeekieffgeevleevtefgffefkedtfeeuhfettdegjeehgfegudff ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 07:45:58 -0500 (EST) Date: Mon, 7 Nov 2022 13:45:56 +0100 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Message-ID: <20221107124556.nu6brodxdolh36w2@houat> References: <20220728-rpi-analog-tv-properties-v6-0-e7792734108f@cerno.tech> <20220728-rpi-analog-tv-properties-v6-16-e7792734108f@cerno.tech> <842076aa-8d7c-96d6-ba46-d0e66dacd2df@tronnes.org> <20221107102126.klxrvfe34e6uriyx@houat> <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ottaxywmq5yqznvz" Content-Disposition: inline In-Reply-To: <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> Subject: Re: [Nouveau] [PATCH v6 16/23] drm/probe-helper: Provide a TV get_modes helper X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, Joonas Lahtinen , dri-devel@lists.freedesktop.org, Phil Elwell , Emma Anholt , Samuel Holland , Jernej Skrabec , Chen-Yu Tsai , Geert Uytterhoeven , Ben Skeggs , linux-sunxi@lists.linux.dev, Daniel Vetter , intel-gfx@lists.freedesktop.org, Maarten Lankhorst , Jani Nikula , Hans de Goede , Rodrigo Vivi , linux-arm-kernel@lists.infradead.org, Tvrtko Ursulin , Dom Cobley , linux-kernel@vger.kernel.org, Mateusz Kwiatkowski Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" --ottaxywmq5yqznvz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 07, 2022 at 12:29:28PM +0100, Noralf Tr=F8nnes wrote: >=20 >=20 > Den 07.11.2022 11.21, skrev Maxime Ripard: > > Hi Noralf, > >=20 > > I'll leave aside your comments on the code, since we'll use your implem= entation. > >=20 > > On Sun, Nov 06, 2022 at 05:33:48PM +0100, Noralf Tr=F8nnes wrote: > >> Den 26.10.2022 17.33, skrev maxime@cerno.tech: > >>> + > >>> + if (cmdline->tv_mode_specified) > >>> + default_mode =3D cmdline->tv_mode; > >> > >> I realised that we don't verify tv_mode coming from the command line, > >> not here and not in the reset helper. Should we do that? A driver shou= ld > >> be programmed defensively to handle an illegal/unsupported value, but = it > >> doesn't feel right to allow an illegal enum value coming through the > >> core/helpers. > >=20 > > I don't think we can end up with an invalid value here if it's been > > specified. > >=20 > > We parse the command line through drm_mode_parse_tv_mode() (introduced > > in patch 13 "drm/modes: Introduce the tv_mode property as a command-line > > option") that will pick the tv mode part of the command line, and call > > drm_get_tv_mode_from_name() using it. > >=20 > > drm_get_tv_mode_from_name() will return a EINVAL if it's not a value we > > expect, and mode->tv_mode is only set on success. And AFAIK, there's no > > other path that will set tv_mode. > >=20 >=20 > I see now that illegal was the wrong word, but if the driver only > supports ntsc, the user can still set tv_mode=3DPAL right? And that's an > unsupported value that the driver can't fulfill, so it errors out. But > then again maybe that's just how it is, we can also set a display mode > that the driver can't handle, so this is no different in that respect. > Yeah, my argument lost some of its strength here :) I don't think we can handle this better, really. Falling back to NTSC in that case would really be a stretch: it's a different mode, with a different TV mode, etc. It's an even bigger stretch than picking another mode I guess, and like you said we're not doing that if the mode isn't supported Maxime --ottaxywmq5yqznvz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY2j+BAAKCRDj7w1vZxhR xb/7AQCG07KDDgc9kKjA6n8S2OhuHBoykKN7GTSWoyw+kpRAagEAnEdqeUL2OIq4 HN0taVCbFlrBNSZhsZTGM0XTfAsy6Qo= =S84X -----END PGP SIGNATURE----- --ottaxywmq5yqznvz-- From mboxrd@z Thu Jan 1 00:00:00 1970 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 7F2BEC4332F for ; Mon, 7 Nov 2022 12:46:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77CB710E303; Mon, 7 Nov 2022 12:46:10 +0000 (UTC) Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id E48D710E303; Mon, 7 Nov 2022 12:46:05 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 0478A2B05E55; Mon, 7 Nov 2022 07:45:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 07 Nov 2022 07:46:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc: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=1667825159; x=1667832359; bh=aCBuDDCTfo ZSnelYeWWd5jAjRGm3SKR/gWkf1WzFlvA=; b=fe7Qh9ENKhkuZt9/GPDNxJ2scx spfqCPnmow5kVNVn7V2ZlyYoKqvXQnb5h25X/K6mxkPeTobwsbGdqUauJBjeXsEx rTjZZoxdBoWYC9oG0wnuFbBRgAoo/Y7C243KlPg481Cy+LlCwB78WfBjm6eNFjgg U+Ir/pdrUbm/OxyzaI22gfdkbc4ctncUR5FXTsqDvTZchDF5l5NNGgOjdEZ16YnN tTZao2/Zw8vYM+j3omW0ZUQfaZtI+aoc6CPEFUQFSHdXmSKHAaZrfh4ZhDaU9Poz /Qr4QCnghkjW7G3qtuR9dJwX2RmrQLmW7ntQBQJJThHI5Bmmo5NSrVtxoS4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1667825159; x=1667832359; bh=aCBuDDCTfoZSnelYeWWd5jAjRGm3 SKR/gWkf1WzFlvA=; b=WDiQgo7382zLJ7uJNNFLZLHgcRrYTi04F+A1Z1aIm60d IBxa39Lm0Y3HwsMbX45LSO5jr+II3UEjxpEqShWShLZgzAvnixfeJZVq07ZKkJWQ Y23yt/ZUeLIhSdNYJd9d0nlj5yza1LGU6svN6VqOMaJvpGBrLVDXco/u3pmJi7at m6WNMu+lUl6ovua3FyeL45ByNoue/i5/f9BBc9pa4BWxd5VsKhFj4cy80ssvIxin WTnk4Uc6wxGcVcQ4CKnBxc+r/XlgYR2Si8S5xTvAKnwFuHpAtdovqdT/h5fA1U9D 66yluk5/ZPl0/0nNbbAVHJOH8vMAm57K/3cSyCk19A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdekgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepjeevfeehfeekieffgeevleevtefgffefkedtfeeuhfettdegjeehgfegudff ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 07:45:58 -0500 (EST) Date: Mon, 7 Nov 2022 13:45:56 +0100 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Subject: Re: [PATCH v6 16/23] drm/probe-helper: Provide a TV get_modes helper Message-ID: <20221107124556.nu6brodxdolh36w2@houat> References: <20220728-rpi-analog-tv-properties-v6-0-e7792734108f@cerno.tech> <20220728-rpi-analog-tv-properties-v6-16-e7792734108f@cerno.tech> <842076aa-8d7c-96d6-ba46-d0e66dacd2df@tronnes.org> <20221107102126.klxrvfe34e6uriyx@houat> <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ottaxywmq5yqznvz" Content-Disposition: inline In-Reply-To: <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Karol Herbst , David Airlie , nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Phil Elwell , Emma Anholt , Samuel Holland , Jernej Skrabec , Chen-Yu Tsai , Geert Uytterhoeven , Ben Skeggs , linux-sunxi@lists.linux.dev, intel-gfx@lists.freedesktop.org, Hans de Goede , Rodrigo Vivi , linux-arm-kernel@lists.infradead.org, Tvrtko Ursulin , Dom Cobley , Dave Stevenson , linux-kernel@vger.kernel.org, Mateusz Kwiatkowski , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --ottaxywmq5yqznvz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 07, 2022 at 12:29:28PM +0100, Noralf Tr=F8nnes wrote: >=20 >=20 > Den 07.11.2022 11.21, skrev Maxime Ripard: > > Hi Noralf, > >=20 > > I'll leave aside your comments on the code, since we'll use your implem= entation. > >=20 > > On Sun, Nov 06, 2022 at 05:33:48PM +0100, Noralf Tr=F8nnes wrote: > >> Den 26.10.2022 17.33, skrev maxime@cerno.tech: > >>> + > >>> + if (cmdline->tv_mode_specified) > >>> + default_mode =3D cmdline->tv_mode; > >> > >> I realised that we don't verify tv_mode coming from the command line, > >> not here and not in the reset helper. Should we do that? A driver shou= ld > >> be programmed defensively to handle an illegal/unsupported value, but = it > >> doesn't feel right to allow an illegal enum value coming through the > >> core/helpers. > >=20 > > I don't think we can end up with an invalid value here if it's been > > specified. > >=20 > > We parse the command line through drm_mode_parse_tv_mode() (introduced > > in patch 13 "drm/modes: Introduce the tv_mode property as a command-line > > option") that will pick the tv mode part of the command line, and call > > drm_get_tv_mode_from_name() using it. > >=20 > > drm_get_tv_mode_from_name() will return a EINVAL if it's not a value we > > expect, and mode->tv_mode is only set on success. And AFAIK, there's no > > other path that will set tv_mode. > >=20 >=20 > I see now that illegal was the wrong word, but if the driver only > supports ntsc, the user can still set tv_mode=3DPAL right? And that's an > unsupported value that the driver can't fulfill, so it errors out. But > then again maybe that's just how it is, we can also set a display mode > that the driver can't handle, so this is no different in that respect. > Yeah, my argument lost some of its strength here :) I don't think we can handle this better, really. Falling back to NTSC in that case would really be a stretch: it's a different mode, with a different TV mode, etc. It's an even bigger stretch than picking another mode I guess, and like you said we're not doing that if the mode isn't supported Maxime --ottaxywmq5yqznvz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY2j+BAAKCRDj7w1vZxhR xb/7AQCG07KDDgc9kKjA6n8S2OhuHBoykKN7GTSWoyw+kpRAagEAnEdqeUL2OIq4 HN0taVCbFlrBNSZhsZTGM0XTfAsy6Qo= =S84X -----END PGP SIGNATURE----- --ottaxywmq5yqznvz-- From mboxrd@z Thu Jan 1 00:00:00 1970 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 E0238C4332F for ; Mon, 7 Nov 2022 12:46:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CE9910E302; Mon, 7 Nov 2022 12:46:10 +0000 (UTC) Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id E48D710E303; Mon, 7 Nov 2022 12:46:05 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 0478A2B05E55; Mon, 7 Nov 2022 07:45:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 07 Nov 2022 07:46:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc: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=1667825159; x=1667832359; bh=aCBuDDCTfo ZSnelYeWWd5jAjRGm3SKR/gWkf1WzFlvA=; b=fe7Qh9ENKhkuZt9/GPDNxJ2scx spfqCPnmow5kVNVn7V2ZlyYoKqvXQnb5h25X/K6mxkPeTobwsbGdqUauJBjeXsEx rTjZZoxdBoWYC9oG0wnuFbBRgAoo/Y7C243KlPg481Cy+LlCwB78WfBjm6eNFjgg U+Ir/pdrUbm/OxyzaI22gfdkbc4ctncUR5FXTsqDvTZchDF5l5NNGgOjdEZ16YnN tTZao2/Zw8vYM+j3omW0ZUQfaZtI+aoc6CPEFUQFSHdXmSKHAaZrfh4ZhDaU9Poz /Qr4QCnghkjW7G3qtuR9dJwX2RmrQLmW7ntQBQJJThHI5Bmmo5NSrVtxoS4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1667825159; x=1667832359; bh=aCBuDDCTfoZSnelYeWWd5jAjRGm3 SKR/gWkf1WzFlvA=; b=WDiQgo7382zLJ7uJNNFLZLHgcRrYTi04F+A1Z1aIm60d IBxa39Lm0Y3HwsMbX45LSO5jr+II3UEjxpEqShWShLZgzAvnixfeJZVq07ZKkJWQ Y23yt/ZUeLIhSdNYJd9d0nlj5yza1LGU6svN6VqOMaJvpGBrLVDXco/u3pmJi7at m6WNMu+lUl6ovua3FyeL45ByNoue/i5/f9BBc9pa4BWxd5VsKhFj4cy80ssvIxin WTnk4Uc6wxGcVcQ4CKnBxc+r/XlgYR2Si8S5xTvAKnwFuHpAtdovqdT/h5fA1U9D 66yluk5/ZPl0/0nNbbAVHJOH8vMAm57K/3cSyCk19A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdekgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepjeevfeehfeekieffgeevleevtefgffefkedtfeeuhfettdegjeehgfegudff ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 07:45:58 -0500 (EST) Date: Mon, 7 Nov 2022 13:45:56 +0100 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Message-ID: <20221107124556.nu6brodxdolh36w2@houat> References: <20220728-rpi-analog-tv-properties-v6-0-e7792734108f@cerno.tech> <20220728-rpi-analog-tv-properties-v6-16-e7792734108f@cerno.tech> <842076aa-8d7c-96d6-ba46-d0e66dacd2df@tronnes.org> <20221107102126.klxrvfe34e6uriyx@houat> <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ottaxywmq5yqznvz" Content-Disposition: inline In-Reply-To: <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> Subject: Re: [Intel-gfx] [PATCH v6 16/23] drm/probe-helper: Provide a TV get_modes helper 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: Karol Herbst , David Airlie , nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Phil Elwell , Emma Anholt , Samuel Holland , Jernej Skrabec , Chen-Yu Tsai , Geert Uytterhoeven , Ben Skeggs , linux-sunxi@lists.linux.dev, Daniel Vetter , intel-gfx@lists.freedesktop.org, Hans de Goede , Rodrigo Vivi , linux-arm-kernel@lists.infradead.org, Dom Cobley , Dave Stevenson , linux-kernel@vger.kernel.org, Mateusz Kwiatkowski , Thomas Zimmermann Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" --ottaxywmq5yqznvz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 07, 2022 at 12:29:28PM +0100, Noralf Tr=F8nnes wrote: >=20 >=20 > Den 07.11.2022 11.21, skrev Maxime Ripard: > > Hi Noralf, > >=20 > > I'll leave aside your comments on the code, since we'll use your implem= entation. > >=20 > > On Sun, Nov 06, 2022 at 05:33:48PM +0100, Noralf Tr=F8nnes wrote: > >> Den 26.10.2022 17.33, skrev maxime@cerno.tech: > >>> + > >>> + if (cmdline->tv_mode_specified) > >>> + default_mode =3D cmdline->tv_mode; > >> > >> I realised that we don't verify tv_mode coming from the command line, > >> not here and not in the reset helper. Should we do that? A driver shou= ld > >> be programmed defensively to handle an illegal/unsupported value, but = it > >> doesn't feel right to allow an illegal enum value coming through the > >> core/helpers. > >=20 > > I don't think we can end up with an invalid value here if it's been > > specified. > >=20 > > We parse the command line through drm_mode_parse_tv_mode() (introduced > > in patch 13 "drm/modes: Introduce the tv_mode property as a command-line > > option") that will pick the tv mode part of the command line, and call > > drm_get_tv_mode_from_name() using it. > >=20 > > drm_get_tv_mode_from_name() will return a EINVAL if it's not a value we > > expect, and mode->tv_mode is only set on success. And AFAIK, there's no > > other path that will set tv_mode. > >=20 >=20 > I see now that illegal was the wrong word, but if the driver only > supports ntsc, the user can still set tv_mode=3DPAL right? And that's an > unsupported value that the driver can't fulfill, so it errors out. But > then again maybe that's just how it is, we can also set a display mode > that the driver can't handle, so this is no different in that respect. > Yeah, my argument lost some of its strength here :) I don't think we can handle this better, really. Falling back to NTSC in that case would really be a stretch: it's a different mode, with a different TV mode, etc. It's an even bigger stretch than picking another mode I guess, and like you said we're not doing that if the mode isn't supported Maxime --ottaxywmq5yqznvz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY2j+BAAKCRDj7w1vZxhR xb/7AQCG07KDDgc9kKjA6n8S2OhuHBoykKN7GTSWoyw+kpRAagEAnEdqeUL2OIq4 HN0taVCbFlrBNSZhsZTGM0XTfAsy6Qo= =S84X -----END PGP SIGNATURE----- --ottaxywmq5yqznvz-- From mboxrd@z Thu Jan 1 00:00:00 1970 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 E7627C433FE for ; Mon, 7 Nov 2022 12:47:18 +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-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Qcqww6ZufIz5OxuDKXimubqx2g2LgQ9/3n8RzwQCJaU=; b=MS4jCh6Kc9y+7UnF8Xrj++DHIz MfhAyTeS6nrTevGC5Q/AZEidalNCdJAG0MsfOHAk5T379iitgVv1H58nGUj7xzSsaPM5q5olQM7iV ZYWsnngWKuGv0HZzCJd4R7Is/p5Ja2itu0xqmHawWNvColqPCBScPRAF3GZi/cvyNG0htuC/VW7VQ U/JKDP8rtWSFR/SLYQjvnYrW2w/Dc9Rtpvi+Y+Vu4P3LwZ2byqMOYCiw/l4RiHeYF2pk71Z5lVoGI qbm0sEQLo87F8yCtewKey9dUyd6scr7gdsKk3CbS0dButL97bKzd+mpJkcdl2OYQeQavZksDKa3Ko b980Tovg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os1Vy-00EYMG-Ho; Mon, 07 Nov 2022 12:46:10 +0000 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os1Vu-00EYKl-0k for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 12:46:09 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 0478A2B05E55; Mon, 7 Nov 2022 07:45:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 07 Nov 2022 07:46:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc: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=1667825159; x=1667832359; bh=aCBuDDCTfo ZSnelYeWWd5jAjRGm3SKR/gWkf1WzFlvA=; b=fe7Qh9ENKhkuZt9/GPDNxJ2scx spfqCPnmow5kVNVn7V2ZlyYoKqvXQnb5h25X/K6mxkPeTobwsbGdqUauJBjeXsEx rTjZZoxdBoWYC9oG0wnuFbBRgAoo/Y7C243KlPg481Cy+LlCwB78WfBjm6eNFjgg U+Ir/pdrUbm/OxyzaI22gfdkbc4ctncUR5FXTsqDvTZchDF5l5NNGgOjdEZ16YnN tTZao2/Zw8vYM+j3omW0ZUQfaZtI+aoc6CPEFUQFSHdXmSKHAaZrfh4ZhDaU9Poz /Qr4QCnghkjW7G3qtuR9dJwX2RmrQLmW7ntQBQJJThHI5Bmmo5NSrVtxoS4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1667825159; x=1667832359; bh=aCBuDDCTfoZSnelYeWWd5jAjRGm3 SKR/gWkf1WzFlvA=; b=WDiQgo7382zLJ7uJNNFLZLHgcRrYTi04F+A1Z1aIm60d IBxa39Lm0Y3HwsMbX45LSO5jr+II3UEjxpEqShWShLZgzAvnixfeJZVq07ZKkJWQ Y23yt/ZUeLIhSdNYJd9d0nlj5yza1LGU6svN6VqOMaJvpGBrLVDXco/u3pmJi7at m6WNMu+lUl6ovua3FyeL45ByNoue/i5/f9BBc9pa4BWxd5VsKhFj4cy80ssvIxin WTnk4Uc6wxGcVcQ4CKnBxc+r/XlgYR2Si8S5xTvAKnwFuHpAtdovqdT/h5fA1U9D 66yluk5/ZPl0/0nNbbAVHJOH8vMAm57K/3cSyCk19A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvdekgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepjeevfeehfeekieffgeevleevtefgffefkedtfeeuhfettdegjeehgfegudff ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Nov 2022 07:45:58 -0500 (EST) Date: Mon, 7 Nov 2022 13:45:56 +0100 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Cc: Karol Herbst , Emma Anholt , Ben Skeggs , Chen-Yu Tsai , Rodrigo Vivi , Maarten Lankhorst , Jani Nikula , Daniel Vetter , Thomas Zimmermann , Tvrtko Ursulin , Samuel Holland , Jernej Skrabec , David Airlie , Joonas Lahtinen , Lyude Paul , linux-sunxi@lists.linux.dev, intel-gfx@lists.freedesktop.org, Phil Elwell , linux-arm-kernel@lists.infradead.org, nouveau@lists.freedesktop.org, Hans de Goede , Dom Cobley , Mateusz Kwiatkowski , dri-devel@lists.freedesktop.org, Dave Stevenson , linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH v6 16/23] drm/probe-helper: Provide a TV get_modes helper Message-ID: <20221107124556.nu6brodxdolh36w2@houat> References: <20220728-rpi-analog-tv-properties-v6-0-e7792734108f@cerno.tech> <20220728-rpi-analog-tv-properties-v6-16-e7792734108f@cerno.tech> <842076aa-8d7c-96d6-ba46-d0e66dacd2df@tronnes.org> <20221107102126.klxrvfe34e6uriyx@houat> <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> MIME-Version: 1.0 In-Reply-To: <813ebf68-a7f4-441f-d0d6-f63fd923a479@tronnes.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_044606_102950_926802FB X-CRM114-Status: GOOD ( 26.17 ) 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: , Content-Type: multipart/mixed; boundary="===============4446304304508084567==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4446304304508084567== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ottaxywmq5yqznvz" Content-Disposition: inline --ottaxywmq5yqznvz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 07, 2022 at 12:29:28PM +0100, Noralf Tr=F8nnes wrote: >=20 >=20 > Den 07.11.2022 11.21, skrev Maxime Ripard: > > Hi Noralf, > >=20 > > I'll leave aside your comments on the code, since we'll use your implem= entation. > >=20 > > On Sun, Nov 06, 2022 at 05:33:48PM +0100, Noralf Tr=F8nnes wrote: > >> Den 26.10.2022 17.33, skrev maxime@cerno.tech: > >>> + > >>> + if (cmdline->tv_mode_specified) > >>> + default_mode =3D cmdline->tv_mode; > >> > >> I realised that we don't verify tv_mode coming from the command line, > >> not here and not in the reset helper. Should we do that? A driver shou= ld > >> be programmed defensively to handle an illegal/unsupported value, but = it > >> doesn't feel right to allow an illegal enum value coming through the > >> core/helpers. > >=20 > > I don't think we can end up with an invalid value here if it's been > > specified. > >=20 > > We parse the command line through drm_mode_parse_tv_mode() (introduced > > in patch 13 "drm/modes: Introduce the tv_mode property as a command-line > > option") that will pick the tv mode part of the command line, and call > > drm_get_tv_mode_from_name() using it. > >=20 > > drm_get_tv_mode_from_name() will return a EINVAL if it's not a value we > > expect, and mode->tv_mode is only set on success. And AFAIK, there's no > > other path that will set tv_mode. > >=20 >=20 > I see now that illegal was the wrong word, but if the driver only > supports ntsc, the user can still set tv_mode=3DPAL right? And that's an > unsupported value that the driver can't fulfill, so it errors out. But > then again maybe that's just how it is, we can also set a display mode > that the driver can't handle, so this is no different in that respect. > Yeah, my argument lost some of its strength here :) I don't think we can handle this better, really. Falling back to NTSC in that case would really be a stretch: it's a different mode, with a different TV mode, etc. It's an even bigger stretch than picking another mode I guess, and like you said we're not doing that if the mode isn't supported Maxime --ottaxywmq5yqznvz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY2j+BAAKCRDj7w1vZxhR xb/7AQCG07KDDgc9kKjA6n8S2OhuHBoykKN7GTSWoyw+kpRAagEAnEdqeUL2OIq4 HN0taVCbFlrBNSZhsZTGM0XTfAsy6Qo= =S84X -----END PGP SIGNATURE----- --ottaxywmq5yqznvz-- --===============4446304304508084567== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4446304304508084567==--