OSDN Git Service

drm/dp: add helpers to read link training delays
authorJani Nikula <jani.nikula@intel.com>
Thu, 14 Oct 2021 15:00:57 +0000 (18:00 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 19 Oct 2021 08:29:51 +0000 (11:29 +0300)
commitba3078dad1401131293664733c15f6f066079de9
treeecba8d33960b5a04b1ffc503dc43aaa3437bd978
parent9962601ca5719050906915c3c33a63744ac7b15c
drm/dp: add helpers to read link training delays

The link training delays are different and/or available in different
DPCD offsets depending on:

- Clock recovery vs. channel equalization
- DPRX vs. LTTPR
- 128b/132b vs. 8b/10b
- DPCD 1.4+ vs. earlier

Add helpers to get the correct delays in us, reading DPCD if
necessary. This is more straightforward than trying to retrofit the
existing helpers to take 128b/132b into account.

Having to pass in the DPCD receiver cap field seems unavoidable, because
reading it involves checking the revision and reading extended receiver
cap. So unfortunately the interface is mixed cached and read as needed.

v2: Remove delay_us < 0 check and the whole local var (Ville)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211014150059.28957-1-jani.nikula@intel.com
drivers/gpu/drm/drm_dp_helper.c
include/drm/drm_dp_helper.h