Commit a00e8571 authored by Rodrigo Siqueira's avatar Rodrigo Siqueira Committed by Alex Deucher

drm/amd/display: Update DML2.1 generated code

Most of the DML code is generated, and it is necessary to update some
parts of it from time to time. This commit brings the latest generated
code for DML 2.1.
Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 91b586cc
...@@ -338,7 +338,8 @@ void dml21_apply_soc_bb_overrides(struct dml2_initialize_instance_in_out *dml_in ...@@ -338,7 +338,8 @@ void dml21_apply_soc_bb_overrides(struct dml2_initialize_instance_in_out *dml_in
} }
static void populate_dml21_timing_config_from_stream_state(struct dml2_timing_cfg *timing, static void populate_dml21_timing_config_from_stream_state(struct dml2_timing_cfg *timing,
struct dc_stream_state *stream) struct dc_stream_state *stream,
struct dml2_context *dml_ctx)
{ {
unsigned int hblank_start, vblank_start; unsigned int hblank_start, vblank_start;
...@@ -372,7 +373,12 @@ static void populate_dml21_timing_config_from_stream_state(struct dml2_timing_cf ...@@ -372,7 +373,12 @@ static void populate_dml21_timing_config_from_stream_state(struct dml2_timing_cf
timing->drr_config.drr_active_variable = stream->vrr_active_variable; timing->drr_config.drr_active_variable = stream->vrr_active_variable;
timing->drr_config.drr_active_fixed = stream->vrr_active_fixed; timing->drr_config.drr_active_fixed = stream->vrr_active_fixed;
timing->drr_config.disallowed = !stream->allow_freesync; timing->drr_config.disallowed = !stream->allow_freesync;
//timing->drr_config.max_instant_vtotal_delta = timing-><drr no flicker delta lum>;
if (dml_ctx->config.callbacks.get_max_flickerless_instant_vtotal_increase &&
stream->ctx->dc->config.enable_fpo_flicker_detection == 1)
timing->drr_config.max_instant_vtotal_delta = dml_ctx->config.callbacks.get_max_flickerless_instant_vtotal_increase(stream, false);
else
timing->drr_config.max_instant_vtotal_delta = 0;
if (stream->timing.flags.DSC) { if (stream->timing.flags.DSC) {
timing->dsc.enable = dml2_dsc_enable; timing->dsc.enable = dml2_dsc_enable;
...@@ -505,7 +511,8 @@ static void populate_dml21_stream_overrides_from_stream_state( ...@@ -505,7 +511,8 @@ static void populate_dml21_stream_overrides_from_stream_state(
stream_desc->overrides.odm_mode = dml2_odm_mode_auto; stream_desc->overrides.odm_mode = dml2_odm_mode_auto;
break; break;
} }
if (!stream->ctx->dc->debug.enable_single_display_2to1_odm_policy) if (!stream->ctx->dc->debug.enable_single_display_2to1_odm_policy ||
stream->debug.force_odm_combine_segments > 0)
stream_desc->overrides.disable_dynamic_odm = true; stream_desc->overrides.disable_dynamic_odm = true;
stream_desc->overrides.disable_subvp = stream->ctx->dc->debug.force_disable_subvp; stream_desc->overrides.disable_subvp = stream->ctx->dc->debug.force_disable_subvp;
} }
...@@ -699,7 +706,7 @@ static const struct scaler_data *get_scaler_data_for_plane( ...@@ -699,7 +706,7 @@ static const struct scaler_data *get_scaler_data_for_plane(
temp_pipe->stream = pipe->stream; temp_pipe->stream = pipe->stream;
temp_pipe->plane_state = pipe->plane_state; temp_pipe->plane_state = pipe->plane_state;
temp_pipe->plane_res.scl_data.taps = pipe->plane_res.scl_data.taps; temp_pipe->plane_res.scl_data.taps = pipe->plane_res.scl_data.taps;
temp_pipe->stream_res = pipe->stream_res;
dml_ctx->config.callbacks.build_scaling_params(temp_pipe); dml_ctx->config.callbacks.build_scaling_params(temp_pipe);
break; break;
} }
...@@ -956,7 +963,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s ...@@ -956,7 +963,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
disp_cfg_stream_location = dml_dispcfg->num_streams++; disp_cfg_stream_location = dml_dispcfg->num_streams++;
ASSERT(disp_cfg_stream_location >= 0 && disp_cfg_stream_location <= __DML2_WRAPPER_MAX_STREAMS_PLANES__); ASSERT(disp_cfg_stream_location >= 0 && disp_cfg_stream_location <= __DML2_WRAPPER_MAX_STREAMS_PLANES__);
populate_dml21_timing_config_from_stream_state(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location].timing, context->streams[stream_index]); populate_dml21_timing_config_from_stream_state(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location].timing, context->streams[stream_index], dml_ctx);
populate_dml21_output_config_from_stream_state(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location].output, context->streams[stream_index], &context->res_ctx.pipe_ctx[stream_index]); populate_dml21_output_config_from_stream_state(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location].output, context->streams[stream_index], &context->res_ctx.pipe_ctx[stream_index]);
populate_dml21_stream_overrides_from_stream_state(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location], context->streams[stream_index]); populate_dml21_stream_overrides_from_stream_state(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location], context->streams[stream_index]);
...@@ -1007,6 +1014,8 @@ void dml21_copy_clocks_to_dc_state(struct dml2_context *in_ctx, struct dc_state ...@@ -1007,6 +1014,8 @@ void dml21_copy_clocks_to_dc_state(struct dml2_context *in_ctx, struct dc_state
context->bw_ctx.bw.dcn.clk.dcfclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.active.dcfclk_khz; context->bw_ctx.bw.dcn.clk.dcfclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.active.dcfclk_khz;
context->bw_ctx.bw.dcn.clk.dramclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.active.uclk_khz; context->bw_ctx.bw.dcn.clk.dramclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.active.uclk_khz;
context->bw_ctx.bw.dcn.clk.fclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.active.fclk_khz; context->bw_ctx.bw.dcn.clk.fclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.active.fclk_khz;
context->bw_ctx.bw.dcn.clk.idle_dramclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.idle.uclk_khz;
context->bw_ctx.bw.dcn.clk.idle_fclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.idle.fclk_khz;
context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.deepsleep_dcfclk_khz; context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4.deepsleep_dcfclk_khz;
context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = in_ctx->v21.mode_programming.programming->fclk_pstate_supported; context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = in_ctx->v21.mode_programming.programming->fclk_pstate_supported;
context->bw_ctx.bw.dcn.clk.p_state_change_support = in_ctx->v21.mode_programming.programming->uclk_pstate_supported; context->bw_ctx.bw.dcn.clk.p_state_change_support = in_ctx->v21.mode_programming.programming->uclk_pstate_supported;
......
...@@ -59,7 +59,7 @@ static void dml21_apply_debug_options(const struct dc *in_dc, struct dml2_contex ...@@ -59,7 +59,7 @@ static void dml21_apply_debug_options(const struct dc *in_dc, struct dml2_contex
pmo_options->disable_svp = ((in_dc->debug.dml21_disable_pstate_method_mask >> 2) & 1) || pmo_options->disable_svp = ((in_dc->debug.dml21_disable_pstate_method_mask >> 2) & 1) ||
in_dc->debug.force_disable_subvp || in_dc->debug.force_disable_subvp ||
disable_fams2; disable_fams2;
pmo_options->disable_drr_fixed = ((in_dc->debug.dml21_disable_pstate_method_mask >> 3) & 1) || pmo_options->disable_drr_clamped = ((in_dc->debug.dml21_disable_pstate_method_mask >> 3) & 1) ||
disable_fams2; disable_fams2;
pmo_options->disable_drr_var = ((in_dc->debug.dml21_disable_pstate_method_mask >> 4) & 1) || pmo_options->disable_drr_var = ((in_dc->debug.dml21_disable_pstate_method_mask >> 4) & 1) ||
disable_fams2; disable_fams2;
......
...@@ -120,11 +120,11 @@ static const struct dml2_soc_bb dml2_socbb_dcn401 = { ...@@ -120,11 +120,11 @@ static const struct dml2_soc_bb dml2_socbb_dcn401 = {
.num_clk_values = 2, .num_clk_values = 2,
}, },
.phyclk_d18 = { .phyclk_d18 = {
.clk_values_khz = {667000, 667000}, .clk_values_khz = {625000, 625000},
.num_clk_values = 2, .num_clk_values = 2,
}, },
.phyclk_d32 = { .phyclk_d32 = {
.clk_values_khz = {2000000, 2000000}, .clk_values_khz = {625000, 625000},
.num_clk_values = 2, .num_clk_values = 2,
}, },
.dram_config = { .dram_config = {
...@@ -289,17 +289,29 @@ static const struct dml2_soc_bb dml2_socbb_dcn401 = { ...@@ -289,17 +289,29 @@ static const struct dml2_soc_bb dml2_socbb_dcn401 = {
.dram_clk_change_blackout_us = 400, .dram_clk_change_blackout_us = 400,
.fclk_change_blackout_us = 0, .fclk_change_blackout_us = 0,
.g7_ppt_blackout_us = 0, .g7_ppt_blackout_us = 0,
.stutter_enter_plus_exit_latency_us = 21, .stutter_enter_plus_exit_latency_us = 54,
.stutter_exit_latency_us = 16, .stutter_exit_latency_us = 41,
.z8_stutter_enter_plus_exit_latency_us = 0, .z8_stutter_enter_plus_exit_latency_us = 0,
.z8_stutter_exit_latency_us = 0, .z8_stutter_exit_latency_us = 0,
/*
.g6_temp_read_blackout_us = {
23.00,
10.00,
10.00,
8.00,
8.00,
5.00,
5.00,
5.00,
},
*/
}, },
.vmin_limit = { .vmin_limit = {
.dispclk_khz = 600 * 1000, .dispclk_khz = 600 * 1000,
}, },
.dprefclk_mhz = 700, .dprefclk_mhz = 720,
.xtalclk_mhz = 100, .xtalclk_mhz = 100,
.pcie_refclk_mhz = 100, .pcie_refclk_mhz = 100,
.dchub_refclk_mhz = 50, .dchub_refclk_mhz = 50,
...@@ -309,8 +321,8 @@ static const struct dml2_soc_bb dml2_socbb_dcn401 = { ...@@ -309,8 +321,8 @@ static const struct dml2_soc_bb dml2_socbb_dcn401 = {
.return_bus_width_bytes = 64, .return_bus_width_bytes = 64,
.hostvm_min_page_size_kbytes = 0, .hostvm_min_page_size_kbytes = 0,
.gpuvm_min_page_size_kbytes = 256, .gpuvm_min_page_size_kbytes = 256,
.phy_downspread_percent = 0, .phy_downspread_percent = 0.38,
.dcn_downspread_percent = 0, .dcn_downspread_percent = 0.38,
.dispclk_dppclk_vco_speed_mhz = 4500, .dispclk_dppclk_vco_speed_mhz = 4500,
.do_urgent_latency_adjustment = 0, .do_urgent_latency_adjustment = 0,
.mem_word_bytes = 32, .mem_word_bytes = 32,
...@@ -329,6 +341,7 @@ static const struct dml2_ip_capabilities dml2_dcn401_max_ip_caps = { ...@@ -329,6 +341,7 @@ static const struct dml2_ip_capabilities dml2_dcn401_max_ip_caps = {
.max_num_dp2p0_outputs = 4, .max_num_dp2p0_outputs = 4,
.rob_buffer_size_kbytes = 192, .rob_buffer_size_kbytes = 192,
.config_return_buffer_size_in_kbytes = 1344, .config_return_buffer_size_in_kbytes = 1344,
.config_return_buffer_segment_size_in_kbytes = 64,
.meta_fifo_size_in_kentries = 22, .meta_fifo_size_in_kentries = 22,
.compressed_buffer_segment_size_in_kbytes = 64, .compressed_buffer_segment_size_in_kbytes = 64,
.subvp_drr_scheduling_margin_us = 100, .subvp_drr_scheduling_margin_us = 100,
......
...@@ -380,7 +380,11 @@ struct dml2_plane_parameters { ...@@ -380,7 +380,11 @@ struct dml2_plane_parameters {
enum dml2_refresh_from_mall_mode_override refresh_from_mall; enum dml2_refresh_from_mall_mode_override refresh_from_mall;
unsigned int det_size_override_kb; unsigned int det_size_override_kb;
unsigned int mpcc_combine_factor; unsigned int mpcc_combine_factor;
long reserved_vblank_time_ns; // 0 = no override, -ve = no reserved time, +ve = explicit reserved time
// reserved_vblank_time_ns is the minimum time to reserve in vblank for Twait
// The actual reserved vblank time used for the corresponding stream in mode_programming would be at least as much as this per-plane override.
long reserved_vblank_time_ns;
unsigned int max_vactive_det_fill_delay_us; // 0 = no reserved time, +ve = explicit max delay
unsigned int gpuvm_min_page_size_kbytes; unsigned int gpuvm_min_page_size_kbytes;
enum dml2_svp_mode_override legacy_svp_config; //TODO remove in favor of svp_config enum dml2_svp_mode_override legacy_svp_config; //TODO remove in favor of svp_config
...@@ -407,6 +411,7 @@ struct dml2_stream_parameters { ...@@ -407,6 +411,7 @@ struct dml2_stream_parameters {
enum dml2_odm_mode odm_mode; enum dml2_odm_mode odm_mode;
bool disable_dynamic_odm; bool disable_dynamic_odm;
bool disable_subvp; bool disable_subvp;
bool disable_fams2_drr;
int minimum_vblank_idle_requirement_us; int minimum_vblank_idle_requirement_us;
bool minimize_active_latency_hiding; bool minimize_active_latency_hiding;
...@@ -429,7 +434,7 @@ struct dml2_display_cfg { ...@@ -429,7 +434,7 @@ struct dml2_display_cfg {
bool minimize_det_reallocation; bool minimize_det_reallocation;
unsigned int gpuvm_max_page_table_levels; unsigned int gpuvm_max_page_table_levels;
unsigned int hostvm_max_page_table_levels; unsigned int hostvm_max_non_cached_page_table_levels;
struct dml2_plane_parameters plane_descriptors[DML2_MAX_PLANES]; struct dml2_plane_parameters plane_descriptors[DML2_MAX_PLANES];
struct dml2_stream_parameters stream_descriptors[DML2_MAX_PLANES]; struct dml2_stream_parameters stream_descriptors[DML2_MAX_PLANES];
......
...@@ -169,8 +169,11 @@ struct dml2_ip_capabilities { ...@@ -169,8 +169,11 @@ struct dml2_ip_capabilities {
unsigned int max_num_dp2p0_outputs; unsigned int max_num_dp2p0_outputs;
unsigned int rob_buffer_size_kbytes; unsigned int rob_buffer_size_kbytes;
unsigned int config_return_buffer_size_in_kbytes; unsigned int config_return_buffer_size_in_kbytes;
unsigned int config_return_buffer_segment_size_in_kbytes;
unsigned int meta_fifo_size_in_kentries; unsigned int meta_fifo_size_in_kentries;
unsigned int compressed_buffer_segment_size_in_kbytes; unsigned int compressed_buffer_segment_size_in_kbytes;
unsigned int max_flip_time_us;
unsigned int hostvm_mode;
unsigned int subvp_drr_scheduling_margin_us; unsigned int subvp_drr_scheduling_margin_us;
unsigned int subvp_prefetch_end_to_mall_start_us; unsigned int subvp_prefetch_end_to_mall_start_us;
unsigned int subvp_fw_processing_delay; unsigned int subvp_fw_processing_delay;
......
...@@ -72,9 +72,10 @@ struct dml2_pmo_options { ...@@ -72,9 +72,10 @@ struct dml2_pmo_options {
bool disable_vblank; bool disable_vblank;
bool disable_svp; bool disable_svp;
bool disable_drr_var; bool disable_drr_var;
bool disable_drr_fixed; bool disable_drr_clamped;
bool disable_drr_var_when_var_active; bool disable_drr_var_when_var_active;
bool disable_fams2; bool disable_fams2;
bool disable_vactive_det_fill_bw_pad; /* dml2_project_dcn4x_stage2_auto_drr_svp and above only */
bool disable_dyn_odm; bool disable_dyn_odm;
bool disable_dyn_odm_for_multi_stream; bool disable_dyn_odm_for_multi_stream;
bool disable_dyn_odm_for_stream_with_svp; bool disable_dyn_odm_for_stream_with_svp;
...@@ -331,7 +332,6 @@ struct dml2_mode_support_info { ...@@ -331,7 +332,6 @@ struct dml2_mode_support_info {
bool DTBCLKRequiredMoreThanSupported; bool DTBCLKRequiredMoreThanSupported;
bool LinkCapacitySupport; bool LinkCapacitySupport;
bool ROBSupport; bool ROBSupport;
bool ROBUrgencyAvoidance;
bool OutstandingRequestsSupport; bool OutstandingRequestsSupport;
bool OutstandingRequestsUrgencyAvoidance; bool OutstandingRequestsUrgencyAvoidance;
bool PTEBufferSizeNotExceeded; bool PTEBufferSizeNotExceeded;
...@@ -659,6 +659,7 @@ struct dml2_display_cfg_programming { ...@@ -659,6 +659,7 @@ struct dml2_display_cfg_programming {
double DSCDelay[DML2_MAX_PLANES]; double DSCDelay[DML2_MAX_PLANES];
double MaxActiveDRAMClockChangeLatencySupported[DML2_MAX_PLANES]; double MaxActiveDRAMClockChangeLatencySupported[DML2_MAX_PLANES];
unsigned int PrefetchMode[DML2_MAX_PLANES]; // LEGACY_ONLY unsigned int PrefetchMode[DML2_MAX_PLANES]; // LEGACY_ONLY
bool ROBUrgencyAvoidance;
} misc; } misc;
struct dml2_mode_support_info mode_support_info; struct dml2_mode_support_info mode_support_info;
...@@ -715,4 +716,5 @@ struct dml2_unit_test_in_out { ...@@ -715,4 +716,5 @@ struct dml2_unit_test_in_out {
struct dml2_instance *dml2_instance; struct dml2_instance *dml2_instance;
}; };
#endif #endif
...@@ -66,6 +66,73 @@ struct dml2_core_ip_params core_dcn4_ip_caps_base = { ...@@ -66,6 +66,73 @@ struct dml2_core_ip_params core_dcn4_ip_caps_base = {
.cursor_64bpp_support = true, .cursor_64bpp_support = true,
.dynamic_metadata_vm_enabled = false, .dynamic_metadata_vm_enabled = false,
.max_num_dp2p0_outputs = 4,
.max_num_dp2p0_streams = 4,
.imall_supported = 1,
.max_flip_time_us = 80,
.words_per_channel = 16,
.subvp_fw_processing_delay_us = 15,
.subvp_pstate_allow_width_us = 20,
.subvp_swath_height_margin_lines = 16,
};
struct dml2_core_ip_params core_dcn4sw_ip_caps_base = {
.vblank_nom_default_us = 668,
.remote_iommu_outstanding_translations = 256,
.rob_buffer_size_kbytes = 192,
.config_return_buffer_size_in_kbytes = 1280,
.config_return_buffer_segment_size_in_kbytes = 64,
.compressed_buffer_segment_size_in_kbytes = 64,
.dpte_buffer_size_in_pte_reqs_luma = 68,
.dpte_buffer_size_in_pte_reqs_chroma = 36,
.pixel_chunk_size_kbytes = 8,
.alpha_pixel_chunk_size_kbytes = 4,
.min_pixel_chunk_size_bytes = 1024,
.writeback_chunk_size_kbytes = 8,
.line_buffer_size_bits = 1171920,
.max_line_buffer_lines = 32,
.writeback_interface_buffer_size_kbytes = 90,
//Number of pipes after DCN Pipe harvesting
.max_num_dpp = 4,
.max_num_otg = 4,
.max_num_wb = 1,
.max_dchub_pscl_bw_pix_per_clk = 4,
.max_pscl_lb_bw_pix_per_clk = 2,
.max_lb_vscl_bw_pix_per_clk = 4,
.max_vscl_hscl_bw_pix_per_clk = 4,
.max_hscl_ratio = 6,
.max_vscl_ratio = 6,
.max_hscl_taps = 8,
.max_vscl_taps = 8,
.dispclk_ramp_margin_percent = 1,
.dppclk_delay_subtotal = 47,
.dppclk_delay_scl = 50,
.dppclk_delay_scl_lb_only = 16,
.dppclk_delay_cnvc_formatter = 28,
.dppclk_delay_cnvc_cursor = 6,
.cursor_buffer_size = 24,
.cursor_chunk_size = 2,
.dispclk_delay_subtotal = 125,
.max_inter_dcn_tile_repeaters = 8,
.writeback_max_hscl_ratio = 1,
.writeback_max_vscl_ratio = 1,
.writeback_min_hscl_ratio = 1,
.writeback_min_vscl_ratio = 1,
.writeback_max_hscl_taps = 1,
.writeback_max_vscl_taps = 1,
.writeback_line_buffer_buffer_size = 0,
.num_dsc = 4,
.maximum_dsc_bits_per_component = 12,
.maximum_pixels_per_line_per_dsc_unit = 5760,
.dsc422_native_support = true,
.dcc_supported = true,
.ptoi_supported = false,
.cursor_64bpp_support = true,
.dynamic_metadata_vm_enabled = false,
.max_num_hdmi_frl_outputs = 1, .max_num_hdmi_frl_outputs = 1,
.max_num_dp2p0_outputs = 4, .max_num_dp2p0_outputs = 4,
.max_num_dp2p0_streams = 4, .max_num_dp2p0_streams = 4,
...@@ -76,6 +143,16 @@ struct dml2_core_ip_params core_dcn4_ip_caps_base = { ...@@ -76,6 +143,16 @@ struct dml2_core_ip_params core_dcn4_ip_caps_base = {
.subvp_fw_processing_delay_us = 15, .subvp_fw_processing_delay_us = 15,
.subvp_pstate_allow_width_us = 20, .subvp_pstate_allow_width_us = 20,
.subvp_swath_height_margin_lines = 16, .subvp_swath_height_margin_lines = 16,
.dcn_mrq_present = 1,
.zero_size_buffer_entries = 512,
.compbuf_reserved_space_zs = 64,
.dcc_meta_buffer_size_bytes = 6272,
.meta_chunk_size_kbytes = 2,
.min_meta_chunk_size_bytes = 256,
.dchub_arb_to_ret_delay = 102,
.hostvm_mode = 1,
}; };
static void patch_ip_caps_with_explicit_ip_params(struct dml2_ip_capabilities *ip_caps, const struct dml2_core_ip_params *ip_params) static void patch_ip_caps_with_explicit_ip_params(struct dml2_ip_capabilities *ip_caps, const struct dml2_core_ip_params *ip_params)
...@@ -85,10 +162,14 @@ static void patch_ip_caps_with_explicit_ip_params(struct dml2_ip_capabilities *i ...@@ -85,10 +162,14 @@ static void patch_ip_caps_with_explicit_ip_params(struct dml2_ip_capabilities *i
ip_caps->num_dsc = ip_params->num_dsc; ip_caps->num_dsc = ip_params->num_dsc;
ip_caps->max_num_dp2p0_streams = ip_params->max_num_dp2p0_streams; ip_caps->max_num_dp2p0_streams = ip_params->max_num_dp2p0_streams;
ip_caps->max_num_dp2p0_outputs = ip_params->max_num_dp2p0_outputs; ip_caps->max_num_dp2p0_outputs = ip_params->max_num_dp2p0_outputs;
ip_caps->max_num_hdmi_frl_outputs = ip_params->max_num_hdmi_frl_outputs;
ip_caps->rob_buffer_size_kbytes = ip_params->rob_buffer_size_kbytes; ip_caps->rob_buffer_size_kbytes = ip_params->rob_buffer_size_kbytes;
ip_caps->config_return_buffer_size_in_kbytes = ip_params->config_return_buffer_size_in_kbytes; ip_caps->config_return_buffer_size_in_kbytes = ip_params->config_return_buffer_size_in_kbytes;
ip_caps->config_return_buffer_segment_size_in_kbytes = ip_params->config_return_buffer_segment_size_in_kbytes;
ip_caps->meta_fifo_size_in_kentries = ip_params->meta_fifo_size_in_kentries; ip_caps->meta_fifo_size_in_kentries = ip_params->meta_fifo_size_in_kentries;
ip_caps->compressed_buffer_segment_size_in_kbytes = ip_params->compressed_buffer_segment_size_in_kbytes; ip_caps->compressed_buffer_segment_size_in_kbytes = ip_params->compressed_buffer_segment_size_in_kbytes;
ip_caps->max_flip_time_us = ip_params->max_flip_time_us;
ip_caps->hostvm_mode = ip_params->hostvm_mode;
// FIXME_STAGE2: cleanup after adding all dv override to ip_caps // FIXME_STAGE2: cleanup after adding all dv override to ip_caps
ip_caps->subvp_drr_scheduling_margin_us = 100; ip_caps->subvp_drr_scheduling_margin_us = 100;
...@@ -104,10 +185,14 @@ static void patch_ip_params_with_ip_caps(struct dml2_core_ip_params *ip_params, ...@@ -104,10 +185,14 @@ static void patch_ip_params_with_ip_caps(struct dml2_core_ip_params *ip_params,
ip_params->num_dsc = ip_caps->num_dsc; ip_params->num_dsc = ip_caps->num_dsc;
ip_params->max_num_dp2p0_streams = ip_caps->max_num_dp2p0_streams; ip_params->max_num_dp2p0_streams = ip_caps->max_num_dp2p0_streams;
ip_params->max_num_dp2p0_outputs = ip_caps->max_num_dp2p0_outputs; ip_params->max_num_dp2p0_outputs = ip_caps->max_num_dp2p0_outputs;
ip_params->max_num_hdmi_frl_outputs = ip_caps->max_num_hdmi_frl_outputs;
ip_params->rob_buffer_size_kbytes = ip_caps->rob_buffer_size_kbytes; ip_params->rob_buffer_size_kbytes = ip_caps->rob_buffer_size_kbytes;
ip_params->config_return_buffer_size_in_kbytes = ip_caps->config_return_buffer_size_in_kbytes; ip_params->config_return_buffer_size_in_kbytes = ip_caps->config_return_buffer_size_in_kbytes;
ip_params->config_return_buffer_segment_size_in_kbytes = ip_caps->config_return_buffer_segment_size_in_kbytes;
ip_params->meta_fifo_size_in_kentries = ip_caps->meta_fifo_size_in_kentries; ip_params->meta_fifo_size_in_kentries = ip_caps->meta_fifo_size_in_kentries;
ip_params->compressed_buffer_segment_size_in_kbytes = ip_caps->compressed_buffer_segment_size_in_kbytes; ip_params->compressed_buffer_segment_size_in_kbytes = ip_caps->compressed_buffer_segment_size_in_kbytes;
ip_params->max_flip_time_us = ip_caps->max_flip_time_us;
ip_params->hostvm_mode = ip_caps->hostvm_mode;
} }
bool core_dcn4_initialize(struct dml2_core_initialize_in_out *in_out) bool core_dcn4_initialize(struct dml2_core_initialize_in_out *in_out)
...@@ -343,14 +428,12 @@ static void pack_mode_programming_params_with_implicit_subvp(struct dml2_core_in ...@@ -343,14 +428,12 @@ static void pack_mode_programming_params_with_implicit_subvp(struct dml2_core_in
programming->stream_programming[main_plane->stream_index].uclk_pstate_method = programming->plane_programming[plane_index].uclk_pstate_support_method; programming->stream_programming[main_plane->stream_index].uclk_pstate_method = programming->plane_programming[plane_index].uclk_pstate_support_method;
// If FAMS2 is required, populate stream params /* unconditionally populate fams2 params */
if (programming->fams2_required) { dml2_core_calcs_get_stream_fams2_programming(&core->clean_me_up.mode_lib,
dml2_core_calcs_get_stream_fams2_programming(&core->clean_me_up.mode_lib, display_cfg,
display_cfg, &programming->stream_programming[main_plane->stream_index].fams2_params,
&programming->stream_programming[main_plane->stream_index].fams2_params, programming->stream_programming[main_plane->stream_index].uclk_pstate_method,
programming->stream_programming[main_plane->stream_index].uclk_pstate_method, plane_index);
plane_index);
}
stream_already_populated_mask |= (0x1 << main_plane->stream_index); stream_already_populated_mask |= (0x1 << main_plane->stream_index);
} }
...@@ -394,7 +477,7 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out) ...@@ -394,7 +477,7 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out)
bool result; bool result;
unsigned int i, stream_index, stream_bitmask; unsigned int i, stream_index, stream_bitmask;
int unsigned odm_count, dpp_count; int unsigned odm_count, num_odm_output_segments, dpp_count;
expand_implict_subvp(in_out->display_cfg, &l->svp_expanded_display_cfg, &core->scratch); expand_implict_subvp(in_out->display_cfg, &l->svp_expanded_display_cfg, &core->scratch);
...@@ -448,6 +531,10 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out) ...@@ -448,6 +531,10 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out)
stream_bitmask = 0; stream_bitmask = 0;
for (i = 0; i < l->svp_expanded_display_cfg.num_planes; i++) { for (i = 0; i < l->svp_expanded_display_cfg.num_planes; i++) {
odm_count = 1;
dpp_count = l->mode_support_ex_params.out_evaluation_info->DPPPerSurface[i];
num_odm_output_segments = 1;
switch (l->mode_support_ex_params.out_evaluation_info->ODMMode[i]) { switch (l->mode_support_ex_params.out_evaluation_info->ODMMode[i]) {
case dml2_odm_mode_bypass: case dml2_odm_mode_bypass:
odm_count = 1; odm_count = 1;
...@@ -467,7 +554,11 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out) ...@@ -467,7 +554,11 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out)
break; break;
case dml2_odm_mode_split_1to2: case dml2_odm_mode_split_1to2:
case dml2_odm_mode_mso_1to2: case dml2_odm_mode_mso_1to2:
num_odm_output_segments = 2;
break;
case dml2_odm_mode_mso_1to4: case dml2_odm_mode_mso_1to4:
num_odm_output_segments = 4;
break;
case dml2_odm_mode_auto: case dml2_odm_mode_auto:
default: default:
odm_count = 1; odm_count = 1;
...@@ -486,6 +577,7 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out) ...@@ -486,6 +577,7 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out)
if (!((stream_bitmask >> stream_index) & 0x1)) { if (!((stream_bitmask >> stream_index) & 0x1)) {
in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index].odms_used = odm_count; in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index].odms_used = odm_count;
in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index].num_odm_output_segments = num_odm_output_segments;
in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index].dsc_enable = l->mode_support_ex_params.out_evaluation_info->DSCEnabled[i]; in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index].dsc_enable = l->mode_support_ex_params.out_evaluation_info->DSCEnabled[i];
in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index].num_dsc_slices = l->mode_support_ex_params.out_evaluation_info->NumberOfDSCSlices[i]; in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index].num_dsc_slices = l->mode_support_ex_params.out_evaluation_info->NumberOfDSCSlices[i];
dml2_core_calcs_get_stream_support_info(&l->svp_expanded_display_cfg, &core->clean_me_up.mode_lib, &in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index], i); dml2_core_calcs_get_stream_support_info(&l->svp_expanded_display_cfg, &core->clean_me_up.mode_lib, &in_out->mode_support_result.cfg_support_info.stream_support_info[stream_index], i);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -58,7 +58,10 @@ static void calculate_system_active_minimums(struct dml2_dpmm_map_mode_to_soc_dp ...@@ -58,7 +58,10 @@ static void calculate_system_active_minimums(struct dml2_dpmm_map_mode_to_soc_dp
min_uclk_avg = (double)min_uclk_avg / ((double)in_out->soc_bb->qos_parameters.derate_table.system_active_average.dram_derate_percent_pixel / 100); min_uclk_avg = (double)min_uclk_avg / ((double)in_out->soc_bb->qos_parameters.derate_table.system_active_average.dram_derate_percent_pixel / 100);
min_uclk_urgent = dram_bw_kbps_to_uclk_khz(mode_support_result->global.active.urgent_bw_dram_kbps, &in_out->soc_bb->clk_table.dram_config); min_uclk_urgent = dram_bw_kbps_to_uclk_khz(mode_support_result->global.active.urgent_bw_dram_kbps, &in_out->soc_bb->clk_table.dram_config);
min_uclk_urgent = (double)min_uclk_urgent / ((double)in_out->soc_bb->qos_parameters.derate_table.system_active_urgent.dram_derate_percent_pixel / 100); if (in_out->display_cfg->display_config.hostvm_enable)
min_uclk_urgent = (double)min_uclk_urgent / ((double)in_out->soc_bb->qos_parameters.derate_table.system_active_urgent.dram_derate_percent_pixel_and_vm / 100);
else
min_uclk_urgent = (double)min_uclk_urgent / ((double)in_out->soc_bb->qos_parameters.derate_table.system_active_urgent.dram_derate_percent_pixel / 100);
min_uclk_bw = min_uclk_urgent > min_uclk_avg ? min_uclk_urgent : min_uclk_avg; min_uclk_bw = min_uclk_urgent > min_uclk_avg ? min_uclk_urgent : min_uclk_avg;
...@@ -226,13 +229,9 @@ static bool round_up_to_next_dpm(unsigned long *clock_value, const struct dml2_c ...@@ -226,13 +229,9 @@ static bool round_up_to_next_dpm(unsigned long *clock_value, const struct dml2_c
return round_up_and_copy_to_next_dpm(*clock_value, clock_value, clock_table); return round_up_and_copy_to_next_dpm(*clock_value, clock_value, clock_table);
} }
static bool map_min_clocks_to_dpm(const struct dml2_core_mode_support_result *mode_support_result, struct dml2_display_cfg_programming *display_cfg, const struct dml2_soc_state_table *state_table) static bool map_soc_min_clocks_to_dpm_fine_grained(struct dml2_display_cfg_programming *display_cfg, const struct dml2_soc_state_table *state_table)
{ {
bool result; bool result;
unsigned int i;
if (!state_table || !display_cfg)
return false;
result = round_up_to_next_dpm(&display_cfg->min_clocks.dcn4.active.dcfclk_khz, &state_table->dcfclk); result = round_up_to_next_dpm(&display_cfg->min_clocks.dcn4.active.dcfclk_khz, &state_table->dcfclk);
if (result) if (result)
...@@ -254,6 +253,77 @@ static bool map_min_clocks_to_dpm(const struct dml2_core_mode_support_result *mo ...@@ -254,6 +253,77 @@ static bool map_min_clocks_to_dpm(const struct dml2_core_mode_support_result *mo
if (result) if (result)
result = round_up_to_next_dpm(&display_cfg->min_clocks.dcn4.idle.uclk_khz, &state_table->uclk); result = round_up_to_next_dpm(&display_cfg->min_clocks.dcn4.idle.uclk_khz, &state_table->uclk);
return result;
}
static bool map_soc_min_clocks_to_dpm_coarse_grained(struct dml2_display_cfg_programming *display_cfg, const struct dml2_soc_state_table *state_table)
{
bool result;
int index;
result = false;
for (index = 0; index < state_table->uclk.num_clk_values; index++) {
if (display_cfg->min_clocks.dcn4.active.dcfclk_khz <= state_table->dcfclk.clk_values_khz[index] &&
display_cfg->min_clocks.dcn4.active.fclk_khz <= state_table->fclk.clk_values_khz[index] &&
display_cfg->min_clocks.dcn4.active.uclk_khz <= state_table->uclk.clk_values_khz[index]) {
display_cfg->min_clocks.dcn4.active.dcfclk_khz = state_table->dcfclk.clk_values_khz[index];
display_cfg->min_clocks.dcn4.active.fclk_khz = state_table->fclk.clk_values_khz[index];
display_cfg->min_clocks.dcn4.active.uclk_khz = state_table->uclk.clk_values_khz[index];
result = true;
break;
}
}
if (result) {
result = false;
for (index = 0; index < state_table->uclk.num_clk_values; index++) {
if (display_cfg->min_clocks.dcn4.idle.dcfclk_khz <= state_table->dcfclk.clk_values_khz[index] &&
display_cfg->min_clocks.dcn4.idle.fclk_khz <= state_table->fclk.clk_values_khz[index] &&
display_cfg->min_clocks.dcn4.idle.uclk_khz <= state_table->uclk.clk_values_khz[index]) {
display_cfg->min_clocks.dcn4.idle.dcfclk_khz = state_table->dcfclk.clk_values_khz[index];
display_cfg->min_clocks.dcn4.idle.fclk_khz = state_table->fclk.clk_values_khz[index];
display_cfg->min_clocks.dcn4.idle.uclk_khz = state_table->uclk.clk_values_khz[index];
result = true;
break;
}
}
}
// SVP is not supported on any coarse grained SoCs
display_cfg->min_clocks.dcn4.svp_prefetch.dcfclk_khz = 0;
display_cfg->min_clocks.dcn4.svp_prefetch.fclk_khz = 0;
display_cfg->min_clocks.dcn4.svp_prefetch.uclk_khz = 0;
return result;
}
static bool map_min_clocks_to_dpm(const struct dml2_core_mode_support_result *mode_support_result, struct dml2_display_cfg_programming *display_cfg, const struct dml2_soc_state_table *state_table)
{
bool result = false;
bool dcfclk_fine_grained = false, fclk_fine_grained = false, clock_state_count_identical = false;
unsigned int i;
if (!state_table || !display_cfg)
return false;
if (state_table->dcfclk.num_clk_values == 2) {
dcfclk_fine_grained = true;
}
if (state_table->fclk.num_clk_values == 2) {
fclk_fine_grained = true;
}
if (state_table->fclk.num_clk_values == state_table->dcfclk.num_clk_values &&
state_table->fclk.num_clk_values == state_table->uclk.num_clk_values) {
clock_state_count_identical = true;
}
if (dcfclk_fine_grained || fclk_fine_grained || !clock_state_count_identical)
result = map_soc_min_clocks_to_dpm_fine_grained(display_cfg, state_table);
else
result = map_soc_min_clocks_to_dpm_coarse_grained(display_cfg, state_table);
if (result) if (result)
result = round_up_to_next_dpm(&display_cfg->min_clocks.dcn4.dispclk_khz, &state_table->dispclk); result = round_up_to_next_dpm(&display_cfg->min_clocks.dcn4.dispclk_khz, &state_table->dispclk);
...@@ -285,11 +355,11 @@ static bool map_min_clocks_to_dpm(const struct dml2_core_mode_support_result *mo ...@@ -285,11 +355,11 @@ static bool map_min_clocks_to_dpm(const struct dml2_core_mode_support_result *mo
static bool are_timings_trivially_synchronizable(struct dml2_display_cfg *display_config, int mask) static bool are_timings_trivially_synchronizable(struct dml2_display_cfg *display_config, int mask)
{ {
unsigned int i; unsigned char i;
bool identical = true; bool identical = true;
bool contains_drr = false; bool contains_drr = false;
unsigned int remap_array[DML2_MAX_PLANES]; unsigned char remap_array[DML2_MAX_PLANES];
unsigned int remap_array_size = 0; unsigned char remap_array_size = 0;
// Create a remap array to enable simple iteration through only masked stream indicies // Create a remap array to enable simple iteration through only masked stream indicies
for (i = 0; i < display_config->num_streams; i++) { for (i = 0; i < display_config->num_streams; i++) {
...@@ -324,10 +394,10 @@ static bool are_timings_trivially_synchronizable(struct dml2_display_cfg *displa ...@@ -324,10 +394,10 @@ static bool are_timings_trivially_synchronizable(struct dml2_display_cfg *displa
static int find_smallest_idle_time_in_vblank_us(struct dml2_dpmm_map_mode_to_soc_dpm_params_in_out *in_out, int mask) static int find_smallest_idle_time_in_vblank_us(struct dml2_dpmm_map_mode_to_soc_dpm_params_in_out *in_out, int mask)
{ {
unsigned int i; unsigned char i;
int min_idle_us = 0; int min_idle_us = 0;
unsigned int remap_array[DML2_MAX_PLANES]; unsigned char remap_array[DML2_MAX_PLANES];
unsigned int remap_array_size = 0; unsigned char remap_array_size = 0;
const struct dml2_core_mode_support_result *mode_support_result = &in_out->display_cfg->mode_support_result; const struct dml2_core_mode_support_result *mode_support_result = &in_out->display_cfg->mode_support_result;
// Create a remap array to enable simple iteration through only masked stream indicies // Create a remap array to enable simple iteration through only masked stream indicies
...@@ -468,7 +538,7 @@ static bool map_mode_to_soc_dpm(struct dml2_dpmm_map_mode_to_soc_dpm_params_in_o ...@@ -468,7 +538,7 @@ static bool map_mode_to_soc_dpm(struct dml2_dpmm_map_mode_to_soc_dpm_params_in_o
calculate_svp_prefetch_minimums(in_out); calculate_svp_prefetch_minimums(in_out);
calculate_idle_minimums(in_out); calculate_idle_minimums(in_out);
// In DCN4, there's no support for FCLK or DCFCLK DPM change before SVP prefetch starts, therefore // In NV4, there's no support for FCLK or DCFCLK DPM change before SVP prefetch starts, therefore
// active minimums must be boosted to prefetch minimums // active minimums must be boosted to prefetch minimums
if (in_out->programming->min_clocks.dcn4.svp_prefetch.uclk_khz > in_out->programming->min_clocks.dcn4.active.uclk_khz) if (in_out->programming->min_clocks.dcn4.svp_prefetch.uclk_khz > in_out->programming->min_clocks.dcn4.active.uclk_khz)
in_out->programming->min_clocks.dcn4.active.uclk_khz = in_out->programming->min_clocks.dcn4.svp_prefetch.uclk_khz; in_out->programming->min_clocks.dcn4.active.uclk_khz = in_out->programming->min_clocks.dcn4.svp_prefetch.uclk_khz;
......
...@@ -39,6 +39,7 @@ bool dml2_dpmm_create(enum dml2_project_id project_id, struct dml2_dpmm_instance ...@@ -39,6 +39,7 @@ bool dml2_dpmm_create(enum dml2_project_id project_id, struct dml2_dpmm_instance
break; break;
case dml2_project_dcn4x_stage2_auto_drr_svp: case dml2_project_dcn4x_stage2_auto_drr_svp:
out->map_mode_to_soc_dpm = &dpmm_dcn4_map_mode_to_soc_dpm; out->map_mode_to_soc_dpm = &dpmm_dcn4_map_mode_to_soc_dpm;
out->map_watermarks = &dpmm_dcn4_map_watermarks;
result = true; result = true;
break; break;
case dml2_project_invalid: case dml2_project_invalid:
......
...@@ -37,51 +37,27 @@ static unsigned long round_up_to_quantized_values(unsigned long value, const uns ...@@ -37,51 +37,27 @@ static unsigned long round_up_to_quantized_values(unsigned long value, const uns
return 0; return 0;
} }
static bool build_min_clock_table(const struct dml2_soc_bb *soc_bb, struct dml2_mcg_min_clock_table *min_table) static bool build_min_clk_table_fine_grained(const struct dml2_soc_bb *soc_bb, struct dml2_mcg_min_clock_table *min_table)
{ {
bool dcfclk_fine_grained = false, fclk_fine_grained = false;
int i; int i;
unsigned int j; unsigned int j;
bool dcfclk_fine_grained = false, fclk_fine_grained = false; unsigned long min_dcfclk_khz = 0;
unsigned long min_dcfclk_khz = 0, max_dcfclk_khz = 0; unsigned long min_fclk_khz = 0;
unsigned long min_fclk_khz = 0, max_fclk_khz = 0;
unsigned long prev_100, cur_50; unsigned long prev_100, cur_50;
if (!soc_bb || !min_table)
return false;
if (soc_bb->clk_table.dcfclk.num_clk_values < 2 || soc_bb->clk_table.fclk.num_clk_values < 2)
return false;
if (soc_bb->clk_table.uclk.num_clk_values > DML_MCG_MAX_CLK_TABLE_SIZE)
return false;
min_table->fixed_clocks_khz.amclk = 0;
min_table->fixed_clocks_khz.dprefclk = soc_bb->dprefclk_mhz * 1000;
min_table->fixed_clocks_khz.pcierefclk = soc_bb->pcie_refclk_mhz * 1000;
min_table->fixed_clocks_khz.dchubrefclk = soc_bb->dchub_refclk_mhz * 1000;
min_table->fixed_clocks_khz.xtalclk = soc_bb->xtalclk_mhz * 1000;
if (soc_bb->clk_table.dcfclk.num_clk_values == 2) { if (soc_bb->clk_table.dcfclk.num_clk_values == 2) {
dcfclk_fine_grained = true; dcfclk_fine_grained = true;
} }
max_dcfclk_khz = soc_bb->clk_table.dcfclk.clk_values_khz[soc_bb->clk_table.dcfclk.num_clk_values - 1];
min_dcfclk_khz = soc_bb->clk_table.dcfclk.clk_values_khz[0];
if (soc_bb->clk_table.fclk.num_clk_values == 2) { if (soc_bb->clk_table.fclk.num_clk_values == 2) {
fclk_fine_grained = true; fclk_fine_grained = true;
} }
max_fclk_khz = soc_bb->clk_table.fclk.clk_values_khz[soc_bb->clk_table.fclk.num_clk_values - 1];
min_fclk_khz = soc_bb->clk_table.fclk.clk_values_khz[0];
min_table->max_clocks_khz.dispclk = soc_bb->clk_table.dispclk.clk_values_khz[soc_bb->clk_table.dispclk.num_clk_values - 1];
min_table->max_clocks_khz.dppclk = soc_bb->clk_table.dppclk.clk_values_khz[soc_bb->clk_table.dppclk.num_clk_values - 1];
min_table->max_clocks_khz.dscclk = soc_bb->clk_table.dscclk.clk_values_khz[soc_bb->clk_table.dscclk.num_clk_values - 1];
min_table->max_clocks_khz.dtbclk = soc_bb->clk_table.dtbclk.clk_values_khz[soc_bb->clk_table.dtbclk.num_clk_values - 1];
min_table->max_clocks_khz.phyclk = soc_bb->clk_table.phyclk.clk_values_khz[soc_bb->clk_table.phyclk.num_clk_values - 1];
min_table->max_clocks_khz.dcfclk = max_dcfclk_khz; min_dcfclk_khz = soc_bb->clk_table.dcfclk.clk_values_khz[0];
min_table->max_clocks_khz.fclk = max_fclk_khz; min_fclk_khz = soc_bb->clk_table.fclk.clk_values_khz[0];
// First calculate the table for "balanced" bandwidths across UCLK/FCLK // First calculate the table for "balanced" bandwidths across UCLK/FCLK
for (i = 0; i < soc_bb->clk_table.uclk.num_clk_values; i++) { for (i = 0; i < soc_bb->clk_table.uclk.num_clk_values; i++) {
...@@ -154,3 +130,66 @@ static bool build_min_clock_table(const struct dml2_soc_bb *soc_bb, struct dml2_ ...@@ -154,3 +130,66 @@ static bool build_min_clock_table(const struct dml2_soc_bb *soc_bb, struct dml2_
return true; return true;
} }
static bool build_min_clk_table_coarse_grained(const struct dml2_soc_bb *soc_bb, struct dml2_mcg_min_clock_table *min_table)
{
int i;
for (i = 0; i < soc_bb->clk_table.uclk.num_clk_values; i++) {
min_table->dram_bw_table.entries[i].pre_derate_dram_bw_kbps = uclk_to_dram_bw_kbps(soc_bb->clk_table.uclk.clk_values_khz[i], &soc_bb->clk_table.dram_config);
min_table->dram_bw_table.entries[i].min_dcfclk_khz = soc_bb->clk_table.dcfclk.clk_values_khz[i];
min_table->dram_bw_table.entries[i].min_fclk_khz = soc_bb->clk_table.fclk.clk_values_khz[i];
}
min_table->dram_bw_table.num_entries = soc_bb->clk_table.uclk.num_clk_values;
return true;
}
static bool build_min_clock_table(const struct dml2_soc_bb *soc_bb, struct dml2_mcg_min_clock_table *min_table)
{
bool result;
bool dcfclk_fine_grained = false, fclk_fine_grained = false, clock_state_count_equal = false;
if (!soc_bb || !min_table)
return false;
if (soc_bb->clk_table.dcfclk.num_clk_values < 2 || soc_bb->clk_table.fclk.num_clk_values < 2)
return false;
if (soc_bb->clk_table.uclk.num_clk_values > DML_MCG_MAX_CLK_TABLE_SIZE)
return false;
if (soc_bb->clk_table.dcfclk.num_clk_values == 2) {
dcfclk_fine_grained = true;
}
if (soc_bb->clk_table.fclk.num_clk_values == 2) {
fclk_fine_grained = true;
}
if (soc_bb->clk_table.fclk.num_clk_values == soc_bb->clk_table.dcfclk.num_clk_values &&
soc_bb->clk_table.fclk.num_clk_values == soc_bb->clk_table.uclk.num_clk_values)
clock_state_count_equal = true;
min_table->fixed_clocks_khz.amclk = 0;
min_table->fixed_clocks_khz.dprefclk = soc_bb->dprefclk_mhz * 1000;
min_table->fixed_clocks_khz.pcierefclk = soc_bb->pcie_refclk_mhz * 1000;
min_table->fixed_clocks_khz.dchubrefclk = soc_bb->dchub_refclk_mhz * 1000;
min_table->fixed_clocks_khz.xtalclk = soc_bb->xtalclk_mhz * 1000;
min_table->max_clocks_khz.dispclk = soc_bb->clk_table.dispclk.clk_values_khz[soc_bb->clk_table.dispclk.num_clk_values - 1];
min_table->max_clocks_khz.dppclk = soc_bb->clk_table.dppclk.clk_values_khz[soc_bb->clk_table.dppclk.num_clk_values - 1];
min_table->max_clocks_khz.dscclk = soc_bb->clk_table.dscclk.clk_values_khz[soc_bb->clk_table.dscclk.num_clk_values - 1];
min_table->max_clocks_khz.dtbclk = soc_bb->clk_table.dtbclk.clk_values_khz[soc_bb->clk_table.dtbclk.num_clk_values - 1];
min_table->max_clocks_khz.phyclk = soc_bb->clk_table.phyclk.clk_values_khz[soc_bb->clk_table.phyclk.num_clk_values - 1];
min_table->max_clocks_khz.dcfclk = soc_bb->clk_table.dcfclk.clk_values_khz[soc_bb->clk_table.dcfclk.num_clk_values - 1];
min_table->max_clocks_khz.fclk = soc_bb->clk_table.fclk.clk_values_khz[soc_bb->clk_table.fclk.num_clk_values - 1];
if (dcfclk_fine_grained || fclk_fine_grained || !clock_state_count_equal)
result = build_min_clk_table_fine_grained(soc_bb, min_table);
else
result = build_min_clk_table_coarse_grained(soc_bb, min_table);
return result;
}
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
bool mcg_dcn4_build_min_clock_table(struct dml2_mcg_build_min_clock_table_params_in_out *in_out); bool mcg_dcn4_build_min_clock_table(struct dml2_mcg_build_min_clock_table_params_in_out *in_out);
bool mcg_dcn4_unit_test(void); bool mcg_dcn4_unit_test(void);
#endif #endif
\ No newline at end of file
...@@ -22,6 +22,23 @@ static void sort(double *list_a, int list_a_size) ...@@ -22,6 +22,23 @@ static void sort(double *list_a, int list_a_size)
} }
} }
static double get_max_reserved_time_on_all_planes_with_stream_index(struct display_configuation_with_meta *config, unsigned int stream_index)
{
struct dml2_plane_parameters *plane_descriptor;
long max_reserved_time_ns = 0;
for (unsigned int i = 0; i < config->display_config.num_planes; i++) {
plane_descriptor = &config->display_config.plane_descriptors[i];
if (plane_descriptor->stream_index == stream_index)
if (plane_descriptor->overrides.reserved_vblank_time_ns > max_reserved_time_ns)
max_reserved_time_ns = plane_descriptor->overrides.reserved_vblank_time_ns;
}
return (max_reserved_time_ns / 1000.0);
}
static void set_reserved_time_on_all_planes_with_stream_index(struct display_configuation_with_meta *config, unsigned int stream_index, double reserved_time_us) static void set_reserved_time_on_all_planes_with_stream_index(struct display_configuation_with_meta *config, unsigned int stream_index, double reserved_time_us)
{ {
struct dml2_plane_parameters *plane_descriptor; struct dml2_plane_parameters *plane_descriptor;
...@@ -183,11 +200,11 @@ static int count_planes_with_stream_index(const struct dml2_display_cfg *display ...@@ -183,11 +200,11 @@ static int count_planes_with_stream_index(const struct dml2_display_cfg *display
static bool are_timings_trivially_synchronizable(struct display_configuation_with_meta *display_config, int mask) static bool are_timings_trivially_synchronizable(struct display_configuation_with_meta *display_config, int mask)
{ {
unsigned int i; unsigned char i;
bool identical = true; bool identical = true;
bool contains_drr = false; bool contains_drr = false;
unsigned int remap_array[DML2_MAX_PLANES]; unsigned char remap_array[DML2_MAX_PLANES];
unsigned int remap_array_size = 0; unsigned char remap_array_size = 0;
// Create a remap array to enable simple iteration through only masked stream indicies // Create a remap array to enable simple iteration through only masked stream indicies
for (i = 0; i < display_config->display_config.num_streams; i++) { for (i = 0; i < display_config->display_config.num_streams; i++) {
...@@ -227,7 +244,7 @@ bool pmo_dcn3_initialize(struct dml2_pmo_initialize_in_out *in_out) ...@@ -227,7 +244,7 @@ bool pmo_dcn3_initialize(struct dml2_pmo_initialize_in_out *in_out)
pmo->ip_caps = in_out->ip_caps; pmo->ip_caps = in_out->ip_caps;
pmo->mpc_combine_limit = 2; pmo->mpc_combine_limit = 2;
pmo->odm_combine_limit = 4; pmo->odm_combine_limit = 4;
pmo->min_clock_table_size = in_out->min_clock_table_size; pmo->mcg_clock_table_size = in_out->mcg_clock_table_size;
pmo->options = in_out->options; pmo->options = in_out->options;
...@@ -520,7 +537,7 @@ bool pmo_dcn3_init_for_pstate_support(struct dml2_pmo_init_for_pstate_support_in ...@@ -520,7 +537,7 @@ bool pmo_dcn3_init_for_pstate_support(struct dml2_pmo_init_for_pstate_support_in
state->performed = true; state->performed = true;
state->min_clk_index_for_latency = in_out->base_display_config->stage1.min_clk_index_for_latency; state->min_clk_index_for_latency = in_out->base_display_config->stage1.min_clk_index_for_latency;
pmo->scratch.pmo_dcn3.min_latency_index = in_out->base_display_config->stage1.min_clk_index_for_latency; pmo->scratch.pmo_dcn3.min_latency_index = in_out->base_display_config->stage1.min_clk_index_for_latency;
pmo->scratch.pmo_dcn3.max_latency_index = pmo->min_clock_table_size; pmo->scratch.pmo_dcn3.max_latency_index = pmo->mcg_clock_table_size - 1;
pmo->scratch.pmo_dcn3.cur_latency_index = in_out->base_display_config->stage1.min_clk_index_for_latency; pmo->scratch.pmo_dcn3.cur_latency_index = in_out->base_display_config->stage1.min_clk_index_for_latency;
pmo->scratch.pmo_dcn3.stream_mask = 0xF; pmo->scratch.pmo_dcn3.stream_mask = 0xF;
...@@ -578,6 +595,8 @@ bool pmo_dcn3_init_for_pstate_support(struct dml2_pmo_init_for_pstate_support_in ...@@ -578,6 +595,8 @@ bool pmo_dcn3_init_for_pstate_support(struct dml2_pmo_init_for_pstate_support_in
in_out->instance->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us); in_out->instance->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us);
*/ */
min_reserved_vblank_time = get_max_reserved_time_on_all_planes_with_stream_index(in_out->base_display_config, stream_index);
// Insert the absolute minimum into the array // Insert the absolute minimum into the array
candidate_count = 1; candidate_count = 1;
pmo->scratch.pmo_dcn3.reserved_time_candidates[stream_index][0] = min_reserved_vblank_time; pmo->scratch.pmo_dcn3.reserved_time_candidates[stream_index][0] = min_reserved_vblank_time;
......
...@@ -284,7 +284,7 @@ bool pmo_dcn4_initialize(struct dml2_pmo_initialize_in_out *in_out) ...@@ -284,7 +284,7 @@ bool pmo_dcn4_initialize(struct dml2_pmo_initialize_in_out *in_out)
pmo->ip_caps = in_out->ip_caps; pmo->ip_caps = in_out->ip_caps;
pmo->mpc_combine_limit = 2; pmo->mpc_combine_limit = 2;
pmo->odm_combine_limit = 4; pmo->odm_combine_limit = 4;
pmo->min_clock_table_size = in_out->min_clock_table_size; pmo->mcg_clock_table_size = in_out->mcg_clock_table_size;
pmo->fams_params.v1.subvp.fw_processing_delay_us = 10; pmo->fams_params.v1.subvp.fw_processing_delay_us = 10;
pmo->fams_params.v1.subvp.prefetch_end_to_mall_start_us = 50; pmo->fams_params.v1.subvp.prefetch_end_to_mall_start_us = 50;
...@@ -499,11 +499,11 @@ bool pmo_dcn4_optimize_for_vmin(struct dml2_pmo_optimize_for_vmin_in_out *in_out ...@@ -499,11 +499,11 @@ bool pmo_dcn4_optimize_for_vmin(struct dml2_pmo_optimize_for_vmin_in_out *in_out
static bool are_timings_trivially_synchronizable(const struct display_configuation_with_meta *display_config, int mask) static bool are_timings_trivially_synchronizable(const struct display_configuation_with_meta *display_config, int mask)
{ {
unsigned int i; unsigned char i;
bool identical = true; bool identical = true;
bool contains_drr = false; bool contains_drr = false;
unsigned int remap_array[DML2_MAX_PLANES]; unsigned char remap_array[DML2_MAX_PLANES];
unsigned int remap_array_size = 0; unsigned char remap_array_size = 0;
// Create a remap array to enable simple iteration through only masked stream indicies // Create a remap array to enable simple iteration through only masked stream indicies
for (i = 0; i < display_config->display_config.num_streams; i++) { for (i = 0; i < display_config->display_config.num_streams; i++) {
...@@ -603,7 +603,7 @@ static bool all_planes_match_strategy(const struct display_configuation_with_met ...@@ -603,7 +603,7 @@ static bool all_planes_match_strategy(const struct display_configuation_with_met
} }
static bool subvp_subvp_schedulable(struct dml2_pmo_instance *pmo, const struct display_configuation_with_meta *display_cfg, static bool subvp_subvp_schedulable(struct dml2_pmo_instance *pmo, const struct display_configuation_with_meta *display_cfg,
unsigned int *svp_stream_indicies, int svp_stream_count) unsigned char *svp_stream_indicies, char svp_stream_count)
{ {
struct dml2_pmo_scratch *s = &pmo->scratch; struct dml2_pmo_scratch *s = &pmo->scratch;
int i; int i;
...@@ -669,10 +669,10 @@ static bool validate_svp_cofunctionality(struct dml2_pmo_instance *pmo, ...@@ -669,10 +669,10 @@ static bool validate_svp_cofunctionality(struct dml2_pmo_instance *pmo,
const struct display_configuation_with_meta *display_cfg, int svp_stream_mask) const struct display_configuation_with_meta *display_cfg, int svp_stream_mask)
{ {
bool result = false; bool result = false;
unsigned int stream_index; unsigned char stream_index;
unsigned int svp_stream_indicies[2] = { 0 }; unsigned char svp_stream_indicies[2] = { 0 };
unsigned int svp_stream_count = 0; unsigned char svp_stream_count = 0;
// Find the SVP streams, store only the first 2, but count all of them // Find the SVP streams, store only the first 2, but count all of them
for (stream_index = 0; stream_index < display_cfg->display_config.num_streams; stream_index++) { for (stream_index = 0; stream_index < display_cfg->display_config.num_streams; stream_index++) {
...@@ -696,7 +696,7 @@ static bool validate_svp_cofunctionality(struct dml2_pmo_instance *pmo, ...@@ -696,7 +696,7 @@ static bool validate_svp_cofunctionality(struct dml2_pmo_instance *pmo,
static bool validate_drr_cofunctionality(struct dml2_pmo_instance *pmo, static bool validate_drr_cofunctionality(struct dml2_pmo_instance *pmo,
const struct display_configuation_with_meta *display_cfg, int drr_stream_mask) const struct display_configuation_with_meta *display_cfg, int drr_stream_mask)
{ {
unsigned int stream_index; unsigned char stream_index;
int drr_stream_count = 0; int drr_stream_count = 0;
// Find the SVP streams and count all of them // Find the SVP streams and count all of them
...@@ -712,7 +712,7 @@ static bool validate_drr_cofunctionality(struct dml2_pmo_instance *pmo, ...@@ -712,7 +712,7 @@ static bool validate_drr_cofunctionality(struct dml2_pmo_instance *pmo,
static bool validate_svp_drr_cofunctionality(struct dml2_pmo_instance *pmo, static bool validate_svp_drr_cofunctionality(struct dml2_pmo_instance *pmo,
const struct display_configuation_with_meta *display_cfg, int svp_stream_mask, int drr_stream_mask) const struct display_configuation_with_meta *display_cfg, int svp_stream_mask, int drr_stream_mask)
{ {
unsigned int stream_index; unsigned char stream_index;
int drr_stream_count = 0; int drr_stream_count = 0;
int svp_stream_count = 0; int svp_stream_count = 0;
...@@ -781,7 +781,7 @@ static bool validate_svp_drr_cofunctionality(struct dml2_pmo_instance *pmo, ...@@ -781,7 +781,7 @@ static bool validate_svp_drr_cofunctionality(struct dml2_pmo_instance *pmo,
static bool validate_svp_vblank_cofunctionality(struct dml2_pmo_instance *pmo, static bool validate_svp_vblank_cofunctionality(struct dml2_pmo_instance *pmo,
const struct display_configuation_with_meta *display_cfg, int svp_stream_mask, int vblank_stream_mask) const struct display_configuation_with_meta *display_cfg, int svp_stream_mask, int vblank_stream_mask)
{ {
unsigned int stream_index; unsigned char stream_index;
int vblank_stream_count = 0; int vblank_stream_count = 0;
int svp_stream_count = 0; int svp_stream_count = 0;
...@@ -853,7 +853,7 @@ static bool validate_pstate_support_strategy_cofunctionality(struct dml2_pmo_ins ...@@ -853,7 +853,7 @@ static bool validate_pstate_support_strategy_cofunctionality(struct dml2_pmo_ins
{ {
struct dml2_pmo_scratch *s = &pmo->scratch; struct dml2_pmo_scratch *s = &pmo->scratch;
unsigned int stream_index = 0; unsigned char stream_index = 0;
unsigned int svp_count = 0; unsigned int svp_count = 0;
unsigned int svp_stream_mask = 0; unsigned int svp_stream_mask = 0;
...@@ -967,7 +967,7 @@ bool pmo_dcn4_init_for_pstate_support(struct dml2_pmo_init_for_pstate_support_in ...@@ -967,7 +967,7 @@ bool pmo_dcn4_init_for_pstate_support(struct dml2_pmo_init_for_pstate_support_in
memset(s, 0, sizeof(struct dml2_pmo_scratch)); memset(s, 0, sizeof(struct dml2_pmo_scratch));
pmo->scratch.pmo_dcn4.min_latency_index = in_out->base_display_config->stage1.min_clk_index_for_latency; pmo->scratch.pmo_dcn4.min_latency_index = in_out->base_display_config->stage1.min_clk_index_for_latency;
pmo->scratch.pmo_dcn4.max_latency_index = pmo->min_clock_table_size; pmo->scratch.pmo_dcn4.max_latency_index = pmo->mcg_clock_table_size - 1;
pmo->scratch.pmo_dcn4.cur_latency_index = in_out->base_display_config->stage1.min_clk_index_for_latency; pmo->scratch.pmo_dcn4.cur_latency_index = in_out->base_display_config->stage1.min_clk_index_for_latency;
// First build the stream plane mask (array of bitfields indexed by stream, indicating plane mapping) // First build the stream plane mask (array of bitfields indexed by stream, indicating plane mapping)
...@@ -1071,7 +1071,7 @@ static void reset_display_configuration(struct display_configuation_with_meta *d ...@@ -1071,7 +1071,7 @@ static void reset_display_configuration(struct display_configuation_with_meta *d
static void setup_planes_for_drr_by_mask(struct display_configuation_with_meta *display_config, int plane_mask) static void setup_planes_for_drr_by_mask(struct display_configuation_with_meta *display_config, int plane_mask)
{ {
unsigned int plane_index; unsigned char plane_index;
struct dml2_plane_parameters *plane; struct dml2_plane_parameters *plane;
for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) { for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) {
...@@ -1088,7 +1088,7 @@ static void setup_planes_for_drr_by_mask(struct display_configuation_with_meta * ...@@ -1088,7 +1088,7 @@ static void setup_planes_for_drr_by_mask(struct display_configuation_with_meta *
static void setup_planes_for_svp_by_mask(struct display_configuation_with_meta *display_config, int plane_mask) static void setup_planes_for_svp_by_mask(struct display_configuation_with_meta *display_config, int plane_mask)
{ {
unsigned int plane_index; unsigned char plane_index;
int stream_index = -1; int stream_index = -1;
for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) { for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) {
...@@ -1110,7 +1110,7 @@ static void setup_planes_for_svp_by_mask(struct display_configuation_with_meta * ...@@ -1110,7 +1110,7 @@ static void setup_planes_for_svp_by_mask(struct display_configuation_with_meta *
static void setup_planes_for_vblank_by_mask(struct display_configuation_with_meta *display_config, int plane_mask) static void setup_planes_for_vblank_by_mask(struct display_configuation_with_meta *display_config, int plane_mask)
{ {
unsigned int plane_index; unsigned char plane_index;
struct dml2_plane_parameters *plane; struct dml2_plane_parameters *plane;
for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) { for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) {
...@@ -1127,7 +1127,7 @@ static void setup_planes_for_vblank_by_mask(struct display_configuation_with_met ...@@ -1127,7 +1127,7 @@ static void setup_planes_for_vblank_by_mask(struct display_configuation_with_met
static void setup_planes_for_vactive_by_mask(struct display_configuation_with_meta *display_config, int plane_mask) static void setup_planes_for_vactive_by_mask(struct display_configuation_with_meta *display_config, int plane_mask)
{ {
unsigned int plane_index; unsigned char plane_index;
for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) { for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) {
if (is_bit_set_in_bitfield(plane_mask, plane_index)) { if (is_bit_set_in_bitfield(plane_mask, plane_index)) {
...@@ -1139,7 +1139,7 @@ static void setup_planes_for_vactive_by_mask(struct display_configuation_with_me ...@@ -1139,7 +1139,7 @@ static void setup_planes_for_vactive_by_mask(struct display_configuation_with_me
static bool setup_display_config(struct display_configuation_with_meta *display_config, struct dml2_pmo_scratch *scratch, int strategy_index) static bool setup_display_config(struct display_configuation_with_meta *display_config, struct dml2_pmo_scratch *scratch, int strategy_index)
{ {
bool success = true; bool success = true;
unsigned int stream_index; unsigned char stream_index;
reset_display_configuration(display_config); reset_display_configuration(display_config);
...@@ -1164,7 +1164,7 @@ static bool setup_display_config(struct display_configuation_with_meta *display_ ...@@ -1164,7 +1164,7 @@ static bool setup_display_config(struct display_configuation_with_meta *display_
static int get_minimum_reserved_time_us_for_planes(struct display_configuation_with_meta *display_config, int plane_mask) static int get_minimum_reserved_time_us_for_planes(struct display_configuation_with_meta *display_config, int plane_mask)
{ {
int min_time_us = 0xFFFFFF; int min_time_us = 0xFFFFFF;
unsigned int plane_index = 0; unsigned char plane_index = 0;
for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) { for (plane_index = 0; plane_index < display_config->display_config.num_planes; plane_index++) {
if (is_bit_set_in_bitfield(plane_mask, plane_index)) { if (is_bit_set_in_bitfield(plane_mask, plane_index)) {
......
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
bool dml2_pmo_create(enum dml2_project_id project_id, struct dml2_pmo_instance *out); bool dml2_pmo_create(enum dml2_project_id project_id, struct dml2_pmo_instance *out);
#endif #endif
\ No newline at end of file
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
#include "lib_float_math.h" #include "lib_float_math.h"
#ifndef ASSERT
#define ASSERT(condition) #define ASSERT(condition)
#endif
#define isNaN(number) ((number) != (number)) #define isNaN(number) ((number) != (number))
...@@ -132,9 +130,21 @@ float math_log2(float a) ...@@ -132,9 +130,21 @@ float math_log2(float a)
return math_log(a, 2.0); return math_log(a, 2.0);
} }
// approximate log2 value of a input
// - precise if the input pwr of 2, else the approximation will be an integer = floor(actual_log2)
unsigned int math_log2_approx(unsigned int a)
{
unsigned int log2_val = 0;
while (a > 1) {
a = a >> 1;
log2_val++;
}
return log2_val;
}
double math_round(double a) double math_round(double a)
{ {
const double round_pt = 0.5; const double round_pt = 0.5;
return math_floor(a + round_pt); return math_floor(a + round_pt);
} }
\ No newline at end of file
...@@ -20,6 +20,7 @@ float math_pow(float a, float exp); ...@@ -20,6 +20,7 @@ float math_pow(float a, float exp);
double math_fabs(double a); double math_fabs(double a);
float math_log(float a, float b); float math_log(float a, float b);
float math_log2(float a); float math_log2(float a);
unsigned int math_log2_approx(unsigned int a);
double math_round(double a); double math_round(double a);
#endif #endif
\ No newline at end of file
...@@ -72,7 +72,7 @@ bool dml2_initialize_instance(struct dml2_initialize_instance_in_out *in_out) ...@@ -72,7 +72,7 @@ bool dml2_initialize_instance(struct dml2_initialize_instance_in_out *in_out)
pmo_init_params.instance = &dml->pmo_instance; pmo_init_params.instance = &dml->pmo_instance;
pmo_init_params.soc_bb = &dml->soc_bbox; pmo_init_params.soc_bb = &dml->soc_bbox;
pmo_init_params.ip_caps = &dml->ip_caps; pmo_init_params.ip_caps = &dml->ip_caps;
pmo_init_params.min_clock_table_size = dml->min_clk_table.dram_bw_table.num_entries; pmo_init_params.mcg_clock_table_size = dml->min_clk_table.dram_bw_table.num_entries;
pmo_init_params.options = &dml->pmo_options; pmo_init_params.options = &dml->pmo_options;
dml->pmo_instance.initialize(&pmo_init_params); dml->pmo_instance.initialize(&pmo_init_params);
} }
...@@ -123,6 +123,7 @@ bool dml2_check_mode_supported(struct dml2_check_mode_supported_in_out *in_out) ...@@ -123,6 +123,7 @@ bool dml2_check_mode_supported(struct dml2_check_mode_supported_in_out *in_out)
} }
in_out->is_supported = mcache_success; in_out->is_supported = mcache_success;
result = result && in_out->is_supported;
return result; return result;
} }
......
...@@ -319,6 +319,26 @@ bool dml2_top_mcache_validate_admissability(struct top_mcache_validate_admissabi ...@@ -319,6 +319,26 @@ bool dml2_top_mcache_validate_admissability(struct top_mcache_validate_admissabi
return all_pass; return all_pass;
} }
static void reset_mcache_allocations(struct dml2_hubp_pipe_mcache_regs *per_plane_pipe_mcache_regs)
{
// Initialize all entries to special valid MCache ID and special valid split coordinate
per_plane_pipe_mcache_regs->main.p0.mcache_id_first = MCACHE_ID_UNASSIGNED;
per_plane_pipe_mcache_regs->main.p0.mcache_id_second = MCACHE_ID_UNASSIGNED;
per_plane_pipe_mcache_regs->main.p0.split_location = SPLIT_LOCATION_UNDEFINED;
per_plane_pipe_mcache_regs->mall.p0.mcache_id_first = MCACHE_ID_UNASSIGNED;
per_plane_pipe_mcache_regs->mall.p0.mcache_id_second = MCACHE_ID_UNASSIGNED;
per_plane_pipe_mcache_regs->mall.p0.split_location = SPLIT_LOCATION_UNDEFINED;
per_plane_pipe_mcache_regs->main.p1.mcache_id_first = MCACHE_ID_UNASSIGNED;
per_plane_pipe_mcache_regs->main.p1.mcache_id_second = MCACHE_ID_UNASSIGNED;
per_plane_pipe_mcache_regs->main.p1.split_location = SPLIT_LOCATION_UNDEFINED;
per_plane_pipe_mcache_regs->mall.p1.mcache_id_first = MCACHE_ID_UNASSIGNED;
per_plane_pipe_mcache_regs->mall.p1.mcache_id_second = MCACHE_ID_UNASSIGNED;
per_plane_pipe_mcache_regs->mall.p1.split_location = SPLIT_LOCATION_UNDEFINED;
}
bool dml2_top_mcache_build_mcache_programming(struct dml2_build_mcache_programming_in_out *params) bool dml2_top_mcache_build_mcache_programming(struct dml2_build_mcache_programming_in_out *params)
{ {
bool success = true; bool success = true;
...@@ -333,22 +353,7 @@ bool dml2_top_mcache_build_mcache_programming(struct dml2_build_mcache_programmi ...@@ -333,22 +353,7 @@ bool dml2_top_mcache_build_mcache_programming(struct dml2_build_mcache_programmi
// Allocate storage for the mcache regs // Allocate storage for the mcache regs
params->per_plane_pipe_mcache_regs[config_index][pipe_index] = &params->mcache_regs_set[free_per_plane_reg_index++]; params->per_plane_pipe_mcache_regs[config_index][pipe_index] = &params->mcache_regs_set[free_per_plane_reg_index++];
// First initialize all entries to special valid MCache ID and special valid split coordinate reset_mcache_allocations(params->per_plane_pipe_mcache_regs[config_index][pipe_index]);
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->main.p0.mcache_id_first = MCACHE_ID_UNASSIGNED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->main.p0.mcache_id_second = MCACHE_ID_UNASSIGNED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->main.p0.split_location = SPLIT_LOCATION_UNDEFINED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->mall.p0.mcache_id_first = MCACHE_ID_UNASSIGNED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->mall.p0.mcache_id_second = MCACHE_ID_UNASSIGNED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->mall.p0.split_location = SPLIT_LOCATION_UNDEFINED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->main.p1.mcache_id_first = MCACHE_ID_UNASSIGNED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->main.p1.mcache_id_second = MCACHE_ID_UNASSIGNED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->main.p1.split_location = SPLIT_LOCATION_UNDEFINED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->mall.p1.mcache_id_first = MCACHE_ID_UNASSIGNED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->mall.p1.mcache_id_second = MCACHE_ID_UNASSIGNED;
params->per_plane_pipe_mcache_regs[config_index][pipe_index]->mall.p1.split_location = SPLIT_LOCATION_UNDEFINED;
if (params->mcache_configurations[config_index].plane_descriptor->surface.dcc.enable) { if (params->mcache_configurations[config_index].plane_descriptor->surface.dcc.enable) {
// P0 always enabled // P0 always enabled
......
...@@ -21,4 +21,4 @@ bool dml2_top_mcache_build_mcache_programming(struct dml2_build_mcache_programmi ...@@ -21,4 +21,4 @@ bool dml2_top_mcache_build_mcache_programming(struct dml2_build_mcache_programmi
bool dml2_top_mcache_unit_test(void); bool dml2_top_mcache_unit_test(void);
#endif #endif
\ No newline at end of file
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
int dml2_printf(const char *format, ...); int dml2_printf(const char *format, ...);
void dml2_assert(int condition); void dml2_assert(int condition);
#endif #endif
\ No newline at end of file
...@@ -146,10 +146,13 @@ struct core_plane_support_info { ...@@ -146,10 +146,13 @@ struct core_plane_support_info {
int active_latency_hiding_us; int active_latency_hiding_us;
int mall_svp_size_requirement_ways; int mall_svp_size_requirement_ways;
int nominal_vblank_pstate_latency_hiding_us; int nominal_vblank_pstate_latency_hiding_us;
unsigned int dram_change_vactive_det_fill_delay_us;
}; };
struct core_stream_support_info { struct core_stream_support_info {
unsigned int odms_used; unsigned int odms_used;
unsigned int num_odm_output_segments; // for odm split mode (e.g. a value of 2 for odm_mode_mso_1to2)
/* FAMS2 SubVP support info */ /* FAMS2 SubVP support info */
unsigned int phantom_min_v_active; unsigned int phantom_min_v_active;
unsigned int phantom_v_startup; unsigned int phantom_v_startup;
...@@ -270,6 +273,7 @@ struct dml2_fams2_meta { ...@@ -270,6 +273,7 @@ struct dml2_fams2_meta {
double max_frame_time_us; double max_frame_time_us;
unsigned int dram_clk_change_blackout_otg_vlines; unsigned int dram_clk_change_blackout_otg_vlines;
struct { struct {
double max_vactive_det_fill_delay_us;
unsigned int max_vactive_det_fill_delay_otg_vlines; unsigned int max_vactive_det_fill_delay_otg_vlines;
struct dml2_fams2_per_method_common_meta common; struct dml2_fams2_per_method_common_meta common;
} method_vactive; } method_vactive;
...@@ -390,6 +394,7 @@ struct dml2_core_mode_programming_in_out { ...@@ -390,6 +394,7 @@ struct dml2_core_mode_programming_in_out {
* Outputs (also Input the clk freq are also from programming struct) * Outputs (also Input the clk freq are also from programming struct)
*/ */
struct dml2_display_cfg_programming *programming; struct dml2_display_cfg_programming *programming;
}; };
struct dml2_core_populate_informative_in_out { struct dml2_core_populate_informative_in_out {
...@@ -481,7 +486,7 @@ struct dml2_pmo_initialize_in_out { ...@@ -481,7 +486,7 @@ struct dml2_pmo_initialize_in_out {
struct dml2_soc_bb *soc_bb; struct dml2_soc_bb *soc_bb;
struct dml2_ip_capabilities *ip_caps; struct dml2_ip_capabilities *ip_caps;
struct dml2_pmo_options *options; struct dml2_pmo_options *options;
int min_clock_table_size; int mcg_clock_table_size;
}; };
struct dml2_pmo_optimize_dcc_mcache_in_out { struct dml2_pmo_optimize_dcc_mcache_in_out {
...@@ -602,14 +607,14 @@ enum dml2_pmo_pstate_strategy { ...@@ -602,14 +607,14 @@ enum dml2_pmo_pstate_strategy {
dml2_pmo_pstate_strategy_fw_vactive_drr = 11, dml2_pmo_pstate_strategy_fw_vactive_drr = 11,
dml2_pmo_pstate_strategy_fw_vblank_drr = 12, dml2_pmo_pstate_strategy_fw_vblank_drr = 12,
dml2_pmo_pstate_strategy_fw_svp_drr = 13, dml2_pmo_pstate_strategy_fw_svp_drr = 13,
dml2_pmo_pstate_strategy_reserved_fw_drr_fixed = 20, dml2_pmo_pstate_strategy_reserved_fw_drr_clamped = 20,
dml2_pmo_pstate_strategy_fw_drr = 21, dml2_pmo_pstate_strategy_fw_drr = 21,
dml2_pmo_pstate_strategy_reserved_fw_drr_var = 22, dml2_pmo_pstate_strategy_reserved_fw_drr_var = 22,
}; };
#define PMO_NO_DRR_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw - dml2_pmo_pstate_strategy_na + 1)) - 1) << dml2_pmo_pstate_strategy_na) #define PMO_NO_DRR_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw - dml2_pmo_pstate_strategy_na + 1)) - 1) << dml2_pmo_pstate_strategy_na)
#define PMO_DRR_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw_drr_var - dml2_pmo_pstate_strategy_fw_vactive_drr + 1)) - 1) << dml2_pmo_pstate_strategy_fw_vactive_drr) #define PMO_DRR_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw_drr_var - dml2_pmo_pstate_strategy_fw_vactive_drr + 1)) - 1) << dml2_pmo_pstate_strategy_fw_vactive_drr)
#define PMO_DRR_FIXED_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_fw_drr - dml2_pmo_pstate_strategy_fw_vactive_drr + 1)) - 1) << dml2_pmo_pstate_strategy_fw_vactive_drr) #define PMO_DRR_CLAMPED_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw_drr_clamped - dml2_pmo_pstate_strategy_fw_vactive_drr + 1)) - 1) << dml2_pmo_pstate_strategy_fw_vactive_drr)
#define PMO_DRR_VAR_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw_drr_var - dml2_pmo_pstate_strategy_fw_drr + 1)) - 1) << dml2_pmo_pstate_strategy_fw_drr) #define PMO_DRR_VAR_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw_drr_var - dml2_pmo_pstate_strategy_fw_drr + 1)) - 1) << dml2_pmo_pstate_strategy_fw_drr)
#define PMO_FW_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw_drr_var - dml2_pmo_pstate_strategy_fw_svp + 1)) - 1) << dml2_pmo_pstate_strategy_fw_svp) #define PMO_FW_STRATEGY_MASK (((1 << (dml2_pmo_pstate_strategy_reserved_fw_drr_var - dml2_pmo_pstate_strategy_fw_svp + 1)) - 1) << dml2_pmo_pstate_strategy_fw_svp)
...@@ -671,7 +676,7 @@ struct dml2_pmo_init_data { ...@@ -671,7 +676,7 @@ struct dml2_pmo_init_data {
union { union {
struct { struct {
/* populated once during initialization */ /* populated once during initialization */
enum dml2_pmo_pstate_strategy expanded_strategy_list_1_display[PMO_DCN4_MAX_BASE_STRATEGIES * 1][PMO_DCN4_MAX_DISPLAYS]; enum dml2_pmo_pstate_strategy expanded_strategy_list_1_display[PMO_DCN4_MAX_BASE_STRATEGIES * 2][PMO_DCN4_MAX_DISPLAYS];
enum dml2_pmo_pstate_strategy expanded_strategy_list_2_display[PMO_DCN4_MAX_BASE_STRATEGIES * 2 * 2][PMO_DCN4_MAX_DISPLAYS]; enum dml2_pmo_pstate_strategy expanded_strategy_list_2_display[PMO_DCN4_MAX_BASE_STRATEGIES * 2 * 2][PMO_DCN4_MAX_DISPLAYS];
enum dml2_pmo_pstate_strategy expanded_strategy_list_3_display[PMO_DCN4_MAX_BASE_STRATEGIES * 6 * 2][PMO_DCN4_MAX_DISPLAYS]; enum dml2_pmo_pstate_strategy expanded_strategy_list_3_display[PMO_DCN4_MAX_BASE_STRATEGIES * 6 * 2][PMO_DCN4_MAX_DISPLAYS];
enum dml2_pmo_pstate_strategy expanded_strategy_list_4_display[PMO_DCN4_MAX_BASE_STRATEGIES * 24 * 2][PMO_DCN4_MAX_DISPLAYS]; enum dml2_pmo_pstate_strategy expanded_strategy_list_4_display[PMO_DCN4_MAX_BASE_STRATEGIES * 24 * 2][PMO_DCN4_MAX_DISPLAYS];
...@@ -689,7 +694,7 @@ struct dml2_pmo_instance { ...@@ -689,7 +694,7 @@ struct dml2_pmo_instance {
int disp_clk_vmin_threshold; int disp_clk_vmin_threshold;
int mpc_combine_limit; int mpc_combine_limit;
int odm_combine_limit; int odm_combine_limit;
int min_clock_table_size; int mcg_clock_table_size;
union { union {
struct { struct {
......
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