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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 0F67EC49361 for ; Mon, 28 Jun 2021 12:43:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CDC0B61C71 for ; Mon, 28 Jun 2021 12:43:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDC0B61C71 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C36A6E44C; Mon, 28 Jun 2021 12:43:10 +0000 (UTC) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0ADB96E44C for ; Mon, 28 Jun 2021 12:43:06 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 7CADE580502; Mon, 28 Jun 2021 08:43:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 28 Jun 2021 08:43:05 -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=fm3; bh=XbeJXieX961jY l/mtFMEcSGfZU89aIbI2/qpM1vzLmU=; b=GEKine4QE74BJXMm92Ef+PoQZNZmR 2fOIbqlJVSDJxEGg2VQEDNDA04ip/lmNe4ec9oGymrCxvEXDnp8NIOSgckgjD3vD MBYYYSw+s1hjyErAMFlP/MlYz+rNW/pcq6rcW+gI46eq6g9iev8+UlBb4tmj7jyK ACIlzfGmlpF1aeN9T1Ae78g6ieM+Sc7b74H6FnUip1XPW95DrFpiGeOlpewUvbmb mudglKOF15QIFzM5GPG5tghd4prQsM3PW/lT7hbv4+yam3jl3dzgaADoROmJqJLJ eaoE7QIY1kdNPMBygQ+3vX8gRE6nqCgeckuPQrqypRB7TobSQRu7mD/7w== 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= fm3; bh=XbeJXieX961jYl/mtFMEcSGfZU89aIbI2/qpM1vzLmU=; b=wUUbU8k9 0PeEIFV4eaUTzxvg/fEd0uzknfcZCrgRinpDtjx/2/wnz338T6no5SmDkU/MmhDw sJ2XkGkwUPcbUez9h/zqlYDJsn2WPc17T/gHAG+auZTOtshJ0ccULE13CQhLmKI5 +1e2VNL77rrrfSFPHgzerl1GdHU7HA+i0hDBnZIvGq7q7y/Ql5OTx5eudp/bfRKJ KCeIihqxAQ2D+INtP2VrUfv1InTVVC0MJbmcNWkhrxAVUZJ2JptKnsBRm6sePMI+ tToaoCMBx5beWreUEtF2C0JgGVB43yHSvkvGG/DUoKsPS0GZtDuLEmBF/Sfo+cLo FB85PW6w6a3nLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeehgedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Jun 2021 08:43:04 -0400 (EDT) From: Maxime Ripard To: Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Subject: [PATCH v5 02/10] drm/vc4: hdmi: Fix HPD GPIO detection Date: Mon, 28 Jun 2021 14:42:49 +0200 Message-Id: <20210628124257.140453-3-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210628124257.140453-1-maxime@cerno.tech> References: <20210628124257.140453-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Nicolas Saenz Julienne , Dom Cobley , Tim Gover , Dave Stevenson , linux-kernel@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Emma Anholt , Phil Elwell Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 b8b371abf3d7..e7fdda8a1bfa 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -167,9 +167,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); bool connected = false; - 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 if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) { connected = true; } -- 2.31.1 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 DA3F0C49EA3 for ; Mon, 28 Jun 2021 12:43:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE50B61C77 for ; Mon, 28 Jun 2021 12:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233035AbhF1Mph (ORCPT ); Mon, 28 Jun 2021 08:45:37 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:36839 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232943AbhF1Mpb (ORCPT ); Mon, 28 Jun 2021 08:45:31 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 7CADE580502; Mon, 28 Jun 2021 08:43:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 28 Jun 2021 08:43:05 -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=fm3; bh=XbeJXieX961jY l/mtFMEcSGfZU89aIbI2/qpM1vzLmU=; b=GEKine4QE74BJXMm92Ef+PoQZNZmR 2fOIbqlJVSDJxEGg2VQEDNDA04ip/lmNe4ec9oGymrCxvEXDnp8NIOSgckgjD3vD MBYYYSw+s1hjyErAMFlP/MlYz+rNW/pcq6rcW+gI46eq6g9iev8+UlBb4tmj7jyK ACIlzfGmlpF1aeN9T1Ae78g6ieM+Sc7b74H6FnUip1XPW95DrFpiGeOlpewUvbmb mudglKOF15QIFzM5GPG5tghd4prQsM3PW/lT7hbv4+yam3jl3dzgaADoROmJqJLJ eaoE7QIY1kdNPMBygQ+3vX8gRE6nqCgeckuPQrqypRB7TobSQRu7mD/7w== 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= fm3; bh=XbeJXieX961jYl/mtFMEcSGfZU89aIbI2/qpM1vzLmU=; b=wUUbU8k9 0PeEIFV4eaUTzxvg/fEd0uzknfcZCrgRinpDtjx/2/wnz338T6no5SmDkU/MmhDw sJ2XkGkwUPcbUez9h/zqlYDJsn2WPc17T/gHAG+auZTOtshJ0ccULE13CQhLmKI5 +1e2VNL77rrrfSFPHgzerl1GdHU7HA+i0hDBnZIvGq7q7y/Ql5OTx5eudp/bfRKJ KCeIihqxAQ2D+INtP2VrUfv1InTVVC0MJbmcNWkhrxAVUZJ2JptKnsBRm6sePMI+ tToaoCMBx5beWreUEtF2C0JgGVB43yHSvkvGG/DUoKsPS0GZtDuLEmBF/Sfo+cLo FB85PW6w6a3nLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeehgedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Jun 2021 08:43:04 -0400 (EDT) From: Maxime Ripard To: Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, Maxime Ripard , Emma Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , Eric Anholt , linux-kernel@vger.kernel.org Subject: [PATCH v5 02/10] drm/vc4: hdmi: Fix HPD GPIO detection Date: Mon, 28 Jun 2021 14:42:49 +0200 Message-Id: <20210628124257.140453-3-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210628124257.140453-1-maxime@cerno.tech> References: <20210628124257.140453-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 b8b371abf3d7..e7fdda8a1bfa 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -167,9 +167,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); bool connected = false; - 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 if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) { connected = true; } -- 2.31.1