Commit 24f7dd7e authored by Dmytro Laktyushkin's avatar Dmytro Laktyushkin Committed by Alex Deucher

drm/amd/display: move pplib/smu notification to dccg block

This is done to clear up the clock programming sequence
since the only time we need to notify pplib is after
clock update.

This also renames the clk block to dccg, at the moment
this block contains both clock management and dccg
functionality.
Signed-off-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 72942b3d
...@@ -957,8 +957,6 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c ...@@ -957,8 +957,6 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
} }
/* Program hardware */ /* Program hardware */
dc->hwss.ready_shared_resources(dc, context);
for (i = 0; i < dc->res_pool->pipe_count; i++) { for (i = 0; i < dc->res_pool->pipe_count; i++) {
pipe = &context->res_ctx.pipe_ctx[i]; pipe = &context->res_ctx.pipe_ctx[i];
dc->hwss.wait_for_mpcc_disconnect(dc, dc->res_pool, pipe); dc->hwss.wait_for_mpcc_disconnect(dc, dc->res_pool, pipe);
...@@ -1020,8 +1018,6 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c ...@@ -1020,8 +1018,6 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
dc_retain_state(dc->current_state); dc_retain_state(dc->current_state);
dc->hwss.optimize_shared_resources(dc);
return result; return result;
} }
...@@ -1448,12 +1444,8 @@ static void commit_planes_do_stream_update(struct dc *dc, ...@@ -1448,12 +1444,8 @@ static void commit_planes_do_stream_update(struct dc *dc,
if (stream_update->dpms_off) { if (stream_update->dpms_off) {
if (*stream_update->dpms_off) { if (*stream_update->dpms_off) {
core_link_disable_stream(pipe_ctx, KEEP_ACQUIRED_RESOURCE); core_link_disable_stream(pipe_ctx, KEEP_ACQUIRED_RESOURCE);
dc->hwss.pplib_apply_display_requirements(
dc, dc->current_state);
notify_display_count_to_smu(dc, dc->current_state); notify_display_count_to_smu(dc, dc->current_state);
} else { } else {
dc->hwss.pplib_apply_display_requirements(
dc, dc->current_state);
notify_display_count_to_smu(dc, dc->current_state); notify_display_count_to_smu(dc, dc->current_state);
core_link_enable_stream(dc->current_state, pipe_ctx); core_link_enable_stream(dc->current_state, pipe_ctx);
} }
......
...@@ -1357,28 +1357,13 @@ static enum dc_status enable_link_dp( ...@@ -1357,28 +1357,13 @@ static enum dc_status enable_link_dp(
struct dc_link *link = stream->sink->link; struct dc_link *link = stream->sink->link;
struct dc_link_settings link_settings = {0}; struct dc_link_settings link_settings = {0};
enum dp_panel_mode panel_mode; enum dp_panel_mode panel_mode;
enum dc_link_rate max_link_rate = LINK_RATE_HIGH2;
/* get link settings for video mode timing */ /* get link settings for video mode timing */
decide_link_settings(stream, &link_settings); decide_link_settings(stream, &link_settings);
/* raise clock state for HBR3 if required. Confirmed with HW DCE/DPCS pipe_ctx->stream_res.pix_clk_params.requested_sym_clk =
* logic for HBR3 still needs Nominal (0.8V) on VDDC rail link_settings.link_rate * LINK_RATE_REF_FREQ_IN_KHZ;
*/ state->dccg->funcs->update_clocks(state->dccg, state, false);
if (link->link_enc->features.flags.bits.IS_HBR3_CAPABLE)
max_link_rate = LINK_RATE_HIGH3;
if (link_settings.link_rate == max_link_rate) {
struct dc_clocks clocks = state->bw.dcn.clk;
/* dce/dcn compat, do not update dispclk */
clocks.dispclk_khz = 0;
/* 27mhz = 27000000hz= 27000khz */
clocks.phyclk_khz = link_settings.link_rate * 27000;
state->dis_clk->funcs->update_clocks(
state->dis_clk, &clocks, false);
}
dp_enable_link_phy( dp_enable_link_phy(
link, link,
......
...@@ -2071,7 +2071,7 @@ void dc_resource_state_construct( ...@@ -2071,7 +2071,7 @@ void dc_resource_state_construct(
const struct dc *dc, const struct dc *dc,
struct dc_state *dst_ctx) struct dc_state *dst_ctx)
{ {
dst_ctx->dis_clk = dc->res_pool->dccg; dst_ctx->dccg = dc->res_pool->dccg;
} }
enum dc_status dc_validate_global_state( enum dc_status dc_validate_global_state(
......
...@@ -304,11 +304,6 @@ struct dc { ...@@ -304,11 +304,6 @@ struct dc {
struct hw_sequencer_funcs hwss; struct hw_sequencer_funcs hwss;
struct dce_hwseq *hwseq; struct dce_hwseq *hwseq;
/* temp store of dm_pp_display_configuration
* to compare to see if display config changed
*/
struct dm_pp_display_configuration prev_display_config;
bool optimized_required; bool optimized_required;
/* FBC compressor */ /* FBC compressor */
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include "display_clock.h" #include "display_clock.h"
#define MEMORY_TYPE_MULTIPLIER_CZ 4
#define CLK_COMMON_REG_LIST_DCE_BASE() \ #define CLK_COMMON_REG_LIST_DCE_BASE() \
.DPREFCLK_CNTL = mmDPREFCLK_CNTL, \ .DPREFCLK_CNTL = mmDPREFCLK_CNTL, \
.DENTIST_DISPCLK_CNTL = mmDENTIST_DISPCLK_CNTL .DENTIST_DISPCLK_CNTL = mmDENTIST_DISPCLK_CNTL
...@@ -69,8 +71,8 @@ struct dccg_registers { ...@@ -69,8 +71,8 @@ struct dccg_registers {
struct dce_dccg { struct dce_dccg {
struct dccg base; struct dccg base;
const struct dccg_registers *regs; const struct dccg_registers *regs;
const struct dccg_shift *clk_shift; const struct dccg_shift *dccg_shift;
const struct dccg_mask *clk_mask; const struct dccg_mask *dccg_mask;
struct state_dependent_clocks max_clks_by_state[DM_PP_CLOCKS_MAX_STATES]; struct state_dependent_clocks max_clks_by_state[DM_PP_CLOCKS_MAX_STATES];
......
...@@ -105,74 +105,24 @@ bool dce100_enable_display_power_gating( ...@@ -105,74 +105,24 @@ bool dce100_enable_display_power_gating(
return false; return false;
} }
static void dce100_pplib_apply_display_requirements(
struct dc *dc,
struct dc_state *context)
{
struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
pp_display_cfg->avail_mclk_switch_time_us =
dce110_get_min_vblank_time_us(context);
/*pp_display_cfg->min_memory_clock_khz = context->bw.dce.yclk_khz
/ MEMORY_TYPE_MULTIPLIER;*/
dce110_fill_display_configs(context, pp_display_cfg);
if (memcmp(&dc->prev_display_config, pp_display_cfg, sizeof(
struct dm_pp_display_configuration)) != 0)
dm_pp_apply_display_requirements(dc->ctx, pp_display_cfg);
dc->prev_display_config = *pp_display_cfg;
}
/* unit: in_khz before mode set, get pixel clock from context. ASIC register
* may not be programmed yet
*/
static uint32_t get_max_pixel_clock_for_all_paths(
struct dc *dc,
struct dc_state *context)
{
uint32_t max_pix_clk = 0;
int i;
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream == NULL)
continue;
/* do not check under lay */
if (pipe_ctx->top_pipe)
continue;
if (pipe_ctx->stream_res.pix_clk_params.requested_pix_clk > max_pix_clk)
max_pix_clk =
pipe_ctx->stream_res.pix_clk_params.requested_pix_clk;
}
return max_pix_clk;
}
void dce100_set_bandwidth( void dce100_set_bandwidth(
struct dc *dc, struct dc *dc,
struct dc_state *context, struct dc_state *context,
bool decrease_allowed) bool decrease_allowed)
{ {
struct dc_clocks req_clks; int dispclk_khz = context->bw.dce.dispclk_khz;
req_clks.dispclk_khz = context->bw.dce.dispclk_khz * 115 / 100; context->bw.dce.dispclk_khz = context->bw.dce.dispclk_khz * 115 / 100;
req_clks.phyclk_khz = get_max_pixel_clock_for_all_paths(dc, context);
dce110_set_safe_displaymarks(&context->res_ctx, dc->res_pool); dce110_set_safe_displaymarks(&context->res_ctx, dc->res_pool);
dc->res_pool->dccg->funcs->update_clocks( dc->res_pool->dccg->funcs->update_clocks(
dc->res_pool->dccg, dc->res_pool->dccg,
&req_clks, context,
decrease_allowed); decrease_allowed);
context->bw.dce.dispclk_khz = dispclk_khz;
dce100_pplib_apply_display_requirements(dc, context);
} }
/**************************************************************************/ /**************************************************************************/
void dce100_hw_sequencer_construct(struct dc *dc) void dce100_hw_sequencer_construct(struct dc *dc)
...@@ -181,7 +131,5 @@ void dce100_hw_sequencer_construct(struct dc *dc) ...@@ -181,7 +131,5 @@ void dce100_hw_sequencer_construct(struct dc *dc)
dc->hwss.enable_display_power_gating = dce100_enable_display_power_gating; dc->hwss.enable_display_power_gating = dce100_enable_display_power_gating;
dc->hwss.set_bandwidth = dce100_set_bandwidth; dc->hwss.set_bandwidth = dce100_set_bandwidth;
dc->hwss.pplib_apply_display_requirements =
dce100_pplib_apply_display_requirements;
} }
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* Authors: AMD * Authors: AMD
* *
*/ */
#include "../dce/dce_clocks.h"
#include "dm_services.h" #include "dm_services.h"
#include "link_encoder.h" #include "link_encoder.h"
...@@ -40,7 +41,6 @@ ...@@ -40,7 +41,6 @@
#include "dce/dce_ipp.h" #include "dce/dce_ipp.h"
#include "dce/dce_transform.h" #include "dce/dce_transform.h"
#include "dce/dce_opp.h" #include "dce/dce_opp.h"
#include "dce/dce_clocks.h"
#include "dce/dce_clock_source.h" #include "dce/dce_clock_source.h"
#include "dce/dce_audio.h" #include "dce/dce_audio.h"
#include "dce/dce_hwseq.h" #include "dce/dce_hwseq.h"
...@@ -767,7 +767,7 @@ bool dce100_validate_bandwidth( ...@@ -767,7 +767,7 @@ bool dce100_validate_bandwidth(
if (at_least_one_pipe) { if (at_least_one_pipe) {
/* TODO implement when needed but for now hardcode max value*/ /* TODO implement when needed but for now hardcode max value*/
context->bw.dce.dispclk_khz = 681000; context->bw.dce.dispclk_khz = 681000;
context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER; context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER_CZ;
} else { } else {
context->bw.dce.dispclk_khz = 0; context->bw.dce.dispclk_khz = 0;
context->bw.dce.yclk_khz = 0; context->bw.dce.yclk_khz = 0;
......
...@@ -1192,8 +1192,8 @@ static void build_audio_output( ...@@ -1192,8 +1192,8 @@ static void build_audio_output(
if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT || if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) { pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
audio_output->pll_info.dp_dto_source_clock_in_khz = audio_output->pll_info.dp_dto_source_clock_in_khz =
state->dis_clk->funcs->get_dp_ref_clk_frequency( state->dccg->funcs->get_dp_ref_clk_frequency(
state->dis_clk); state->dccg);
} }
audio_output->pll_info.feed_back_divider = audio_output->pll_info.feed_back_divider =
...@@ -1743,34 +1743,6 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx, ...@@ -1743,34 +1743,6 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
set_static_screen_control(pipe_ctx[i]->stream_res.tg, value); set_static_screen_control(pipe_ctx[i]->stream_res.tg, value);
} }
/* unit: in_khz before mode set, get pixel clock from context. ASIC register
* may not be programmed yet
*/
static uint32_t get_max_pixel_clock_for_all_paths(
struct dc *dc,
struct dc_state *context)
{
uint32_t max_pix_clk = 0;
int i;
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream == NULL)
continue;
/* do not check under lay */
if (pipe_ctx->top_pipe)
continue;
if (pipe_ctx->stream_res.pix_clk_params.requested_pix_clk > max_pix_clk)
max_pix_clk =
pipe_ctx->stream_res.pix_clk_params.requested_pix_clk;
}
return max_pix_clk;
}
/* /*
* Check if FBC can be enabled * Check if FBC can be enabled
*/ */
...@@ -2380,191 +2352,22 @@ static void init_hw(struct dc *dc) ...@@ -2380,191 +2352,22 @@ static void init_hw(struct dc *dc)
} }
void dce110_fill_display_configs( void dce110_set_bandwidth(
const struct dc_state *context,
struct dm_pp_display_configuration *pp_display_cfg)
{
int j;
int num_cfgs = 0;
for (j = 0; j < context->stream_count; j++) {
int k;
const struct dc_stream_state *stream = context->streams[j];
struct dm_pp_single_disp_config *cfg =
&pp_display_cfg->disp_configs[num_cfgs];
const struct pipe_ctx *pipe_ctx = NULL;
for (k = 0; k < MAX_PIPES; k++)
if (stream == context->res_ctx.pipe_ctx[k].stream) {
pipe_ctx = &context->res_ctx.pipe_ctx[k];
break;
}
ASSERT(pipe_ctx != NULL);
/* only notify active stream */
if (stream->dpms_off)
continue;
num_cfgs++;
cfg->signal = pipe_ctx->stream->signal;
cfg->pipe_idx = pipe_ctx->stream_res.tg->inst;
cfg->src_height = stream->src.height;
cfg->src_width = stream->src.width;
cfg->ddi_channel_mapping =
stream->sink->link->ddi_channel_mapping.raw;
cfg->transmitter =
stream->sink->link->link_enc->transmitter;
cfg->link_settings.lane_count =
stream->sink->link->cur_link_settings.lane_count;
cfg->link_settings.link_rate =
stream->sink->link->cur_link_settings.link_rate;
cfg->link_settings.link_spread =
stream->sink->link->cur_link_settings.link_spread;
cfg->sym_clock = stream->phy_pix_clk;
/* Round v_refresh*/
cfg->v_refresh = stream->timing.pix_clk_khz * 1000;
cfg->v_refresh /= stream->timing.h_total;
cfg->v_refresh = (cfg->v_refresh + stream->timing.v_total / 2)
/ stream->timing.v_total;
}
pp_display_cfg->display_count = num_cfgs;
}
uint32_t dce110_get_min_vblank_time_us(const struct dc_state *context)
{
uint8_t j;
uint32_t min_vertical_blank_time = -1;
for (j = 0; j < context->stream_count; j++) {
struct dc_stream_state *stream = context->streams[j];
uint32_t vertical_blank_in_pixels = 0;
uint32_t vertical_blank_time = 0;
vertical_blank_in_pixels = stream->timing.h_total *
(stream->timing.v_total
- stream->timing.v_addressable);
vertical_blank_time = vertical_blank_in_pixels
* 1000 / stream->timing.pix_clk_khz;
if (min_vertical_blank_time > vertical_blank_time)
min_vertical_blank_time = vertical_blank_time;
}
return min_vertical_blank_time;
}
static int determine_sclk_from_bounding_box(
const struct dc *dc,
int required_sclk)
{
int i;
/*
* Some asics do not give us sclk levels, so we just report the actual
* required sclk
*/
if (dc->sclk_lvls.num_levels == 0)
return required_sclk;
for (i = 0; i < dc->sclk_lvls.num_levels; i++) {
if (dc->sclk_lvls.clocks_in_khz[i] >= required_sclk)
return dc->sclk_lvls.clocks_in_khz[i];
}
/*
* even maximum level could not satisfy requirement, this
* is unexpected at this stage, should have been caught at
* validation time
*/
ASSERT(0);
return dc->sclk_lvls.clocks_in_khz[dc->sclk_lvls.num_levels - 1];
}
static void pplib_apply_display_requirements(
struct dc *dc,
struct dc_state *context)
{
struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
pp_display_cfg->all_displays_in_sync =
context->bw.dce.all_displays_in_sync;
pp_display_cfg->nb_pstate_switch_disable =
context->bw.dce.nbp_state_change_enable == false;
pp_display_cfg->cpu_cc6_disable =
context->bw.dce.cpuc_state_change_enable == false;
pp_display_cfg->cpu_pstate_disable =
context->bw.dce.cpup_state_change_enable == false;
pp_display_cfg->cpu_pstate_separation_time =
context->bw.dce.blackout_recovery_time_us;
pp_display_cfg->min_memory_clock_khz = context->bw.dce.yclk_khz
/ MEMORY_TYPE_MULTIPLIER;
pp_display_cfg->min_engine_clock_khz = determine_sclk_from_bounding_box(
dc,
context->bw.dce.sclk_khz);
pp_display_cfg->min_engine_clock_deep_sleep_khz
= context->bw.dce.sclk_deep_sleep_khz;
pp_display_cfg->avail_mclk_switch_time_us =
dce110_get_min_vblank_time_us(context);
/* TODO: dce11.2*/
pp_display_cfg->avail_mclk_switch_time_in_disp_active_us = 0;
pp_display_cfg->disp_clk_khz = dc->res_pool->dccg->clks.dispclk_khz;
dce110_fill_display_configs(context, pp_display_cfg);
/* TODO: is this still applicable?*/
if (pp_display_cfg->display_count == 1) {
const struct dc_crtc_timing *timing =
&context->streams[0]->timing;
pp_display_cfg->crtc_index =
pp_display_cfg->disp_configs[0].pipe_idx;
pp_display_cfg->line_time_in_us = timing->h_total * 1000
/ timing->pix_clk_khz;
}
if (memcmp(&dc->prev_display_config, pp_display_cfg, sizeof(
struct dm_pp_display_configuration)) != 0)
dm_pp_apply_display_requirements(dc->ctx, pp_display_cfg);
dc->prev_display_config = *pp_display_cfg;
}
static void dce110_set_bandwidth(
struct dc *dc, struct dc *dc,
struct dc_state *context, struct dc_state *context,
bool decrease_allowed) bool decrease_allowed)
{ {
struct dc_clocks req_clks;
struct dccg *dccg = dc->res_pool->dccg; struct dccg *dccg = dc->res_pool->dccg;
req_clks.dispclk_khz = context->bw.dce.dispclk_khz;
req_clks.phyclk_khz = get_max_pixel_clock_for_all_paths(dc, context);
if (decrease_allowed) if (decrease_allowed)
dce110_set_displaymarks(dc, context); dce110_set_displaymarks(dc, context);
else else
dce110_set_safe_displaymarks(&context->res_ctx, dc->res_pool); dce110_set_safe_displaymarks(&context->res_ctx, dc->res_pool);
if (dccg->funcs->update_dfs_bypass)
dccg->funcs->update_dfs_bypass(
dccg,
dc,
context,
req_clks.dispclk_khz);
dccg->funcs->update_clocks( dccg->funcs->update_clocks(
dccg, dccg,
&req_clks, context,
decrease_allowed); decrease_allowed);
pplib_apply_display_requirements(dc, context);
} }
static void dce110_program_front_end_for_pipe( static void dce110_program_front_end_for_pipe(
...@@ -2839,10 +2642,6 @@ void dce110_set_cursor_attribute(struct pipe_ctx *pipe_ctx) ...@@ -2839,10 +2642,6 @@ void dce110_set_cursor_attribute(struct pipe_ctx *pipe_ctx)
pipe_ctx->plane_res.xfm, attributes); pipe_ctx->plane_res.xfm, attributes);
} }
static void ready_shared_resources(struct dc *dc, struct dc_state *context) {}
static void optimize_shared_resources(struct dc *dc) {}
static const struct hw_sequencer_funcs dce110_funcs = { static const struct hw_sequencer_funcs dce110_funcs = {
.program_gamut_remap = program_gamut_remap, .program_gamut_remap = program_gamut_remap,
.program_csc_matrix = program_csc_matrix, .program_csc_matrix = program_csc_matrix,
...@@ -2877,9 +2676,6 @@ static const struct hw_sequencer_funcs dce110_funcs = { ...@@ -2877,9 +2676,6 @@ static const struct hw_sequencer_funcs dce110_funcs = {
.setup_stereo = NULL, .setup_stereo = NULL,
.set_avmute = dce110_set_avmute, .set_avmute = dce110_set_avmute,
.wait_for_mpcc_disconnect = dce110_wait_for_mpcc_disconnect, .wait_for_mpcc_disconnect = dce110_wait_for_mpcc_disconnect,
.ready_shared_resources = ready_shared_resources,
.optimize_shared_resources = optimize_shared_resources,
.pplib_apply_display_requirements = pplib_apply_display_requirements,
.edp_backlight_control = hwss_edp_backlight_control, .edp_backlight_control = hwss_edp_backlight_control,
.edp_power_control = hwss_edp_power_control, .edp_power_control = hwss_edp_power_control,
.edp_wait_for_hpd_ready = hwss_edp_wait_for_hpd_ready, .edp_wait_for_hpd_ready = hwss_edp_wait_for_hpd_ready,
......
...@@ -40,7 +40,6 @@ enum dc_status dce110_apply_ctx_to_hw( ...@@ -40,7 +40,6 @@ enum dc_status dce110_apply_ctx_to_hw(
struct dc_state *context); struct dc_state *context);
void dce110_enable_stream(struct pipe_ctx *pipe_ctx); void dce110_enable_stream(struct pipe_ctx *pipe_ctx);
void dce110_disable_stream(struct pipe_ctx *pipe_ctx, int option); void dce110_disable_stream(struct pipe_ctx *pipe_ctx, int option);
...@@ -64,11 +63,10 @@ void dce110_set_safe_displaymarks( ...@@ -64,11 +63,10 @@ void dce110_set_safe_displaymarks(
struct resource_context *res_ctx, struct resource_context *res_ctx,
const struct resource_pool *pool); const struct resource_pool *pool);
void dce110_fill_display_configs( void dce110_set_bandwidth(
const struct dc_state *context, struct dc *dc,
struct dm_pp_display_configuration *pp_display_cfg); struct dc_state *context,
bool decrease_allowed);
uint32_t dce110_get_min_vblank_time_us(const struct dc_state *context);
void dp_receiver_power_ctrl(struct dc_link *link, bool on); void dp_receiver_power_ctrl(struct dc_link *link, bool on);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "resource.h" #include "resource.h"
#include "dce110/dce110_resource.h" #include "dce110/dce110_resource.h"
#include "../dce/dce_clocks.h"
#include "include/irq_service_interface.h" #include "include/irq_service_interface.h"
#include "dce/dce_audio.h" #include "dce/dce_audio.h"
#include "dce110/dce110_timing_generator.h" #include "dce110/dce110_timing_generator.h"
...@@ -45,7 +46,6 @@ ...@@ -45,7 +46,6 @@
#include "dce110/dce110_transform_v.h" #include "dce110/dce110_transform_v.h"
#include "dce/dce_opp.h" #include "dce/dce_opp.h"
#include "dce110/dce110_opp_v.h" #include "dce110/dce110_opp_v.h"
#include "dce/dce_clocks.h"
#include "dce/dce_clock_source.h" #include "dce/dce_clock_source.h"
#include "dce/dce_hwseq.h" #include "dce/dce_hwseq.h"
#include "dce110/dce110_hw_sequencer.h" #include "dce110/dce110_hw_sequencer.h"
...@@ -1173,12 +1173,12 @@ static void bw_calcs_data_update_from_pplib(struct dc *dc) ...@@ -1173,12 +1173,12 @@ static void bw_calcs_data_update_from_pplib(struct dc *dc)
&clks); &clks);
dc->bw_vbios->low_yclk = bw_frc_to_fixed( dc->bw_vbios->low_yclk = bw_frc_to_fixed(
clks.clocks_in_khz[0] * MEMORY_TYPE_MULTIPLIER, 1000); clks.clocks_in_khz[0] * MEMORY_TYPE_MULTIPLIER_CZ, 1000);
dc->bw_vbios->mid_yclk = bw_frc_to_fixed( dc->bw_vbios->mid_yclk = bw_frc_to_fixed(
clks.clocks_in_khz[clks.num_levels>>1] * MEMORY_TYPE_MULTIPLIER, clks.clocks_in_khz[clks.num_levels>>1] * MEMORY_TYPE_MULTIPLIER_CZ,
1000); 1000);
dc->bw_vbios->high_yclk = bw_frc_to_fixed( dc->bw_vbios->high_yclk = bw_frc_to_fixed(
clks.clocks_in_khz[clks.num_levels-1] * MEMORY_TYPE_MULTIPLIER, clks.clocks_in_khz[clks.num_levels-1] * MEMORY_TYPE_MULTIPLIER_CZ,
1000); 1000);
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* *
*/ */
#include "../dce/dce_clocks.h"
#include "dm_services.h" #include "dm_services.h"
#include "link_encoder.h" #include "link_encoder.h"
...@@ -42,7 +43,6 @@ ...@@ -42,7 +43,6 @@
#include "dce/dce_audio.h" #include "dce/dce_audio.h"
#include "dce/dce_opp.h" #include "dce/dce_opp.h"
#include "dce/dce_ipp.h" #include "dce/dce_ipp.h"
#include "dce/dce_clocks.h"
#include "dce/dce_clock_source.h" #include "dce/dce_clock_source.h"
#include "dce/dce_hwseq.h" #include "dce/dce_hwseq.h"
...@@ -1015,12 +1015,12 @@ static void bw_calcs_data_update_from_pplib(struct dc *dc) ...@@ -1015,12 +1015,12 @@ static void bw_calcs_data_update_from_pplib(struct dc *dc)
&clks); &clks);
dc->bw_vbios->low_yclk = bw_frc_to_fixed( dc->bw_vbios->low_yclk = bw_frc_to_fixed(
clks.clocks_in_khz[0] * MEMORY_TYPE_MULTIPLIER, 1000); clks.clocks_in_khz[0] * MEMORY_TYPE_MULTIPLIER_CZ, 1000);
dc->bw_vbios->mid_yclk = bw_frc_to_fixed( dc->bw_vbios->mid_yclk = bw_frc_to_fixed(
clks.clocks_in_khz[clks.num_levels>>1] * MEMORY_TYPE_MULTIPLIER, clks.clocks_in_khz[clks.num_levels>>1] * MEMORY_TYPE_MULTIPLIER_CZ,
1000); 1000);
dc->bw_vbios->high_yclk = bw_frc_to_fixed( dc->bw_vbios->high_yclk = bw_frc_to_fixed(
clks.clocks_in_khz[clks.num_levels-1] * MEMORY_TYPE_MULTIPLIER, clks.clocks_in_khz[clks.num_levels-1] * MEMORY_TYPE_MULTIPLIER_CZ,
1000); 1000);
return; return;
...@@ -1056,12 +1056,12 @@ static void bw_calcs_data_update_from_pplib(struct dc *dc) ...@@ -1056,12 +1056,12 @@ static void bw_calcs_data_update_from_pplib(struct dc *dc)
* YCLK = UMACLK*m_memoryTypeMultiplier * YCLK = UMACLK*m_memoryTypeMultiplier
*/ */
dc->bw_vbios->low_yclk = bw_frc_to_fixed( dc->bw_vbios->low_yclk = bw_frc_to_fixed(
mem_clks.data[0].clocks_in_khz * MEMORY_TYPE_MULTIPLIER, 1000); mem_clks.data[0].clocks_in_khz * MEMORY_TYPE_MULTIPLIER_CZ, 1000);
dc->bw_vbios->mid_yclk = bw_frc_to_fixed( dc->bw_vbios->mid_yclk = bw_frc_to_fixed(
mem_clks.data[mem_clks.num_levels>>1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER, mem_clks.data[mem_clks.num_levels>>1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER_CZ,
1000); 1000);
dc->bw_vbios->high_yclk = bw_frc_to_fixed( dc->bw_vbios->high_yclk = bw_frc_to_fixed(
mem_clks.data[mem_clks.num_levels-1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER, mem_clks.data[mem_clks.num_levels-1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER_CZ,
1000); 1000);
/* Now notify PPLib/SMU about which Watermarks sets they should select /* Now notify PPLib/SMU about which Watermarks sets they should select
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "resource.h" #include "resource.h"
#include "include/irq_service_interface.h" #include "include/irq_service_interface.h"
#include "dce120_resource.h" #include "dce120_resource.h"
#include "../dce/dce_clocks.h"
#include "dce112/dce112_resource.h" #include "dce112/dce112_resource.h"
#include "dce110/dce110_resource.h" #include "dce110/dce110_resource.h"
...@@ -39,7 +41,6 @@ ...@@ -39,7 +41,6 @@
#include "irq/dce120/irq_service_dce120.h" #include "irq/dce120/irq_service_dce120.h"
#include "dce/dce_opp.h" #include "dce/dce_opp.h"
#include "dce/dce_clock_source.h" #include "dce/dce_clock_source.h"
#include "dce/dce_clocks.h"
#include "dce/dce_ipp.h" #include "dce/dce_ipp.h"
#include "dce/dce_mem_input.h" #include "dce/dce_mem_input.h"
...@@ -834,12 +835,12 @@ static void bw_calcs_data_update_from_pplib(struct dc *dc) ...@@ -834,12 +835,12 @@ static void bw_calcs_data_update_from_pplib(struct dc *dc)
* YCLK = UMACLK*m_memoryTypeMultiplier * YCLK = UMACLK*m_memoryTypeMultiplier
*/ */
dc->bw_vbios->low_yclk = bw_frc_to_fixed( dc->bw_vbios->low_yclk = bw_frc_to_fixed(
mem_clks.data[0].clocks_in_khz * MEMORY_TYPE_MULTIPLIER, 1000); mem_clks.data[0].clocks_in_khz * MEMORY_TYPE_MULTIPLIER_CZ, 1000);
dc->bw_vbios->mid_yclk = bw_frc_to_fixed( dc->bw_vbios->mid_yclk = bw_frc_to_fixed(
mem_clks.data[mem_clks.num_levels>>1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER, mem_clks.data[mem_clks.num_levels>>1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER_CZ,
1000); 1000);
dc->bw_vbios->high_yclk = bw_frc_to_fixed( dc->bw_vbios->high_yclk = bw_frc_to_fixed(
mem_clks.data[mem_clks.num_levels-1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER, mem_clks.data[mem_clks.num_levels-1].clocks_in_khz * MEMORY_TYPE_MULTIPLIER_CZ,
1000); 1000);
/* Now notify PPLib/SMU about which Watermarks sets they should select /* Now notify PPLib/SMU about which Watermarks sets they should select
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* *
*/ */
#include "../dce/dce_clocks.h"
#include "dce/dce_8_0_d.h" #include "dce/dce_8_0_d.h"
#include "dce/dce_8_0_sh_mask.h" #include "dce/dce_8_0_sh_mask.h"
...@@ -44,7 +45,6 @@ ...@@ -44,7 +45,6 @@
#include "dce/dce_ipp.h" #include "dce/dce_ipp.h"
#include "dce/dce_transform.h" #include "dce/dce_transform.h"
#include "dce/dce_opp.h" #include "dce/dce_opp.h"
#include "dce/dce_clocks.h"
#include "dce/dce_clock_source.h" #include "dce/dce_clock_source.h"
#include "dce/dce_audio.h" #include "dce/dce_audio.h"
#include "dce/dce_hwseq.h" #include "dce/dce_hwseq.h"
...@@ -793,7 +793,7 @@ bool dce80_validate_bandwidth( ...@@ -793,7 +793,7 @@ bool dce80_validate_bandwidth(
{ {
/* TODO implement when needed but for now hardcode max value*/ /* TODO implement when needed but for now hardcode max value*/
context->bw.dce.dispclk_khz = 681000; context->bw.dce.dispclk_khz = 681000;
context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER; context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER_CZ;
return true; return true;
} }
......
...@@ -2257,46 +2257,6 @@ static void program_all_pipe_in_tree( ...@@ -2257,46 +2257,6 @@ static void program_all_pipe_in_tree(
} }
} }
static void dcn10_pplib_apply_display_requirements(
struct dc *dc,
struct dc_state *context)
{
struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
pp_display_cfg->min_engine_clock_khz = dc->res_pool->dccg->clks.dcfclk_khz;
pp_display_cfg->min_memory_clock_khz = dc->res_pool->dccg->clks.fclk_khz;
pp_display_cfg->min_engine_clock_deep_sleep_khz = dc->res_pool->dccg->clks.dcfclk_deep_sleep_khz;
pp_display_cfg->min_dcfc_deep_sleep_clock_khz = dc->res_pool->dccg->clks.dcfclk_deep_sleep_khz;
pp_display_cfg->min_dcfclock_khz = dc->res_pool->dccg->clks.dcfclk_khz;
pp_display_cfg->disp_clk_khz = dc->res_pool->dccg->clks.dispclk_khz;
dce110_fill_display_configs(context, pp_display_cfg);
if (memcmp(&dc->prev_display_config, pp_display_cfg, sizeof(
struct dm_pp_display_configuration)) != 0)
dm_pp_apply_display_requirements(dc->ctx, pp_display_cfg);
dc->prev_display_config = *pp_display_cfg;
}
static void optimize_shared_resources(struct dc *dc)
{
if (dc->current_state->stream_count == 0) {
/* S0i2 message */
dcn10_pplib_apply_display_requirements(dc, dc->current_state);
}
if (dc->debug.pplib_wm_report_mode == WM_REPORT_OVERRIDE)
dcn_bw_notify_pplib_of_wm_ranges(dc);
}
static void ready_shared_resources(struct dc *dc, struct dc_state *context)
{
/* S0i2 message */
if (dc->current_state->stream_count == 0 &&
context->stream_count != 0)
dcn10_pplib_apply_display_requirements(dc, context);
}
static struct pipe_ctx *find_top_pipe_for_stream( static struct pipe_ctx *find_top_pipe_for_stream(
struct dc *dc, struct dc *dc,
struct dc_state *context, struct dc_state *context,
...@@ -2412,10 +2372,8 @@ static void dcn10_set_bandwidth( ...@@ -2412,10 +2372,8 @@ static void dcn10_set_bandwidth(
dc->res_pool->dccg->funcs->update_clocks( dc->res_pool->dccg->funcs->update_clocks(
dc->res_pool->dccg, dc->res_pool->dccg,
&context->bw.dcn.clk, context,
safe_to_lower); safe_to_lower);
dcn10_pplib_apply_display_requirements(dc, context);
} }
hubbub1_program_watermarks(dc->res_pool->hubbub, hubbub1_program_watermarks(dc->res_pool->hubbub,
...@@ -2423,6 +2381,9 @@ static void dcn10_set_bandwidth( ...@@ -2423,6 +2381,9 @@ static void dcn10_set_bandwidth(
dc->res_pool->ref_clock_inKhz / 1000, dc->res_pool->ref_clock_inKhz / 1000,
true); true);
if (dc->debug.pplib_wm_report_mode == WM_REPORT_OVERRIDE)
dcn_bw_notify_pplib_of_wm_ranges(dc);
if (dc->debug.sanity_checks) if (dc->debug.sanity_checks)
dcn10_verify_allow_pstate_change_high(dc); dcn10_verify_allow_pstate_change_high(dc);
} }
...@@ -2732,10 +2693,6 @@ static const struct hw_sequencer_funcs dcn10_funcs = { ...@@ -2732,10 +2693,6 @@ static const struct hw_sequencer_funcs dcn10_funcs = {
.log_hw_state = dcn10_log_hw_state, .log_hw_state = dcn10_log_hw_state,
.get_hw_state = dcn10_get_hw_state, .get_hw_state = dcn10_get_hw_state,
.wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect, .wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
.ready_shared_resources = ready_shared_resources,
.optimize_shared_resources = optimize_shared_resources,
.pplib_apply_display_requirements =
dcn10_pplib_apply_display_requirements,
.edp_backlight_control = hwss_edp_backlight_control, .edp_backlight_control = hwss_edp_backlight_control,
.edp_power_control = hwss_edp_power_control, .edp_power_control = hwss_edp_power_control,
.edp_wait_for_hpd_ready = hwss_edp_wait_for_hpd_ready, .edp_wait_for_hpd_ready = hwss_edp_wait_for_hpd_ready,
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include "dcn10/dcn10_opp.h" #include "dcn10/dcn10_opp.h"
#include "dcn10/dcn10_link_encoder.h" #include "dcn10/dcn10_link_encoder.h"
#include "dcn10/dcn10_stream_encoder.h" #include "dcn10/dcn10_stream_encoder.h"
#include "dce/dce_clocks.h" #include "../dce/dce_clocks.h"
#include "dce/dce_clock_source.h" #include "dce/dce_clock_source.h"
#include "dce/dce_audio.h" #include "dce/dce_audio.h"
#include "dce/dce_hwseq.h" #include "dce/dce_hwseq.h"
......
...@@ -287,7 +287,7 @@ struct dc_state { ...@@ -287,7 +287,7 @@ struct dc_state {
struct dcn_bw_internal_vars dcn_bw_vars; struct dcn_bw_internal_vars dcn_bw_vars;
#endif #endif
struct dccg *dis_clk; struct dccg *dccg;
struct kref refcount; struct kref refcount;
}; };
......
...@@ -38,26 +38,19 @@ struct state_dependent_clocks { ...@@ -38,26 +38,19 @@ struct state_dependent_clocks {
struct dccg { struct dccg {
struct dc_context *ctx; struct dc_context *ctx;
const struct display_clock_funcs *funcs; const struct dccg_funcs *funcs;
enum dm_pp_clocks_state max_clks_state; enum dm_pp_clocks_state max_clks_state;
enum dm_pp_clocks_state cur_min_clks_state; enum dm_pp_clocks_state cur_min_clks_state;
struct dc_clocks clks; struct dc_clocks clks;
}; };
struct display_clock_funcs { struct dccg_funcs {
void (*update_clocks)(struct dccg *dccg, void (*update_clocks)(struct dccg *dccg,
struct dc_clocks *new_clocks, struct dc_state *context,
bool safe_to_lower); bool safe_to_lower);
int (*set_dispclk)(struct dccg *dccg,
int requested_clock_khz);
int (*get_dp_ref_clk_frequency)(struct dccg *dccg); int (*get_dp_ref_clk_frequency)(struct dccg *dccg);
bool (*update_dfs_bypass)(struct dccg *dccg,
struct dc *dc,
struct dc_state *context,
int requested_clock_khz);
}; };
#endif /* __DISPLAY_CLOCK_H__ */ #endif /* __DISPLAY_CLOCK_H__ */
...@@ -210,11 +210,6 @@ struct hw_sequencer_funcs { ...@@ -210,11 +210,6 @@ struct hw_sequencer_funcs {
struct resource_pool *res_pool, struct resource_pool *res_pool,
struct pipe_ctx *pipe_ctx); struct pipe_ctx *pipe_ctx);
void (*ready_shared_resources)(struct dc *dc, struct dc_state *context);
void (*optimize_shared_resources)(struct dc *dc);
void (*pplib_apply_display_requirements)(
struct dc *dc,
struct dc_state *context);
void (*edp_power_control)( void (*edp_power_control)(
struct dc_link *link, struct dc_link *link,
bool enable); bool enable);
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
#include "dal_asic_id.h" #include "dal_asic_id.h"
#include "dm_pp_smu.h" #include "dm_pp_smu.h"
/* TODO unhardcode, 4 for CZ*/
#define MEMORY_TYPE_MULTIPLIER 4
enum dce_version resource_parse_asic_id( enum dce_version resource_parse_asic_id(
struct hw_asic_id asic_id); struct hw_asic_id asic_id);
......
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