drm/i915/dp: Sanitize DPCD revision check in intel_dp_get_dsc_sink_cap()
authorImre Deak <imre.deak@intel.com>
Wed, 11 Oct 2023 17:16:04 +0000 (20:16 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 16 Oct 2023 14:00:22 +0000 (17:00 +0300)
commit90780a633cec2c904adbd9027f003d7eea89254b
treeac767f9b8a7386fb58529aff1b1a33b1bb64f956
parent34d8311f4a1c464ae0ce4470f2e3932c1a40d83e
drm/i915/dp: Sanitize DPCD revision check in intel_dp_get_dsc_sink_cap()

Check only the eDP or the DP specific DPCD revision depending on the
sink type. Pass the corresponding revision to the function, which allows
getting the DSC caps of a branch device (in an MST topology, which has
its own DPCD and so DPCD revision).

While at it use DP_DPCD_REV_14 instead of open coding it and for clarity
add a separate function to read out the DSC capability on eDP.

v2:
- Use DP_DPCD_REV_14 instead of open coding it. (Stan)
- Check EDP_DCPD_REV/DPCD_REV in a clearer way. (Ville)
v3:
- Fix the read-out for eDP in intel_dp_detect().

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> (v1)
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v2)
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231011171606.2540078-1-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c