drm/i915/tc: Check the PLL type used by an enabled TC port
authorImre Deak <imre.deak@intel.com>
Tue, 21 Mar 2023 22:01:01 +0000 (00:01 +0200)
committerImre Deak <imre.deak@intel.com>
Wed, 22 Mar 2023 18:31:23 +0000 (20:31 +0200)
commit10d29bdceef79602af4136c14a6ec391ec3a2e7f
tree0ff65819227444529890c14cec3aea8139b0a8d8
parent2a4d292f056b35f54cd7788e124937fe598369c4
drm/i915/tc: Check the PLL type used by an enabled TC port

The current way to determine during HW state sanitization if a PHY is
connected in the expected way doesn't work in all cases. The check for
this considers only the PHY ready/owned state and the initial TC mode
which was determined earlier by the TC port HW readout - using the
sink's HPD and the same PHY ready/owned states.

For instance for an enabled DP-alt/TBT port without the PHY ready/owned
flags set the initial mode will be TBT, and this will be regarded as a
valid PHY state. However it's possible that the port is actually enabled
in DP-alt mode, but for some reason the PHY ownership was not acquired.

Make sure the driver can detect invalid PHY states as in the above
example by checking the PHY ready/owned state wrt. the PLL type used.
This should be the TBT PLL if the PHY is not owned and the MG (non-TBT)
PLL if the PHY is owned.

v2: Rebased on change passing crtc_state in the previous patch.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230321220101.983366-3-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_tc.c