Commit 4fe38194 authored by Mario Limonciello's avatar Mario Limonciello Committed by Alex Deucher

drm/amd: add some extra checks that is_dig_enabled is defined

There are a few places that this isn't checked that could potentially
be a NULL pointer access.
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 28fe4164
...@@ -77,7 +77,8 @@ int rn_get_active_display_cnt_wa( ...@@ -77,7 +77,8 @@ int rn_get_active_display_cnt_wa(
const struct dc_link *link = dc->links[i]; const struct dc_link *link = dc->links[i];
/* abusing the fact that the dig and phy are coupled to see if the phy is enabled */ /* abusing the fact that the dig and phy are coupled to see if the phy is enabled */
if (link->link_enc->funcs->is_dig_enabled(link->link_enc)) if (link->link_enc->funcs->is_dig_enabled &&
link->link_enc->funcs->is_dig_enabled(link->link_enc))
display_count++; display_count++;
} }
......
...@@ -1827,9 +1827,9 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) ...@@ -1827,9 +1827,9 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
if (edp_link != edp_streams[0]->link) if (edp_link != edp_streams[0]->link)
continue; continue;
// enable fastboot if backend is enabled on eDP // enable fastboot if backend is enabled on eDP
if (edp_link->link_enc->funcs->is_dig_enabled(edp_link->link_enc)) { if (edp_link->link_enc->funcs->is_dig_enabled &&
/* Set optimization flag on eDP stream*/ edp_link->link_enc->funcs->is_dig_enabled(edp_link->link_enc) &&
if (edp_link->link_status.link_active) { edp_link->link_status.link_active) {
edp_stream = edp_streams[0]; edp_stream = edp_streams[0];
can_apply_edp_fast_boot = !is_edp_ilr_optimization_required(edp_stream->link, &edp_stream->timing); can_apply_edp_fast_boot = !is_edp_ilr_optimization_required(edp_stream->link, &edp_stream->timing);
edp_stream->apply_edp_fast_boot_optimization = can_apply_edp_fast_boot; edp_stream->apply_edp_fast_boot_optimization = can_apply_edp_fast_boot;
...@@ -1839,7 +1839,6 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) ...@@ -1839,7 +1839,6 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
break; break;
} }
} }
}
// We are trying to enable eDP, don't power down VDD // We are trying to enable eDP, don't power down VDD
if (can_apply_edp_fast_boot) if (can_apply_edp_fast_boot)
keep_edp_vdd_on = true; keep_edp_vdd_on = 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