Commit fd8cc371 authored by Charlene Liu's avatar Charlene Liu Committed by Alex Deucher

drm/amd/display: voltage request related change

Signed-off-by: default avatarCharlene Liu <charlene.liu@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Reviewed-by: default avatarKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e9029155
...@@ -1035,6 +1035,7 @@ static void get_ss_info_from_atombios( ...@@ -1035,6 +1035,7 @@ static void get_ss_info_from_atombios(
} }
*spread_spectrum_data = ss_data; *spread_spectrum_data = ss_data;
dm_free(ss_data);
dm_free(ss_info); dm_free(ss_info);
return; return;
......
...@@ -495,6 +495,7 @@ static void dce_clock_read_ss_info(struct dce_disp_clk *clk_dce) ...@@ -495,6 +495,7 @@ static void dce_clock_read_ss_info(struct dce_disp_clk *clk_dce)
} }
} }
static bool dce_apply_clock_voltage_request( static bool dce_apply_clock_voltage_request(
struct display_clock *clk, struct display_clock *clk,
enum dm_pp_clock_type clocks_type, enum dm_pp_clock_type clocks_type,
...@@ -502,6 +503,7 @@ static bool dce_apply_clock_voltage_request( ...@@ -502,6 +503,7 @@ static bool dce_apply_clock_voltage_request(
bool pre_mode_set, bool pre_mode_set,
bool update_dp_phyclk) bool update_dp_phyclk)
{ {
bool send_request = false;
struct dm_pp_clock_for_voltage_req clock_voltage_req = {0}; struct dm_pp_clock_for_voltage_req clock_voltage_req = {0};
switch (clocks_type) { switch (clocks_type) {
...@@ -522,9 +524,8 @@ static bool dce_apply_clock_voltage_request( ...@@ -522,9 +524,8 @@ static bool dce_apply_clock_voltage_request(
switch (clocks_type) { switch (clocks_type) {
case DM_PP_CLOCK_TYPE_DISPLAY_CLK: case DM_PP_CLOCK_TYPE_DISPLAY_CLK:
if (clocks_in_khz > clk->cur_clocks_value.dispclk_in_khz) { if (clocks_in_khz > clk->cur_clocks_value.dispclk_in_khz) {
dm_pp_apply_clock_for_voltage_request(
clk->ctx, &clock_voltage_req);
clk->cur_clocks_value.dispclk_notify_pplib_done = true; clk->cur_clocks_value.dispclk_notify_pplib_done = true;
send_request = true;
} else } else
clk->cur_clocks_value.dispclk_notify_pplib_done = false; clk->cur_clocks_value.dispclk_notify_pplib_done = false;
/* no matter incrase or decrase clock, update current clock value */ /* no matter incrase or decrase clock, update current clock value */
...@@ -532,9 +533,8 @@ static bool dce_apply_clock_voltage_request( ...@@ -532,9 +533,8 @@ static bool dce_apply_clock_voltage_request(
break; break;
case DM_PP_CLOCK_TYPE_PIXELCLK: case DM_PP_CLOCK_TYPE_PIXELCLK:
if (clocks_in_khz > clk->cur_clocks_value.max_pixelclk_in_khz) { if (clocks_in_khz > clk->cur_clocks_value.max_pixelclk_in_khz) {
dm_pp_apply_clock_for_voltage_request(
clk->ctx, &clock_voltage_req);
clk->cur_clocks_value.pixelclk_notify_pplib_done = true; clk->cur_clocks_value.pixelclk_notify_pplib_done = true;
send_request = true;
} else } else
clk->cur_clocks_value.pixelclk_notify_pplib_done = false; clk->cur_clocks_value.pixelclk_notify_pplib_done = false;
/* no matter incrase or decrase clock, update current clock value */ /* no matter incrase or decrase clock, update current clock value */
...@@ -542,9 +542,8 @@ static bool dce_apply_clock_voltage_request( ...@@ -542,9 +542,8 @@ static bool dce_apply_clock_voltage_request(
break; break;
case DM_PP_CLOCK_TYPE_DISPLAYPHYCLK: case DM_PP_CLOCK_TYPE_DISPLAYPHYCLK:
if (clocks_in_khz > clk->cur_clocks_value.max_non_dp_phyclk_in_khz) { if (clocks_in_khz > clk->cur_clocks_value.max_non_dp_phyclk_in_khz) {
dm_pp_apply_clock_for_voltage_request(
clk->ctx, &clock_voltage_req);
clk->cur_clocks_value.phyclk_notigy_pplib_done = true; clk->cur_clocks_value.phyclk_notigy_pplib_done = true;
send_request = true;
} else } else
clk->cur_clocks_value.phyclk_notigy_pplib_done = false; clk->cur_clocks_value.phyclk_notigy_pplib_done = false;
/* no matter incrase or decrase clock, update current clock value */ /* no matter incrase or decrase clock, update current clock value */
...@@ -554,29 +553,30 @@ static bool dce_apply_clock_voltage_request( ...@@ -554,29 +553,30 @@ static bool dce_apply_clock_voltage_request(
ASSERT(0); ASSERT(0);
break; break;
} }
} else { } else {
switch (clocks_type) { switch (clocks_type) {
case DM_PP_CLOCK_TYPE_DISPLAY_CLK: case DM_PP_CLOCK_TYPE_DISPLAY_CLK:
if (!clk->cur_clocks_value.dispclk_notify_pplib_done) if (!clk->cur_clocks_value.dispclk_notify_pplib_done)
dm_pp_apply_clock_for_voltage_request( send_request = true;
clk->ctx, &clock_voltage_req);
break; break;
case DM_PP_CLOCK_TYPE_PIXELCLK: case DM_PP_CLOCK_TYPE_PIXELCLK:
if (!clk->cur_clocks_value.pixelclk_notify_pplib_done) if (!clk->cur_clocks_value.pixelclk_notify_pplib_done)
dm_pp_apply_clock_for_voltage_request( send_request = true;
clk->ctx, &clock_voltage_req);
break; break;
case DM_PP_CLOCK_TYPE_DISPLAYPHYCLK: case DM_PP_CLOCK_TYPE_DISPLAYPHYCLK:
if (!clk->cur_clocks_value.phyclk_notigy_pplib_done) if (!clk->cur_clocks_value.phyclk_notigy_pplib_done)
dm_pp_apply_clock_for_voltage_request( send_request = true;
clk->ctx, &clock_voltage_req);
break; break;
default: default:
ASSERT(0); ASSERT(0);
break; break;
} }
} }
if (send_request) {
dm_pp_apply_clock_for_voltage_request(
clk->ctx, &clock_voltage_req);
}
if (update_dp_phyclk && (clocks_in_khz > if (update_dp_phyclk && (clocks_in_khz >
clk->cur_clocks_value.max_dp_phyclk_in_khz)) clk->cur_clocks_value.max_dp_phyclk_in_khz))
clk->cur_clocks_value.max_dp_phyclk_in_khz = clocks_in_khz; clk->cur_clocks_value.max_dp_phyclk_in_khz = clocks_in_khz;
...@@ -584,6 +584,7 @@ static bool dce_apply_clock_voltage_request( ...@@ -584,6 +584,7 @@ static bool dce_apply_clock_voltage_request(
return true; return true;
} }
static const struct display_clock_funcs dce120_funcs = { static const struct display_clock_funcs dce120_funcs = {
.get_dp_ref_clk_frequency = dce_clocks_get_dp_ref_freq, .get_dp_ref_clk_frequency = dce_clocks_get_dp_ref_freq,
.apply_clock_voltage_request = dce_apply_clock_voltage_request, .apply_clock_voltage_request = dce_apply_clock_voltage_request,
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "dm_services_types.h" #include "dm_services_types.h"
struct clocks_value { struct clocks_value {
int dispclk_in_khz; int dispclk_in_khz;
int max_pixelclk_in_khz; int max_pixelclk_in_khz;
...@@ -38,6 +39,7 @@ struct clocks_value { ...@@ -38,6 +39,7 @@ struct clocks_value {
bool phyclk_notigy_pplib_done; bool phyclk_notigy_pplib_done;
}; };
/* Structure containing all state-dependent clocks /* Structure containing all state-dependent clocks
* (dependent on "enum clocks_state") */ * (dependent on "enum clocks_state") */
struct state_dependent_clocks { struct state_dependent_clocks {
......
...@@ -64,6 +64,7 @@ enum dc_log_type { ...@@ -64,6 +64,7 @@ enum dc_log_type {
LOG_EVENT_UNDERFLOW, LOG_EVENT_UNDERFLOW,
LOG_IF_TRACE, LOG_IF_TRACE,
LOG_HW_MARKS, LOG_HW_MARKS,
LOG_PPLIB,
LOG_SECTION_TOTAL_COUNT LOG_SECTION_TOTAL_COUNT
}; };
......
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