Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp301233pxb; Mon, 25 Oct 2021 08:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0Y3XmxzsNWu9GQb/M21CVdl60Cc1cEo7bRF2cg5qDpa/jcHeN+RP2CrkL9E/AUidW2Cit X-Received: by 2002:a17:906:2653:: with SMTP id i19mr22940118ejc.193.1635176066985; Mon, 25 Oct 2021 08:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635176066; cv=none; d=google.com; s=arc-20160816; b=BMmyzqXB0VNy9KguYNxfTtLAzmWaaJnnPxhZv7I80H5jsvJWSGCLXRHCZc6CEoFTuC wk4fBDV7vU7KaI/PjUspDjmmAQ/oTm84qxq3ChBgw3zBq3/q0vKo1noakproSVH9s8NL QrRQs9d/tkBcAxWGAgrhKS0HrsbANPkCwdEkRxtwQwT2E9Vp4a4duazyk0RhN7wyurMG 6ERE5EkKKcRmFNBHttX83IyohgSfMH8ER5I4hBG5S6wAuGaHZXwayAAC6hRhKLwx63wa ousbK0LHAs5yBoVW6NhRjvBjT8dRPFEu5Taxz8i5TfnoofWB1V+OprusSc0DLpjBcRk/ 2ZNg== 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 :dkim-signature:dkim-signature; bh=apYCseIKPEa7TyvpW6vrDcktfnDBwxegPWvT7BJ6R7o=; b=ZcQOjERmmwOu5uigWgyZLcyZqiQa4lMYQFFvQ9uB6CNZtRoXystie2zrk+ee0NcPd6 Mw64XHZAeVyRk3S1QEiNCBvpA4W6syIrmA180WR+/FMUHEmvDh+NQ3HQ+SL1uziU6eav tjOxbz7ESzzgw0mV644BNQY3L19YuPEADVNb1RX7GtIkooHBZIgi+2cjuvwP/BtuqAGV 3LoA6LVVattds5WQTTEIzs8X4fU8SAcEiqBagqb+jg/i9uZr2YYR7ZKXfFcuvas6CdND S6PlgQ5CqfaaUgCviqkRZzJolFo5WC6vGGGJQC4+mvnN1BHtvVMiK36AT9V9+26b3weR dOnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=D+xlObxn; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=b6U++hPB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si22400218ejc.139.2021.10.25.08.34.02; Mon, 25 Oct 2021 08:34:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=D+xlObxn; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=b6U++hPB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233885AbhJYPbg (ORCPT + 99 others); Mon, 25 Oct 2021 11:31:36 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:39421 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233766AbhJYPbe (ORCPT ); Mon, 25 Oct 2021 11:31:34 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id B44C55806D4; Mon, 25 Oct 2021 11:29:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 25 Oct 2021 11:29:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=apYCseIKPEa7T yvpW6vrDcktfnDBwxegPWvT7BJ6R7o=; b=D+xlObxnqtG5KmvRn6mhjlRZmND2x 3yGVLDfxIsENjOLqkFjNvGt2/CiPPmyIo7g13uE9EwikIFMu6uMPv164wypXGVN+ Q/2LehDwKQeV9U83WMoQr43AMja1nr2RUNAxTaOgXwfj9mlSOAONboy5KuiA8a7k N3RxW0WiQV3BwYrBPNeJOwn6RVuLDKmgLQGBlwqCVRWeCEd3VGHbVr55KkRI5w5G Le643Exdj9+dmbsnOXR0DsTamlBtRheksGe9+vtOsIruIOmMH5GJ78MtJ/VVwqfD WUXagBHyYQDeXVxTaI4huHnT7mVjGx/nEu6oNWxeauKVSAT84f6/TDEcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=apYCseIKPEa7TyvpW6vrDcktfnDBwxegPWvT7BJ6R7o=; b=b6U++hPB FyMJhcR6QvSKJssGDL8QB2EGjQOcS4Bo5fO1VDMyvBClBu2LMFdbc0QtqhmzTOGJ mPCaNhySjKkaE4DG8b+Wf5kkxyWLXtq78PjcDiZb54V7HsPjXFZbAMZGea1YIEL9 l8vQgbDSycx5nNggH9bRUNDBZenpTiz9a0OZjiLrLi93Qhs2K4DJir8npd7TneBm +vSb0ECGQzBbvAE0UQJTQ284FtFDgpY6/T77MmWjPwCf3Y/qG+oVIIDKJFnJ2A5c +hVrgZNRptYKXPVqEuLcRFkduEVkvsR7P3yn4hrUg6HzFbsy4YiDfSbmW2+qmKwS iGmr8K9coD5BRw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefhedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Oct 2021 11:29:10 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Cc: linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Maxime Ripard , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, Emma Anholt , Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley Subject: [PATCH v8 02/10] drm/vc4: hdmi: Fix HPD GPIO detection Date: Mon, 25 Oct 2021 17:28:55 +0200 Message-Id: <20211025152903.1088803-3-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211025152903.1088803-1-maxime@cerno.tech> References: <20211025152903.1088803-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prior to commit 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod"), in the detect hook, if we had an HPD GPIO we would only rely on it and return whatever state it was in. However, that commit changed that by mistake to only consider the case where we have a GPIO and it returns a logical high, and would fall back to the other methods otherwise. Since we can read the EDIDs when the HPD signal is low on some displays, we changed the detection status from disconnected to connected, and we would ignore an HPD pulse. Fixes: 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 338968275724..dde67b991ae7 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -190,9 +190,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); - if (vc4_hdmi->hpd_gpio && - gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) { - connected = true; + if (vc4_hdmi->hpd_gpio) { + if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) + connected = true; } else { unsigned long flags; u32 hotplug; -- 2.31.1