drm/i915/display: Fix HPD short pulse handling for eDP
authorJosé Roberto de Souza <jose.souza@intel.com>
Fri, 11 Mar 2022 18:51:48 +0000 (10:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:40 +0000 (14:23 +0200)
[ 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 <anshuman.gupta@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220311185149.110527-1-jose.souza@intel.com
(cherry picked from commit 8f0c1c0949b609acfad62b8d5f742a3b5e7b05ab)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_pps.c
drivers/gpu/drm/i915/display/intel_pps.h

index dbff4b6aa22bf934d2bf24f1eeff3c05bf4209c3..631cf7d4323c8847e646ddeee4a2906c567a8421 100644 (file)
@@ -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
index a36ec4a818ff518fc6a9fb945f140676a08abf7a..466bf6820641d9ecfeb2d20bb051cc21c3bab666 100644 (file)
@@ -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;
index fbbcca782e7b6f8e5fe2e693d2d4db9cfc1b5ab2..9fe7be4fe867eeed441cd4b84d6e0947f7384e5e 100644 (file)
@@ -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);