Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp979408pxb; Wed, 6 Apr 2022 05:55:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCMlSd7MpSRsrDuRli6rM1Z8cusU3UaZtKkOdN+FUAROrKcufbbCvP7+eTRGOatH616qIo X-Received: by 2002:a65:41cc:0:b0:380:6f53:a550 with SMTP id b12-20020a6541cc000000b003806f53a550mr6866639pgq.471.1649249742313; Wed, 06 Apr 2022 05:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249742; cv=none; d=google.com; s=arc-20160816; b=gRxcxCG3u/qnwanCzLT3zsZpeaUTOLNlyW7r5peKi575dYilkW8I2uPSUen4IMp4xn onje2R4veZRvZc9KUkdXp4OP5TzWmX9JLyaxFYKjWhZcU/ovRJux+Gkgu81Z1Sp4ScyK QSlOpSjzjTE5oXFmcOLtaaiqeiPNVcCkLAdWEUCBFlIIAV8lU8vLz0CY866ooJVLzmVJ FF7Qs/1vv0OyHO2kD8gQxq2mGDUIIWXxzVwKQ68oUYYBTVYLmH0dc17Bw07YxAwqPPzd 4K80cJyjMD9rNOM/19JHcv0kNADTPUTp8kzY5YWfFxiFcBnthC4mXNlq5DhMI09IxSjn Q3yw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GhYkUZTmh2L21pnVmEh8SyZtZTeCLe9Q1qmOQXIVBYM=; b=F/XyD6MAois6yZqsGyzAnLUeb2c5swo0r+qQ8D0e2JcW0BOPXa8byXr82okgt6me7s kvwR1Ye5IspPukGHbEq9vRNLck+CIg6Vobnmm5eUtAjXt6id1fNHlang3ThvPSYl1PcG ZGF5QZccYO5dR36TQcQIjWZrkiEsMG0mfo4F0Gz0B3zwJxudGR6HQIBy7iFSYabOnSq4 6pINnDhwQ4iR9S71tVA5e7u9RRIl2aIovn70zdJsJHMIga6wDTR9S9HDIdO3KtpDrcOV 7uOHEHJZjZXRr4N4B0wveO0Dzivz73Ll8bERLtLRttBTDFuS1IlLNqKqA0GXQ/2PfYxc 8iFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yjwe2PJv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id be3-20020a056a001f0300b004fa9a8cc0d2si15277716pfb.377.2022.04.06.05.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:55:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yjwe2PJv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 428A76276D4; Wed, 6 Apr 2022 03:03:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1842816AbiDFBe6 (ORCPT + 99 others); Tue, 5 Apr 2022 21:34:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349261AbiDEJtb (ORCPT ); Tue, 5 Apr 2022 05:49:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 169B1237C6; Tue, 5 Apr 2022 02:43:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B84A9B817D3; Tue, 5 Apr 2022 09:43:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05D38C385A2; Tue, 5 Apr 2022 09:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151798; bh=7Xpp+cKNrQRxV2DdvRzJyaHKgKrhq2oSnuOB1NF+8JU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yjwe2PJvCuy+q/CmP+Qw7WYmjGUJzuPNJXSALxybpVny87Sdwn0N8w/gMsIs3Qbb7 6YuwYQA6lDtCAxpky32JtkTi5BNxw+LO/Op5LBT9/rsmQrry2BKO0FdXufsi+IqfWZ siPpifPnChl8+SIo9VS+MjJL/vvepeOhOHfH6660= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anshuman Gupta , Jani Nikula , Uma Shankar , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= , Joonas Lahtinen , Sasha Levin Subject: [PATCH 5.15 546/913] drm/i915/display: Fix HPD short pulse handling for eDP Date: Tue, 5 Apr 2022 09:26:48 +0200 Message-Id: <20220405070356.214980113@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: José Roberto de Souza [ Upstream commit 3a84fd1ed53582b31e843a152ee3219e9e4ccb8c ] Commit 13ea6db2cf24 ("drm/i915/edp: Ignore short pulse when panel powered off") completely broke short pulse handling for eDP as it is usually generated by sink when it is displaying image and there is some error or status that source needs to handle. When power panel is enabled, this state is enough to power aux transactions and VDD override is disabled, so intel_pps_have_power() is always returning false causing short pulses to be ignored. So here better naming this function that intends to check if aux lines are powered to avoid the endless cycle mentioned in the commit being fixed and fixing the check for what it is intended. v2: - renamed to intel_pps_have_panel_power_or_vdd() - fixed indentation Fixes: 13ea6db2cf24 ("drm/i915/edp: Ignore short pulse when panel powered off") Cc: Anshuman Gupta Cc: Jani Nikula Cc: Uma Shankar Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220311185149.110527-1-jose.souza@intel.com (cherry picked from commit 8f0c1c0949b609acfad62b8d5f742a3b5e7b05ab) Signed-off-by: Joonas Lahtinen Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_pps.c | 6 +++--- drivers/gpu/drm/i915/display/intel_pps.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index dbff4b6aa22b..631cf7d4323c 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4599,7 +4599,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd) struct intel_dp *intel_dp = &dig_port->dp; if (dig_port->base.type == INTEL_OUTPUT_EDP && - (long_hpd || !intel_pps_have_power(intel_dp))) { + (long_hpd || !intel_pps_have_panel_power_or_vdd(intel_dp))) { /* * vdd off can generate a long/short pulse on eDP which * would require vdd on to handle it, and thus we diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c index a36ec4a818ff..466bf6820641 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -1074,14 +1074,14 @@ static void intel_pps_vdd_sanitize(struct intel_dp *intel_dp) edp_panel_vdd_schedule_off(intel_dp); } -bool intel_pps_have_power(struct intel_dp *intel_dp) +bool intel_pps_have_panel_power_or_vdd(struct intel_dp *intel_dp) { intel_wakeref_t wakeref; bool have_power = false; with_intel_pps_lock(intel_dp, wakeref) { - have_power = edp_have_panel_power(intel_dp) && - edp_have_panel_vdd(intel_dp); + have_power = edp_have_panel_power(intel_dp) || + edp_have_panel_vdd(intel_dp); } return have_power; diff --git a/drivers/gpu/drm/i915/display/intel_pps.h b/drivers/gpu/drm/i915/display/intel_pps.h index fbbcca782e7b..9fe7be4fe867 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.h +++ b/drivers/gpu/drm/i915/display/intel_pps.h @@ -36,7 +36,7 @@ void intel_pps_vdd_on(struct intel_dp *intel_dp); void intel_pps_on(struct intel_dp *intel_dp); void intel_pps_off(struct intel_dp *intel_dp); void intel_pps_vdd_off_sync(struct intel_dp *intel_dp); -bool intel_pps_have_power(struct intel_dp *intel_dp); +bool intel_pps_have_panel_power_or_vdd(struct intel_dp *intel_dp); void intel_pps_wait_power_cycle(struct intel_dp *intel_dp); void intel_pps_init(struct intel_dp *intel_dp); -- 2.34.1