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 D1F0AE77184 for ; Tue, 17 Dec 2024 17:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: 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=XaoafRVSopnv2RjfO+sjKjWmBywWCU9CfcP2qGB0q1U=; b=VHhG7KDj8M/btH5kk7wNQ6YdZg Pf4mSvgDCbQU5WeDQuL/QfcN/6NTzSNDgShaFf8MZvDaab3m68MwdM5fcvVPLPn2z0x+CACjnJCWH XNEK8qTaWiOLwA88+oSk56iOwULtpMtslbb2Woc5K8bhvDXfUNMEWXOLTiafnz00jJrEZq4ffDXY/ rJQ93z/mX5UWWVi7Ok9m+JJoenyCfaUDVMhIQRR14MgZZnW0HB+fsEMYKCMYod7hWAvEdoVIPbZXl GFe5lnLmlu5gJPGJbXcvuz7SYSW6ZYcNmTfvVr57/Dn0K17RLCuoUpZl8EIHUIQvIYutC1g5vXjEN u05XhjnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNb9u-0000000EITu-08OY; Tue, 17 Dec 2024 17:14:58 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNb8V-0000000EIDf-2Wxq; Tue, 17 Dec 2024 17:13:39 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 94E575C63C7; Tue, 17 Dec 2024 17:12:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E999BC4CED3; Tue, 17 Dec 2024 17:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734455610; bh=jLjXGQRuYhHX2FPYDCj3e7QwJ0rtcdIW6eV0G++iz2s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KOzwMCZFWUA2AqJ1WijKIDZ3FG9jWwCSzdAkuGZZk8CcgC3MyQihVL/tAVIiQAakk qyHscAgc8d66oucPc5BpPhk/KTUJ71yRFgZoX3tX7UkL4+zbh2hDnsSf/GHyjtNKSW RjOrc1ydi4UaaLqtcsRPq6vPcccmYLHTyP10s8zr1KbVVEGlKdA1f5DjB+yx2Wj4ei DfdAyXT08iOVVhOxzzrk7PBP3Jip+7BZAHqv+G3+oyIpMIa08Ye/iSu1kSKJYt840D i8Igg57Gubrn1nFnXYuUHv2WdInHj9fnqvBVbcvBArEHmirJx3HKuYIClQkXQtu753 6iWHuWgzJcXvg== Date: Tue, 17 Dec 2024 18:13:27 +0100 From: Maxime Ripard To: Dmitry Baryshkov Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Phong LE , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , Russell King , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Sandy Huang , Heiko =?utf-8?Q?St=C3=BCbner?= , Andy Yan , Alain Volmat , Raphael Gallais-Pou , Dave Stevenson , =?utf-8?B?TWHDrXJh?= Canal , Raspberry Pi Kernel Maintenance , Jani Nikula , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v6 09/10] drm/vc4: hdmi: stop rereading EDID in get_modes() Message-ID: <20241217-curly-mauve-scallop-d84a3d@houat> References: <20241206-drm-bridge-hdmi-connector-v6-0-50dc145a9c06@linaro.org> <20241206-drm-bridge-hdmi-connector-v6-9-50dc145a9c06@linaro.org> <20241206-caped-proficient-rattlesnake-c882f3@houat> <73xdxb575n4ncmadffkwqzczoewbadq3forpvqt4vp7zfln2nq@o2wmbbbepwgg> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="tibevjcmq2hqubs4" Content-Disposition: inline In-Reply-To: <73xdxb575n4ncmadffkwqzczoewbadq3forpvqt4vp7zfln2nq@o2wmbbbepwgg> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_091334_141152_046924E0 X-CRM114-Status: GOOD ( 36.29 ) 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 --tibevjcmq2hqubs4 Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v6 09/10] drm/vc4: hdmi: stop rereading EDID in get_modes() MIME-Version: 1.0 On Sun, Dec 08, 2024 at 01:06:46PM +0200, Dmitry Baryshkov wrote: > On Fri, Dec 06, 2024 at 03:34:52PM +0100, Maxime Ripard wrote: > > Hi, > >=20 > > On Fri, Dec 06, 2024 at 12:16:03PM +0200, Dmitry Baryshkov wrote: > > > The vc4_hdmi_connector_detect_ctx() via vc4_hdmi_handle_hotplug() > > > already reads EDID and propagates it to the drm_connector. Stop > > > rereading EDID as a part of the .get_modes() callback and just update > > > the list of modes. This matches the behaviour of the i915 driver. > > >=20 > > > Signed-off-by: Dmitry Baryshkov > > > --- > > > drivers/gpu/drm/vc4/vc4_hdmi.c | 21 --------------------- > > > 1 file changed, 21 deletions(-) > > >=20 > > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4= _hdmi.c > > > index e5ab42f72f618b90f956482db6c9c8074c1e3bf1..3364ef90968dad3074800= f02926300ffceb75c69 100644 > > > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > > > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > > > @@ -470,31 +470,10 @@ static int vc4_hdmi_connector_detect_ctx(struct= drm_connector *connector, > > > =20 > > > static int vc4_hdmi_connector_get_modes(struct drm_connector *connec= tor) > > > { > > > - struct vc4_hdmi *vc4_hdmi =3D connector_to_vc4_hdmi(connector); > > > struct vc4_dev *vc4 =3D to_vc4_dev(connector->dev); > > > - const struct drm_edid *drm_edid; > > > int ret =3D 0; > > > =20 > > > - /* > > > - * NOTE: This function should really take vc4_hdmi->mutex, but doin= g so > > > - * results in reentrancy issues since cec_s_phys_addr() might call > > > - * .adap_enable, which leads to that funtion being called with our = mutex > > > - * held. > > > - * > > > - * Concurrency isn't an issue at the moment since we don't share > > > - * any state with any of the other frameworks so we can ignore > > > - * the lock for now. > > > - */ > > > - > > > - drm_edid =3D drm_edid_read_ddc(connector, vc4_hdmi->ddc); > > > - drm_edid_connector_update(connector, drm_edid); > > > - cec_s_phys_addr(vc4_hdmi->cec_adap, > > > - connector->display_info.source_physical_address, false); > > > - if (!drm_edid) > > > - return 0; > > > - > > > ret =3D drm_edid_connector_add_modes(connector); > > > - drm_edid_free(drm_edid); > >=20 > > I don't think that works though, for mostly two reasons: > >=20 > > 1) We're not sure we'll even have an hotplug interrupt if the system > > boots with the connector plugged in for example. > >=20 > > 2) afaik, the get_modes ioctl directly calls get_modes too. >=20 > I think both paths use .fill_modes, not get_modes. The standard fill_modes helper calls get_modes. > And fill_modes explicitly calls .detect / .detect_ctx. It would be > nice if somebody can verify the change on the acual hw. But as I > wrote, i915 driver does exactly the same: the EDID is read / updated > in .detect_ctx(), while .get_modes() only performs > drm_edid_connector_add_modes(). Okay, there is one significant > difference which we should probably patch out: the .force() is also > implemented to update EDID in the forced case. I should probably do > the same for the drivers being handled in this patchset. Ack. Worst case scenario we can fix it later on. Maxime --tibevjcmq2hqubs4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCZ2GxNwAKCRAnX84Zoj2+ dkQFAX0SszndvYXwUlXHlEuKUMjRu6IRXcqwYhtGDEU4Pa5CP+DEeeU2aVcCBV57 8JlgY1EBgJoNXW3bl5jfa7bCf56cHn19NuMdQETCLtTWVjLm+TwQe7iYK5KnDYrP uvMZWYlUTg== =d8qr -----END PGP SIGNATURE----- --tibevjcmq2hqubs4--