]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/adl_p: Handle TC cold
authorJosé Roberto de Souza <jose.souza@intel.com>
Mon, 24 May 2021 21:48:02 +0000 (14:48 -0700)
committerJosé Roberto de Souza <jose.souza@intel.com>
Tue, 25 May 2021 17:30:24 +0000 (10:30 -0700)
On ADL-P TC cold is exited and blocked when legacy aux is powered,
that is exacly the same of what ICL need for static TC ports.

TODO: When a TBT hub or monitor is connected it will cause TBT and
legacy aux to be powered at the same time, hopefully this will not
cause any issues but if it do, some rework will be needed.

v2:
 - skip icl_tc_port_assert_ref_held() warn on, adl-p uses aux to
   block TC cold

v3:
 - Drop icl_tc_port_assert_ref_held() earlier return for adl_p, not
   needed anymore
 - Set timeout_expected when enabling aux power well as port could be
   disconnected when tc_cold_block() is called

BSpec: 55480
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Clinton Taylor <Clinton.A.Taylor@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Clint Taylor <Clinton.A.Taylor@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210524214805.259692-2-jose.souza@intel.com
drivers/gpu/drm/i915/display/intel_display_power.c
drivers/gpu/drm/i915/display/intel_tc.c
drivers/gpu/drm/i915/display/intel_tc.h

index 991ceea06a0743b5770f7a40cec535f80261af27..2f7d1664c4738a167b7589232ac81bb568573c19 100644 (file)
@@ -619,11 +619,9 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
         * or need to enable AUX on a legacy TypeC port as part of the TC-cold
         * exit sequence.
         */
-       timeout_expected = is_tbt;
-       if (DISPLAY_VER(dev_priv) == 11 && dig_port->tc_legacy_port) {
+       timeout_expected = is_tbt || intel_tc_cold_requires_aux_pw(dig_port);
+       if (DISPLAY_VER(dev_priv) == 11 && dig_port->tc_legacy_port)
                icl_tc_cold_exit(dev_priv);
-               timeout_expected = true;
-       }
 
        hsw_wait_for_power_well_enable(dev_priv, power_well, timeout_expected);
 
index db85e0e2031e05a369fe30c7e8e5c31514c575c4..c23c210a55f5c4eeec249e237f40688c7075fdf0 100644 (file)
@@ -26,9 +26,7 @@ static const char *tc_port_mode_name(enum tc_port_mode mode)
 static enum intel_display_power_domain
 tc_cold_get_power_domain(struct intel_digital_port *dig_port)
 {
-       struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
-
-       if (DISPLAY_VER(i915) == 11)
+       if (intel_tc_cold_requires_aux_pw(dig_port))
                return intel_legacy_aux_to_power_domain(dig_port->aux_ch);
        else
                return POWER_DOMAIN_TC_COLD_OFF;
@@ -564,7 +562,7 @@ static void intel_tc_port_reset_mode(struct intel_digital_port *dig_port,
        enum tc_port_mode old_tc_mode = dig_port->tc_mode;
 
        intel_display_power_flush_work(i915);
-       if (DISPLAY_VER(i915) != 11 || !dig_port->tc_legacy_port) {
+       if (!intel_tc_cold_requires_aux_pw(dig_port)) {
                enum intel_display_power_domain aux_domain;
                bool aux_powered;
 
@@ -781,3 +779,11 @@ void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy)
        dig_port->tc_link_refcount = 0;
        tc_port_load_fia_params(i915, dig_port);
 }
+
+bool intel_tc_cold_requires_aux_pw(struct intel_digital_port *dig_port)
+{
+       struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
+
+       return (DISPLAY_VER(i915) == 11 && dig_port->tc_legacy_port) ||
+               IS_ALDERLAKE_P(i915);
+}
index b619e4736f8550645e396dff6b43cb3f95f6e582..0eacbd76ec1556b906f208df1694c0294bdf308a 100644 (file)
@@ -29,4 +29,6 @@ bool intel_tc_port_ref_held(struct intel_digital_port *dig_port);
 
 void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy);
 
+bool intel_tc_cold_requires_aux_pw(struct intel_digital_port *dig_port);
+
 #endif /* __INTEL_TC_H__ */