drm/i915/hdcp: reuse rx_info for mst stream type1 capability check
authorJuston Li <juston.li@intel.com>
Thu, 19 Aug 2021 18:48:35 +0000 (11:48 -0700)
committerAnshuman Gupta <anshuman.gupta@intel.com>
Thu, 9 Sep 2021 07:40:40 +0000 (13:10 +0530)
commit3e31d057431a4638f891db303044f761809adb86
tree624652854eeb0c39ec83a4021ec96b2bb33af7e5
parent0f317ebb5f7cb2b1d9a538c9795962fabd6e180e
drm/i915/hdcp: reuse rx_info for mst stream type1 capability check

On some MST docking stations, rx_info can only be read after
RepeaterAuth_Send_ReceiverID_List and the RxStatus READY bit is set
otherwise the read will return -EIO.

This behavior causes the mst stream type1 capability test to fail to
read rx_info and determine if the topology supports type1 and fallback
to type0.

To fix this, check for type1 capability when we receive rx_info within
the AKE flow when we read RepeaterAuth_Send_ReceiverID_List instead
of an explicit read just for type1 capability checking.

This does require moving where we set stream_types to after
hdcp2_authenticate_sink() when we get rx_info but this occurs before we
do hdcp2_propagate_stream_management_info.

Also, legacy HDCP 2.0/2.1 are not type 1 capable either so check for
that as well.

Changes since v5:
 - rename intel_set_stream_types() to intel_hdcp_prepare_streams()
   (Anshuman)

Changes since v4:
 - move topology_type1_capable to intel_digital_port and rename it as
   hdcp_mst_type1_capable (Anshuman)
 - make a helper function intel_set_stream_types() to set stream types
   in hdcp2_authenticate_and_encrypt() (Anshuman)
 - break on failure to set stream types and retry instead of returning
 - remove no longer used declaration for streams_type1_capable()

Changes since v2:
 - Remove no longer used variables in _intel_hdcp2_enable()

Signed-off-by: Juston Li <juston.li@intel.com>
Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
Tested-by: Suraj K <suraj.kandpal@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210819184835.1181323-4-juston.li@intel.com
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_dp_hdcp.c
drivers/gpu/drm/i915/display/intel_hdcp.c