Lyude Paul 3d3721ccb1 drm/i915/dp: Extract drm_dp_read_downstream_info()
We're going to be doing the same probing process in nouveau for
determining downstream DP port capabilities, so let's deduplicate the
work by moving i915's code for handling this into a shared helper:
drm_dp_read_downstream_info().

Note that when we do this, we also do make some functional changes while
we're at it:
* We always clear the downstream port info before trying to read it,
  just to make things easier for the caller
* We skip reading downstream port info if the DPCD indicates that we
  don't support downstream port info
* We only read as many bytes as needed for the reported number of
  downstream ports, no sense in reading the whole thing every time

v2:
* Fixup logic for calculating the downstream port length to account for
  the fact that downstream port caps can be either 1 byte or 4 bytes
  long. We can actually skip fixing the max_clock/max_bpc helpers here
  since they all check for DP_DETAILED_CAP_INFO_AVAILABLE anyway.
* Fix ret code check for drm_dp_dpcd_read
v5:
* Change name from drm_dp_downstream_read_info() to
  drm_dp_read_downstream_info()
* Also, add "See Also" sections for the various downstream info
  functions (drm_dp_read_downstream_info(), drm_dp_downstream_max_clock(),
  drm_dp_downstream_max_bpc())

Reviewed-by: Sean Paul <sean@poorly.run>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200826182456.322681-14-lyude@redhat.com
2020-08-31 19:10:08 -04:00
..
2020-06-24 15:45:51 +10:00
2020-07-24 08:48:05 +10:00
2020-08-11 11:58:31 +10:00
2020-08-18 14:14:25 +02:00
2020-08-19 15:49:10 +02:00
2020-08-06 14:27:31 -07:00
2020-08-12 20:42:08 +02:00
2020-08-11 11:58:31 +10:00
2020-07-24 08:48:05 +10:00
2020-08-18 14:14:25 +02:00
2020-07-28 17:21:58 +02:00
2020-08-18 14:14:25 +02:00
2020-07-23 10:06:22 +02:00
2020-04-03 17:11:41 +02:00
2020-08-18 14:14:25 +02:00
2020-08-18 14:14:25 +02:00
2020-06-24 09:17:34 +02:00
2020-08-14 13:34:37 -07:00
2020-08-06 14:27:31 -07:00
2020-05-27 14:31:42 +03:00
2020-04-03 17:11:41 +02:00
2020-07-27 22:06:13 +02:00
2020-08-05 19:50:06 -07:00
2020-08-11 11:58:31 +10:00
2020-07-16 18:16:31 -04:00
2020-06-24 15:45:51 +10:00
2020-05-29 12:58:11 +02:00
2020-08-11 11:58:31 +10:00
2020-08-11 11:58:31 +10:00
2020-06-24 15:45:51 +10:00