Commit 15659045 authored by Bhawanpreet Lakha's avatar Bhawanpreet Lakha Committed by Alex Deucher

drm/amd/display: Clean up flattening core_dc to dc

Clean up some code related to flattening core_dc commit
(Remove redundent dc = dc, which was the result of removing
DC_TO_CORE() macro)
Signed-off-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9635b754
......@@ -983,15 +983,14 @@ bool dcn_validate_bandwidth(
if (v->voltage_level == 0 &&
(dc->debug.sr_exit_time_dpm0_ns
|| dc->debug.sr_enter_plus_exit_time_dpm0_ns)) {
struct dc *dc_core = dc;
if (dc->debug.sr_enter_plus_exit_time_dpm0_ns)
v->sr_enter_plus_exit_time =
dc->debug.sr_enter_plus_exit_time_dpm0_ns / 1000.0f;
if (dc->debug.sr_exit_time_dpm0_ns)
v->sr_exit_time = dc->debug.sr_exit_time_dpm0_ns / 1000.0f;
dc_core->dml.soc.sr_enter_plus_exit_time_us = v->sr_enter_plus_exit_time;
dc_core->dml.soc.sr_exit_time_us = v->sr_exit_time;
dc->dml.soc.sr_enter_plus_exit_time_us = v->sr_enter_plus_exit_time;
dc->dml.soc.sr_exit_time_us = v->sr_exit_time;
mode_support_and_system_configuration(v);
}
......@@ -1114,11 +1113,10 @@ bool dcn_validate_bandwidth(
}
if (v->voltage_level == 0) {
struct dc *dc_core = dc;
dc_core->dml.soc.sr_enter_plus_exit_time_us =
dc_core->dcn_soc->sr_enter_plus_exit_time;
dc_core->dml.soc.sr_exit_time_us = dc_core->dcn_soc->sr_exit_time;
dc->dml.soc.sr_enter_plus_exit_time_us =
dc->dcn_soc->sr_enter_plus_exit_time;
dc->dml.soc.sr_exit_time_us = dc->dcn_soc->sr_exit_time;
}
/*
......
This diff is collapsed.
......@@ -145,7 +145,6 @@ struct mod_freesync *mod_freesync_create(struct dc *dc)
struct core_freesync *core_freesync =
dm_alloc(sizeof(struct core_freesync));
struct dc *core_dc = dc;
struct persistent_data_flag flag;
......@@ -176,19 +175,19 @@ struct mod_freesync *mod_freesync_create(struct dc *dc)
/* Create initial module folder in registry for freesync enable data */
flag.save_per_edid = true;
flag.save_per_link = false;
dm_write_persistent_data(core_dc->ctx, NULL, FREESYNC_REGISTRY_NAME,
dm_write_persistent_data(dc->ctx, NULL, FREESYNC_REGISTRY_NAME,
NULL, NULL, 0, &flag);
flag.save_per_edid = false;
flag.save_per_link = false;
if (dm_read_persistent_data(core_dc->ctx, NULL, NULL,
if (dm_read_persistent_data(dc->ctx, NULL, NULL,
FREESYNC_NO_STATIC_FOR_INTERNAL_REGKEY,
&data, sizeof(data), &flag)) {
core_freesync->opts.drr_internal_supported =
(data & 1) ? false : true;
}
if (dm_read_persistent_data(core_dc->ctx, NULL, NULL,
if (dm_read_persistent_data(dc->ctx, NULL, NULL,
FREESYNC_NO_STATIC_FOR_EXTERNAL_DP_REGKEY,
&data, sizeof(data), &flag)) {
core_freesync->opts.drr_external_supported =
......@@ -245,7 +244,7 @@ static unsigned int map_index_from_stream(struct core_freesync *core_freesync,
bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
struct dc_stream_state *stream, struct mod_freesync_caps *caps)
{
struct dc *core_dc = NULL;
struct dc *dc = NULL;
struct core_freesync *core_freesync = NULL;
int persistent_freesync_enable = 0;
struct persistent_data_flag flag;
......@@ -256,7 +255,7 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
return false;
core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
core_dc = core_freesync->dc;
dc = core_freesync->dc;
flag.save_per_edid = true;
flag.save_per_link = false;
......@@ -287,7 +286,7 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
static_ramp.ramp_is_active = false;
/* get persistent data from registry */
if (dm_read_persistent_data(core_dc->ctx, stream->sink,
if (dm_read_persistent_data(dc->ctx, stream->sink,
FREESYNC_REGISTRY_NAME,
"userenable", &persistent_freesync_enable,
sizeof(int), &flag)) {
......@@ -970,14 +969,14 @@ bool mod_freesync_set_user_enable(struct mod_freesync *mod_freesync,
unsigned int stream_index, map_index;
int persistent_data = 0;
struct persistent_data_flag flag;
struct dc *core_dc = NULL;
struct dc *dc = NULL;
struct core_freesync *core_freesync = NULL;
if (mod_freesync == NULL)
return false;
core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
core_dc = core_freesync->dc;
dc = core_freesync->dc;
flag.save_per_edid = true;
flag.save_per_link = false;
......@@ -1001,7 +1000,7 @@ bool mod_freesync_set_user_enable(struct mod_freesync *mod_freesync,
enable_for_video)
persistent_data = persistent_data | 4;
dm_write_persistent_data(core_dc->ctx,
dm_write_persistent_data(dc->ctx,
streams[stream_index]->sink,
FREESYNC_REGISTRY_NAME,
"userenable",
......
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