mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 12:11:59 +02:00
drm/i915/dp: use generic poll_timeout_us() instead of wait_for() in link training
Prefer generic poll helpers over i915 custom helpers. The functional change is losing the exponentially growing sleep of wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us. Use an arbitrary constant 500 us sleep instead. The timeout remains at 500 ms. Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Link: https://lore.kernel.org/r/29ab4738758fe844dc1323c4a59d5d6bdcf87308.1756383233.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
39b555b3ea
commit
476721f28e
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/iopoll.h>
|
||||
|
||||
#include <drm/display/drm_dp_helper.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
|
@ -1135,15 +1136,19 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp,
|
|||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
|
||||
int ret;
|
||||
|
||||
intel_dp->link.active = true;
|
||||
|
||||
intel_dp_program_link_training_pattern(intel_dp, crtc_state, DP_PHY_DPRX,
|
||||
DP_TRAINING_PATTERN_DISABLE);
|
||||
|
||||
if (intel_dp_is_uhbr(crtc_state) &&
|
||||
wait_for(intel_dp_128b132b_intra_hop(intel_dp, crtc_state) == 0, 500)) {
|
||||
lt_dbg(intel_dp, DP_PHY_DPRX, "128b/132b intra-hop not clearing\n");
|
||||
if (intel_dp_is_uhbr(crtc_state)) {
|
||||
ret = poll_timeout_us(ret = intel_dp_128b132b_intra_hop(intel_dp, crtc_state),
|
||||
ret == 0,
|
||||
500, 500 * 1000, false);
|
||||
if (ret)
|
||||
lt_dbg(intel_dp, DP_PHY_DPRX, "128b/132b intra-hop not clearing\n");
|
||||
}
|
||||
|
||||
intel_hpd_unblock(encoder);
|
||||
|
|
@ -1581,8 +1586,12 @@ intel_dp_128b132b_link_train(struct intel_dp *intel_dp,
|
|||
int lttpr_count)
|
||||
{
|
||||
bool passed = false;
|
||||
int ret;
|
||||
|
||||
if (wait_for(intel_dp_128b132b_intra_hop(intel_dp, crtc_state) == 0, 500)) {
|
||||
ret = poll_timeout_us(ret = intel_dp_128b132b_intra_hop(intel_dp, crtc_state),
|
||||
ret == 0,
|
||||
500, 500 * 1000, false);
|
||||
if (ret) {
|
||||
lt_err(intel_dp, DP_PHY_DPRX, "128b/132b intra-hop not clear\n");
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user