}
static void set_drive_settings(struct dc *dc,
- struct link_training_settings *lt_settings)
+ struct link_training_settings *lt_settings,
+ const struct dc_link *link)
{
struct core_dc *core_dc = DC_TO_CORE(dc);
int i;
- for (i = 0; i < core_dc->link_count; i++)
- dc_link_dp_set_drive_settings(&core_dc->links[i]->public,
- lt_settings);
+ for (i = 0; i < core_dc->link_count; i++) {
+ if (&core_dc->links[i]->public == link)
+ break;
+ }
+
+ if (i >= core_dc->link_count)
+ ASSERT_CRITICAL(false);
+
+ dc_link_dp_set_drive_settings(&core_dc->links[i]->public, lt_settings);
}
static void perform_link_training(struct dc *dc,
link->link_enc,
SIGNAL_TYPE_DISPLAY_PORT);
- /* Clear current link setting.
- * memset(&link->public.cur_link_settings, 0,
- * sizeof(link->public.cur_link_settings));
- */
+ /* Clear current link setting. */
+ memset(&link->public.cur_link_settings, 0,
+ sizeof(link->public.cur_link_settings));
link->link_enc->funcs->enable_dp_output(
link->link_enc,
link_setting,
skip_video_pattern);
+ link->public.cur_link_settings = *link_setting;
+
link->dc->hwss.unblank_stream(&pipes[i],
link_setting);
}
struct dc_link_funcs {
void (*set_drive_settings)(struct dc *dc,
- struct link_training_settings *lt_settings);
+ struct link_training_settings *lt_settings,
+ const struct dc_link *link);
void (*perform_link_training)(struct dc *dc,
struct dc_link_settings *link_setting,
bool skip_video_pattern);
cntl.pixel_clock = link_settings->link_settings.link_rate *
LINK_RATE_REF_FREQ_IN_KHZ;
- for (lane = 0; lane < link_settings->link_settings.lane_count; ++lane) {
+ for (lane = 0; lane < link_settings->link_settings.lane_count; lane++) {
/* translate lane settings */
training_lane_set.bits.VOLTAGE_SWING_SET =