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 X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF4E0C433E6 for ; Mon, 11 Jan 2021 10:31:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7746422795 for ; Mon, 11 Jan 2021 10:31:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7746422795 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject: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=zEk20eNa9BLhL48RJBg5ZrSMURsymRKBShwC81P8X8Y=; b=TqruzvPXdPnzRr7rAK6cfaltc JrfarcpmUBKyfXKO0rqglNrtnhz3O571zs3Ziqn+cU5hZFApS6lztW/yAp3fCwAOb/vqBmKU1PH3y j9eCYLNkp3yS0E6mUvqaAhNawpAXxmmQZFQyi2lf2yKx4WHnaNwQcO/eQ0SpUGCZv/wo+t9Vf676j QSMfj/rngBr37JfE7dPI7/wY5gOk1y/Fm4iHBEAkEtgLbHedhjj2ADl43hrjfz4v6ndffrd+tNPYk Bz7aJ1shN5qBCjI4LTm1Wt2XkeF2JXo9vCQaSrFsy6n8zwje+9uM8gT+ZRqITOaxZJ8G05hWmP5aK dRSKp2/kQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyuSM-0006mM-LZ; Mon, 11 Jan 2021 10:29:50 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyuSD-0006jY-VY; Mon, 11 Jan 2021 10:29:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 38316580557; Mon, 11 Jan 2021 05:29:38 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 11 Jan 2021 05:29:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=YZXFEHRVUr3V+AEbjPO03cseRYi /P0yN90ljuM26SGI=; b=MRgfIkzwwXAu8YfCHoQ23fXhAzYEI29Nf/Newf90lt9 xVdtsC7h/rt87eTugQSjxfJkxPhZy0/Ug7u6hMuKvPjWWhlFU62OXQ/cwZZPqMjB NAR8i0JhzqMMNBr0LQx1xnWUJPmUU6ULnDizMLBXGkaa6FMn2g4QBjfNUTMMRbsH zYggJ08uwk48zQ6o6r6KSUQhsDJ7O6rBhsgsitoAsdVaWCtflmpgCgnxngKoirfE LveMTcaN8w1svFThFcPUvhOKfyNxT1ziOwJR/7730PKOKOD16ulPGMydoFZn/dT3 ObLWe316nk0qoxQ3SGbSzdb8orEf2w+5FhmHsDS72vw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=YZXFEH RVUr3V+AEbjPO03cseRYi/P0yN90ljuM26SGI=; b=I4Hkn+41HffOpUEiy9af3c St7n4vY8+LuugawTrAwKqLHS1+BVr+Ml5AIRJKyE4ulz0epWl+FPUs5ot7X+j6Ov XAxfSvZrpA07TrPIPh4nKMG1iHZx0h8D9rfeyLzWnFBA5DYI2ta+lj8MMvfAaar/ 9wZvWTP9wu41C5B/F9b/61/4LmIjQX75Q0LJNIHqUPDajtuOhh6uOxhd0kncR2hP 9um+9IiNbz+JEMDVA4HmYvItB8p11z0qpHloH9eoyVHZQSg192iqrKUbS7ats7eA R46o0Z1V3s9O9YHa0FcUj0zLbXJJARegBeYHj/C6cZA3DNRl6mHJgQIicwnxeFug == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdehuddgudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepveegudetkeethfetgffgtdekkefghefhffefgeduleehgeehieeuveefgedv ieegnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepledtrdekledrieekrd ejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehm rgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 7CD5624005B; Mon, 11 Jan 2021 05:29:36 -0500 (EST) Date: Mon, 11 Jan 2021 11:29:35 +0100 From: Maxime Ripard To: Dave Stevenson Subject: Re: [PATCH 05/15] drm/vc4: hdmi: Restore cec physical address on reconnect Message-ID: <20210111102935.tyairu2pw2phfmfo@gilmour> References: <20201210134648.272857-1-maxime@cerno.tech> <20201210134648.272857-6-maxime@cerno.tech> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210111_052942_142325_24340258 X-CRM114-Status: GOOD ( 33.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Cooper , David Airlie , Marc Zyngier , Maarten Lankhorst , LKML , DRI Development , Dom Cobley , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Thomas Zimmermann , Hans Verkuil , Daniel Vetter , Thomas Gleixner , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Linux Media Mailing List Content-Type: multipart/mixed; boundary="===============3007865082432782697==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3007865082432782697== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qmysxmbkp2dmwhyb" Content-Disposition: inline --qmysxmbkp2dmwhyb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Dave, Thanks for your review On Fri, Dec 18, 2020 at 02:45:54PM +0000, Dave Stevenson wrote: > On Fri, 18 Dec 2020 at 14:21, Dave Stevenson > wrote: > > > > Hi Maxime & Dom > > > > On Thu, 10 Dec 2020 at 13:47, Maxime Ripard wrote: > > > > > > From: Dom Cobley > > > > > > Currently we call cec_phys_addr_invalidate on a hotplug deassert. > > > That may be due to a TV power cycling, or an AVR being switched > > > on (and switching edid). > > > > > > This makes CEC unusable since our controller wouldn't have a physical > > > address anymore. > > > > > > Set it back up again on the hotplug assert. > > > > > > Fixes: 15b4511a4af6 ("drm/vc4: add HDMI CEC support") > > > Signed-off-by: Dom Cobley > > > Signed-off-by: Maxime Ripard > > > --- > > > drivers/gpu/drm/vc4/vc4_hdmi.c | 25 +++++++++++++++++-------- > > > 1 file changed, 17 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4= _hdmi.c > > > index 28b78ea885ea..eff3bac562c6 100644 > > > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > > > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > > > @@ -136,20 +136,29 @@ static enum drm_connector_status > > > vc4_hdmi_connector_detect(struct drm_connector *connector, bool forc= e) > > > { > > > struct vc4_hdmi *vc4_hdmi =3D connector_to_vc4_hdmi(connector= ); > > > + bool connected =3D false; > > > > > > if (vc4_hdmi->hpd_gpio) { > > > if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^ > > > vc4_hdmi->hpd_active_low) > > > - return connector_status_connected; > > > - cec_phys_addr_invalidate(vc4_hdmi->cec_adap); > > > - return connector_status_disconnected; > > > - } > > > - > > > - if (drm_probe_ddc(vc4_hdmi->ddc)) > > > - return connector_status_connected; > > > - > > > + connected =3D true; > > > + } else if (drm_probe_ddc(vc4_hdmi->ddc)) > > > + connected =3D true; > > > if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) > > > > This needs to become an "else if(...". > > It used to be that all the other paths would return, so were mutually > > exclusive to this. Now they set a thing and keep going we need to > > avoid reading the register should there be a HPD gpio or the ddc probe > > succeeds. > > Memory says that otherwise Pi3 always reports connected. > > > > I fixed this in a downstream patch already - > > https://github.com/raspberrypi/linux/commit/d345caec1e9b2317b9cd7eb5b92= ae453a0d3e98c > > > > Otherwise fine. > > > > Dave > > > > > + connected =3D true; > > > + if (connected) { > > > + if (connector->status !=3D connector_status_connected= ) { > > > + struct edid *edid =3D drm_get_edid(connector,= vc4_hdmi->ddc); > > > + > > > + if (edid) { > > > + cec_s_phys_addr_from_edid(vc4_hdmi->c= ec_adap, edid); > > > + vc4_hdmi->encoder.hdmi_monitor =3D dr= m_detect_hdmi_monitor(edid); > > > + drm_connector_update_edid_property(co= nnector, edid); >=20 > Actually looking at this again in the context of the other changes, do > we need to call drm_connector_update_edid_property() here? >=20 > We've just called drm_get_edid() to get the edid, and that calls > drm_connector_update_edid_property() as well [1] Yeah, you're right I'll drop it > Updating vc4_hdmi->encoder.hdmi_monitor may be necessary. It's > otherwise done in vc4_hdmi_connector_get_modes, which I sort of expect > to be called almost immediately by the framework when connector_detect > returns "connected". I haven't checked if that is guaranteed though. >=20 > vc4_hdmi_connector_get_modes also includes a manual call to > drm_connector_update_edid_property after having just called > drm_get_edid, so that one feels redundant too. =2Eget_modes is called in drm_helper_probe_single_connector_modes, which is usually the helper set in .fill_modes. .fill_modes seems to only be called when either DRM_IOCTL_MODE_GETCONNECTOR is called, or when the connector status is forced through sysfs, so it doesn't look like it's done automatically. I'm not sure we need to set hdmi_monitor though, it's only used to configure the display related side, and that can't happen without get_modes being called. Maxime --qmysxmbkp2dmwhyb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX/wojwAKCRDj7w1vZxhR xc/UAP4uzcrDbeddwq8fB/meHTS+faUCJJfFGqyserLZSOQPawD+PaA4lSzVPlU4 Xk3OPdAtdOnLKH0IHfvlFUdE8CeZSAc= =GJnj -----END PGP SIGNATURE----- --qmysxmbkp2dmwhyb-- --===============3007865082432782697== 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 --===============3007865082432782697==--