if (!pipe_ctx->top_pipe &&
!pipe_ctx->prev_odm_pipe &&
should_update_pipe_for_stream(context, pipe_ctx, stream)) {
- struct dc_stream_status *stream_status = NULL;
+ struct dc_stream_status *pipe_stream_status = NULL;
if (!pipe_ctx->plane_state)
continue;
if (update_type == UPDATE_TYPE_FAST)
continue;
- stream_status =
+ pipe_stream_status =
stream_get_status(context, pipe_ctx->stream);
- if (dc->hwss.apply_ctx_for_surface && stream_status)
+ if (dc->hwss.apply_ctx_for_surface && pipe_stream_status)
dc->hwss.apply_ctx_for_surface(
- dc, pipe_ctx->stream, stream_status->plane_count, context);
+ dc, pipe_ctx->stream, pipe_stream_status->plane_count, context);
}
}
}
if (dc->caps.dcmode_power_limits_present) {
- bool status;
+ bool dc_power_status;
DC_FP_START();
- status = dml2_create(dc, &dc->dml2_dc_power_options, &state->bw_ctx.dml2_dc_power_source);
+ dc_power_status = dml2_create(dc, &dc->dml2_dc_power_options, &state->bw_ctx.dml2_dc_power_source);
DC_FP_END();
- if (!status) {
+ if (!dc_power_status) {
dc_state_release(state);
return NULL;
}
if (dc->hwss.enable_writeback) {
struct dc_stream_status *stream_status = dc_stream_get_status(stream);
- struct dwbc *dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
+ dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
if (stream_status)
dwb->otg_inst = stream_status->primary_otg_inst;
}
/* enable writeback */
if (dc->hwss.enable_writeback) {
- struct dwbc *dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
+ dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
if (dwb->funcs->is_enabled(dwb)) {
/* writeback pipe already enabled, only need to update */
for (i = 0, k = 0; context && i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
- if (!resource_is_pipe_type(pipe, OTG_MASTER))
+ if (!resource_is_pipe_type(pipe, OTG_MASTER) || !pipe->stream)
continue;
stream_status = dc_state_get_stream_status(context, pipe->stream);
if (stream_status && stream_status->fpo_in_use) {
- struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
uint8_t min_refresh_in_hz;
min_refresh_in_hz = (uint8_t)((pipe->stream->timing.min_refresh_in_uhz + 999999) / 1000000);
mode_lib->vba.MaximumReadBandwidthWithoutPrefetch = 0.0;
mode_lib->vba.MaximumReadBandwidthWithPrefetch = 0.0;
for (k = 0; k <= mode_lib->vba.NumberOfActivePlanes - 1; k++) {
- unsigned int m;
+ unsigned int cursor_idx;
locals->cursor_bw[k] = 0;
locals->cursor_bw_pre[k] = 0;
- for (m = 0; m < mode_lib->vba.NumberOfCursors[k]; m++) {
- locals->cursor_bw[k] = mode_lib->vba.CursorWidth[k][m] * mode_lib->vba.CursorBPP[k][m]
+ for (cursor_idx = 0; cursor_idx < mode_lib->vba.NumberOfCursors[k]; cursor_idx++) {
+ locals->cursor_bw[k] = mode_lib->vba.CursorWidth[k][cursor_idx] * mode_lib->vba.CursorBPP[k][cursor_idx]
/ 8.0 / (mode_lib->vba.HTotal[k] / mode_lib->vba.PixelClock[k]) * mode_lib->vba.VRatio[k];
- locals->cursor_bw_pre[k] = mode_lib->vba.CursorWidth[k][m] * mode_lib->vba.CursorBPP[k][m]
+ locals->cursor_bw_pre[k] = mode_lib->vba.CursorWidth[k][cursor_idx] * mode_lib->vba.CursorBPP[k][cursor_idx]
/ 8.0 / (mode_lib->vba.HTotal[k] / mode_lib->vba.PixelClock[k]) * locals->VRatioPreY[i][j][k];
}
base->bw_params->wm_table.nv_entries[WM_D].pmfw_breakdown.max_uclk = 0xFFFF;
}
-void patch_dcn30_soc_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st *dcn3_0_ip)
+void patch_dcn30_soc_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st *soc_bb)
{
- (void)dcn3_0_ip;
+ (void)soc_bb;
dc_assert_fp_enabled();
if (dc->ctx->dc_bios->funcs->get_soc_bb_info) {
context->bw_ctx.dml.ip.odm_combine_4to1_supported = true;
for (i = 0; i < dc->res_pool->pipe_count; i++) {
- struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
+ struct pipe_ctx *cur_pipe = &context->res_ctx.pipe_ctx[i];
- if (!pipe->stream)
+ if (!cur_pipe->stream)
continue;
- if (pipe->stream->signal == SIGNAL_TYPE_EDP && dc->debug.seamless_boot_odm_combine &&
- pipe->stream->apply_seamless_boot_optimization) {
+ if (cur_pipe->stream->signal == SIGNAL_TYPE_EDP && dc->debug.seamless_boot_odm_combine &&
+ cur_pipe->stream->apply_seamless_boot_optimization) {
- if (pipe->stream->apply_boot_odm_mode == dm_odm_combine_policy_2to1) {
+ if (cur_pipe->stream->apply_boot_odm_mode == dm_odm_combine_policy_2to1) {
context->bw_ctx.dml.vba.ODMCombinePolicy = dm_odm_combine_policy_2to1;
break;
}
if (repopulate_pipes) {
int flag_max_mpc_comb = vba->maxMpcComb;
int flag_vlevel = vlevel;
- int i;
+ int j;
pipe_cnt = dc->res_pool->funcs->populate_dml_pipes(dc, context, pipes, validate_mode);
if (!dc->config.enable_windowed_mpo_odm)
dm_prefetch_support_uclk_fclk_and_stutter_if_possible;
vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, pipe_cnt);
+ const int num_states = (int)context->bw_ctx.dml.soc.num_states;
- if (vlevel == context->bw_ctx.dml.soc.num_states) {
+ if (vlevel == num_states) {
/* failed after DET size changes */
goto validate_fail;
} else if (flag_max_mpc_comb == 0 &&
flag_max_mpc_comb != context->bw_ctx.dml.vba.maxMpcComb) {
/* check the context constructed with pipe split flags is still valid*/
bool flags_valid = false;
- for (i = flag_vlevel; i < (int)context->bw_ctx.dml.soc.num_states; i++) {
- if (vba->ModeSupport[i][flag_max_mpc_comb]) {
+ for (j = flag_vlevel; j < (int)context->bw_ctx.dml.soc.num_states; j++) {
+ if (vba->ModeSupport[j][flag_max_mpc_comb]) {
vba->maxMpcComb = flag_max_mpc_comb;
- vba->VoltageLevel = i;
- vlevel = i;
+ vba->VoltageLevel = j;
+ vlevel = j;
flags_valid = true;
break;
}
}
for (i = 0; i < dc->res_pool->pipe_count; i++) {
- struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
+ struct pipe_ctx *cur_pipe = &context->res_ctx.pipe_ctx[i];
- if (!pipe->stream)
+ if (!cur_pipe->stream)
continue;
- if (pipe->stream->signal == SIGNAL_TYPE_EDP &&
+ if (cur_pipe->stream->signal == SIGNAL_TYPE_EDP &&
dc->debug.seamless_boot_odm_combine &&
- pipe->stream->apply_seamless_boot_optimization) {
+ cur_pipe->stream->apply_seamless_boot_optimization) {
- if (pipe->stream->apply_boot_odm_mode ==
+ if (cur_pipe->stream->apply_boot_odm_mode ==
dm_odm_combine_policy_2to1) {
context->bw_ctx.dml.vba.ODMCombinePolicy =
dm_odm_combine_policy_2to1;
}
for (i = 0; i < dc->res_pool->pipe_count; i++) {
- struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
+ struct pipe_ctx *cur_pipe = &context->res_ctx.pipe_ctx[i];
- if (!pipe->stream)
+ if (!cur_pipe->stream)
continue;
- if (pipe->stream->signal == SIGNAL_TYPE_EDP &&
+ if (cur_pipe->stream->signal == SIGNAL_TYPE_EDP &&
dc->debug.seamless_boot_odm_combine &&
- pipe->stream->apply_seamless_boot_optimization) {
+ cur_pipe->stream->apply_seamless_boot_optimization) {
- if (pipe->stream->apply_boot_odm_mode ==
+ if (cur_pipe->stream->apply_boot_odm_mode ==
dm_odm_combine_policy_2to1) {
context->bw_ctx.dml.vba.ODMCombinePolicy =
dm_odm_combine_policy_2to1;
if (dc->hwseq->wa_state.disallow_self_refresh_during_multi_plane_transition_applied) {
struct dce_hwseq *hwseq = dc->hwseq;
- struct timing_generator *tg = dc->res_pool->timing_generators[0];
- unsigned int cur_frame = tg->funcs->get_frame_count(tg);
+ struct timing_generator *wa_tg = dc->res_pool->timing_generators[0];
+ unsigned int cur_frame = wa_tg->funcs->get_frame_count(wa_tg);
if (cur_frame != hwseq->wa_state.disallow_self_refresh_during_multi_plane_transition_applied_on_frame) {
struct hubbub *hubbub = dc->res_pool->hubbub;
* This is meant to work around a known HW issue where VREADY will cancel the pending 3DLUT_ENABLE signal regardless
* of whether OTG lock is currently being held or not.
*/
+ if (!pipe_ctx)
+ return;
+
struct pipe_ctx *wa_pipes[MAX_PIPES] = { NULL };
struct pipe_ctx *odm_pipe, *mpc_pipe;
int i, wa_pipe_ct = 0;
static bool build_custom_gamma_mapping_coefficients_worker(
const struct dc_gamma *ramp,
struct pixel_gamma_point *coeff,
- const struct hw_x_point *coordinates_x,
+ const struct hw_x_point *hw_coordinates_x,
const struct gamma_pixel *axis_x,
enum channel_name channel,
uint32_t number_of_points)
struct fixed31_32 right_pos;
if (channel == CHANNEL_NAME_RED)
- coord_x = coordinates_x[i].regamma_y_red;
+ coord_x = hw_coordinates_x[i].regamma_y_red;
else if (channel == CHANNEL_NAME_GREEN)
- coord_x = coordinates_x[i].regamma_y_green;
+ coord_x = hw_coordinates_x[i].regamma_y_green;
else
- coord_x = coordinates_x[i].regamma_y_blue;
+ coord_x = hw_coordinates_x[i].regamma_y_blue;
if (!find_software_points(
ramp, axis_x, coord_x, channel,
}
static inline void copy_rgb_regamma_to_coordinates_x(
- struct hw_x_point *coordinates_x,
+ struct hw_x_point *hw_coordinates_x,
uint32_t hw_points_num,
const struct pwl_float_data_ex *rgb_ex)
{
- struct hw_x_point *coords = coordinates_x;
+ struct hw_x_point *coords = hw_coordinates_x;
uint32_t i = 0;
const struct pwl_float_data_ex *rgb_regamma = rgb_ex;
const struct dc_gamma *ramp,
struct pixel_gamma_point *coeff128,
struct pwl_float_data *rgb_user,
- const struct hw_x_point *coordinates_x,
+ const struct hw_x_point *hw_coordinates_x,
const struct gamma_pixel *axis_x,
uint32_t number_of_points,
struct dc_transfer_func_distributed_points *tf_pts)
for (i = 0; i < 3; i++) {
if (!build_custom_gamma_mapping_coefficients_worker(
- ramp, coeff128, coordinates_x, axis_x, i,
+ ramp, coeff128, hw_coordinates_x, axis_x, i,
number_of_points))
return false;
}
if (input_tf->tf == TRANSFER_FUNCTION_PQ) {
/* just copy current rgb_regamma into tf_pts */
struct pwl_float_data_ex *curvePt = curve;
- int i = 0;
+ int j = 0;
- while (i <= MAX_HW_POINTS) {
- tf_pts->red[i] = curvePt->r;
- tf_pts->green[i] = curvePt->g;
- tf_pts->blue[i] = curvePt->b;
+ while (j <= MAX_HW_POINTS) {
+ tf_pts->red[j] = curvePt->r;
+ tf_pts->green[j] = curvePt->g;
+ tf_pts->blue[j] = curvePt->b;
++curvePt;
- ++i;
+ ++j;
}
} else {
// clamps to 0-1