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 AC72BE77179 for ; Fri, 6 Dec 2024 14:24:22 +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:Date:From: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=dv+lSK0pZfkBD2I68npkh70YjGYXMeKtulzIPY9paU0=; b=3YU/zl48QKdKiIVvoE7YhTc0Nm RHd4EaVQM+FjFLm1TpwQEuK+dEZ66sJ5shwJ5usTjJfZqLZ+nY21f7SZbqHEw1FO2lhLDTyg4yB4t a4z+Ws6lt4ylL0FldcQbtdk6almL2nyg5vrHf6Vyngl746tl3alQki/Nwfx4T8FI6Oz0svHf7nBWk omPTwgT0paYUk8VhlVb6UwNXr8yL46bL/cA4M184Z1MvkOxCOsS8mEwYBHa6GRff05YneHmnzwPEN f/9hlMAtO39YwTrssUpHcPIg2IAbd7E6o8QLgfLfODFVOzfE+nH/baWfD6zp1JmdGx/7a7mDDOuzw 6bv/T3fA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tJZFZ-00000001r8Y-2RFN; Fri, 06 Dec 2024 14:24:09 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tJZEX-00000001qyL-2faS; Fri, 06 Dec 2024 14:23:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 983CBA4423C; Fri, 6 Dec 2024 14:21:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6CA8C4CED1; Fri, 6 Dec 2024 14:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733494984; bh=KjGZ7RXzGwqZiqmHjguEh0tDh9nP5DfFrBU9SfrU15k=; h=From:Date:To:Cc:Subject:References:In-Reply-To:From; b=i7NRQ6jUNAOhb8w7aT8pqsBU9WQagCvkU0JqfRg0P0mqaGYTO0EQmBBoiAvjpgccQ LSlSazpccXfaqiFOsccfqWJpQzhrgjKyCmWiso/EoKZCbnNKFWT2vNFjaSUTbrZ0NV wEF0gdbsmXHAlU6dMNfRBtdodwqxIlCMnsEShU8hn0BF23K1qzYmHmJFG5KgEfh4DO SPdfTFtl3NP5xzTS6Dq3t9R2GJaXe5upAcVClaEQLdi0Y0eLXtodBv7+OCkWCKEMOq GFlgLzCM2OuFqbfzaLgQsxlpcn+ZYBjY63ZN9UmlE/MZ+vcIYWiHGLkkOZ+zuK9rIx PzEhxJg6u+Kiw== From: mripard@kernel.org Date: Fri, 6 Dec 2024 15:23:01 +0100 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 v5 9/9] drm/vc4: hdmi: use drm_atomic_helper_connector_hdmi_update_edid() Message-ID: <20241206-speedy-beaver-from-asgard-dbed9c@houat> HFrom: Maxime Ripard References: <20241201-drm-bridge-hdmi-connector-v5-0-b5316e82f61a@linaro.org> <20241201-drm-bridge-hdmi-connector-v5-9-b5316e82f61a@linaro.org> <20241202-married-bald-raven-7acd83@houat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="dycgynhhneeoioiz" Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241206_062305_802166_B40A3286 X-CRM114-Status: GOOD ( 38.98 ) 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 --dycgynhhneeoioiz Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v5 9/9] drm/vc4: hdmi: use drm_atomic_helper_connector_hdmi_update_edid() MIME-Version: 1.0 On Tue, Dec 03, 2024 at 02:27:44PM +0200, Dmitry Baryshkov wrote: > On Mon, Dec 02, 2024 at 02:27:49PM +0100, Maxime Ripard wrote: > > Hi, > >=20 > > On Sun, Dec 01, 2024 at 02:44:13AM +0200, Dmitry Baryshkov wrote: > > > Use the helper function to update the connector's information. This > > > makes sure that HDMI-related events are handled in a generic way. > > > Currently it is limited to the HDMI state reporting to the sound syst= em. > > >=20 > > > Signed-off-by: Dmitry Baryshkov > > > --- > > > drivers/gpu/drm/vc4/vc4_hdmi.c | 9 +++++++-- > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4= _hdmi.c > > > index d0a9aff7ad43016647493263c00d593296a1e3ad..d83f587ab69f4b8f7d5c3= 7a00777f11da8301bc1 100644 > > > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > > > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > > > @@ -401,13 +401,16 @@ static void vc4_hdmi_handle_hotplug(struct vc4_= hdmi *vc4_hdmi, > > > */ > > > =20 > > > if (status =3D=3D connector_status_disconnected) { > > > + drm_atomic_helper_connector_hdmi_update_edid(connector, NULL); > > > cec_phys_addr_invalidate(vc4_hdmi->cec_adap); > > > return; > > > } > > > =20 > > > drm_edid =3D drm_edid_read_ddc(connector, vc4_hdmi->ddc); > > > =20 > > > - drm_edid_connector_update(connector, drm_edid); > > > + // TODO: use drm_atomic_helper_connector_hdmi_update() once it gains > > > + // CEC support > > > + drm_atomic_helper_connector_hdmi_update_edid(connector, drm_edid); > >=20 > > So, it's not just about EDID, and I think we shouldn't really focus on > > that either. > >=20 > > As that patch points out, even if we only consider EDID's, we have > > different path depending on the connector status. It shouldn't be up to > > the drivers to get this right. > >=20 > > What I had in mind was something like a > > drm_atomic_helper_connector_hdmi_hotplug function that would obviously > > deal with EDID only here, but would expand to CEC, scrambling, etc. > > later on. >=20 > I thought about it, after our discussion, but in the end I had to > implement the EDID-specific function, using edid =3D=3D NULL as > "disconnected" event. The issue is pretty simple: there is no standard > way to get EDID from the connector. The devices can call > drm_edid_read(), drm_edid_read_ddc(connector->ddc) or (especially > embedded bridges) use drm_edid_read_custom(). And that's fine, it's to be expected. > Of course we can go with the functional way and add the > .read_edid(drm_connector) callback to the HDMI funcs. Then the > drm_atomic_helper_connector_hdmi_hotplug() function can read EDID on its > own. Yep, that's definitely what we should do. And then we can make a get_modes helper too that would also use it. > Also the function that you proposed perfectly fits the HPD notification > callbacks, but which function should be called from the .get_modes()? > The _hdmi_hotplug() doesn't fit there. Do we still end up with both > drm_atomic_helper_connector_hdmi_hotplug() and > drm_atomic_helper_connector_hdmi_update_edid()? I'd say both a get_modes helper and a hotplug helper, both using that read_edid hook under the hood. Maxime --dycgynhhneeoioiz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCZ1MIxQAKCRAnX84Zoj2+ do5xAX4k6mKW4Bt7ybI5RhlLw9sJEo4pfcA2eh2x5DRMpHOkyzon0k434uDMFRng 2KdcU8gBgK08VG9rHNa3FQR0uOvG+ivNuzpw60Z3iQTfDrl9j6ufNMx2bCeo7pR2 LTKnOXxxkg== =7iA8 -----END PGP SIGNATURE----- --dycgynhhneeoioiz--