Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp663410pxb; Tue, 5 Apr 2022 17:50:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1XT1aaWcxY8d1TXvaTIs21ZD8j1p6PKFXBUJ82eSHlpgqVLlPtIRkCH8X9IjqVE5VA2d5 X-Received: by 2002:a17:907:3f03:b0:6df:b04b:8712 with SMTP id hq3-20020a1709073f0300b006dfb04b8712mr6122836ejc.290.1649206251077; Tue, 05 Apr 2022 17:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206251; cv=none; d=google.com; s=arc-20160816; b=qn+qfwN7oVfYgsvJYT/EBhPahCzXFXGTTgCfmHOnnvUDp8dK+MwtHKogLuqWyY/2/N W/s045nZea3hk3n8y49UHLKS+gqxmtZjgAQcn3derdPtjN9qk6Kl6B+5g5jqRHkeUsJK mU3bjoZq8BNBkXdpMG5FR0aO/7cBGFYN4XSQpyE7aSAXseMmIJOHYLVG1jvWtFTRHwtF el71EjYBNR2OsTjG9f818ZCf7Pr8mtejKoY0RwQmL03Gt82IZzFJ3UCVHL2U7SiE1qoM NQwGMMuU/DACMi4zA1h9L4F5UkDm2Yfu8zWT5HrK1GSxbcmeD5PcEwUsoPa8a8YPglfK Itlg== 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=wuuO9jKWVbnGmVc6DXtfbS+yG1S3VH0/x6QI1RpXMJs=; b=L0/mcHsvnHVLKTJ2tGO4CJewmvvewPD6u31hhnw0ZQOi6DkhbYCEYtpu5GYSqH5x4B ItpbUE98hQW0xCd9vukjY0gcyi7QY4YictQRD5H8Ysw4Jw0VZtMKbqaNpz/s9Nwvej4z bvMhQIRmVqsLL95ozqMVCP/RW6FXLjzzGXwL+iu4+4EprTsqHDRYKQFb4b/UZCpvhIS+ aGzPfY6kLVAi222NRRjcHXwq2qfrbQ9xX6ukFj6UjJ/2UEuqKbh+XmI7VEOINre++l5K 5r72NlmC99UWHDVzUA1Tzb4op4nycpoY66oERtvyk/ZqObWkM/JQTYLmLKSpfTUN8P0T +owA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YKUgSecn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a170906448e00b006df76385f02si10569690ejo.930.2022.04.05.17.50.26; Tue, 05 Apr 2022 17:50:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YKUgSecn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358646AbiDEMvi (ORCPT + 99 others); Tue, 5 Apr 2022 08:51:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243987AbiDEJJl (ORCPT ); Tue, 5 Apr 2022 05:09:41 -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 0CEE333E34; Tue, 5 Apr 2022 01:58:56 -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 9A388B81BAE; Tue, 5 Apr 2022 08:58:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2167C385A4; Tue, 5 Apr 2022 08:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149133; bh=BA5ghAF4QIveOcckKBPXs60Hycz0YHWwpwRKq2eF7wY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YKUgSecn9BfrXv6T1D3P19DbcPooUPFC9wE66ra4AssSREu0PEJzVv5Wc2JOWuhlW QIT/ZnbC9wSu8Grm7GikCc7mJ48tX00+q17Okxx9Jx8AxTfOhjMV+Wpp3u2vqTRL4B BXbNOqJcyrsE/L3Hghap6/leeuQld/AQIAWxzORs= 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.16 0607/1017] drm/i915/display: Fix HPD short pulse handling for eDP Date: Tue, 5 Apr 2022 09:25:20 +0200 Message-Id: <20220405070412.296627971@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 a552f05a67e5..3ee0f2fc9c21 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4742,7 +4742,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 e9c679bb1b2e..5edd188d9747 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -1075,14 +1075,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 fbb47f6f453e..e64144659d31 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.h +++ b/drivers/gpu/drm/i915/display/intel_pps.h @@ -37,7 +37,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