Commit 9100c359 authored by Melissa Wen's avatar Melissa Wen Committed by Alex Deucher

drm/amd/display: dc_link: code clean up on enable_link_dp function

Coding style clean up on enable_link_dp function as suggested by
checkpatch.pl:

CHECK: Lines should not end with a '('
WARNING: line over 80 characters
WARNING: suspect code indent for conditional statements (8, 24)
CHECK: braces {} should be used on all arms of this statement
ERROR: else should follow close brace '}'
CHECK: Comparison to NULL could be written
       "link->preferred_training_settings.fec_enable"
Signed-off-by: default avatarMelissa Wen <melissa.srw@gmail.com>
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e599f01f
...@@ -1498,9 +1498,8 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx) ...@@ -1498,9 +1498,8 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx)
} }
} }
static enum dc_status enable_link_dp( static enum dc_status enable_link_dp(struct dc_state *state,
struct dc_state *state, struct pipe_ctx *pipe_ctx)
struct pipe_ctx *pipe_ctx)
{ {
struct dc_stream_state *stream = pipe_ctx->stream; struct dc_stream_state *stream = pipe_ctx->stream;
enum dc_status status; enum dc_status status;
...@@ -1532,7 +1531,8 @@ static enum dc_status enable_link_dp( ...@@ -1532,7 +1531,8 @@ static enum dc_status enable_link_dp(
pipe_ctx->stream_res.pix_clk_params.requested_sym_clk = pipe_ctx->stream_res.pix_clk_params.requested_sym_clk =
link_settings.link_rate * LINK_RATE_REF_FREQ_IN_KHZ; link_settings.link_rate * LINK_RATE_REF_FREQ_IN_KHZ;
if (state->clk_mgr && !apply_seamless_boot_optimization) if (state->clk_mgr && !apply_seamless_boot_optimization)
state->clk_mgr->funcs->update_clocks(state->clk_mgr, state, false); state->clk_mgr->funcs->update_clocks(state->clk_mgr,
state, false);
// during mode switch we do DP_SET_POWER off then on, and OUI is lost // during mode switch we do DP_SET_POWER off then on, and OUI is lost
dpcd_set_source_specific_data(link); dpcd_set_source_specific_data(link);
...@@ -1540,21 +1540,20 @@ static enum dc_status enable_link_dp( ...@@ -1540,21 +1540,20 @@ static enum dc_status enable_link_dp(
skip_video_pattern = true; skip_video_pattern = true;
if (link_settings.link_rate == LINK_RATE_LOW) if (link_settings.link_rate == LINK_RATE_LOW)
skip_video_pattern = false; skip_video_pattern = false;
if (perform_link_training_with_retries( if (perform_link_training_with_retries(&link_settings,
&link_settings, skip_video_pattern,
skip_video_pattern, LINK_TRAINING_ATTEMPTS,
LINK_TRAINING_ATTEMPTS, pipe_ctx,
pipe_ctx, pipe_ctx->stream->signal)) {
pipe_ctx->stream->signal)) {
link->cur_link_settings = link_settings; link->cur_link_settings = link_settings;
status = DC_OK; status = DC_OK;
} } else {
else
status = DC_FAIL_DP_LINK_TRAINING; status = DC_FAIL_DP_LINK_TRAINING;
}
if (link->preferred_training_settings.fec_enable != NULL) if (link->preferred_training_settings.fec_enable)
fec_enable = *link->preferred_training_settings.fec_enable; fec_enable = *link->preferred_training_settings.fec_enable;
else else
fec_enable = true; fec_enable = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment