int dml21_helper_find_dml_pipe_idx_by_stream_id(struct dml2_context *ctx, unsignedint stream_id)
{ int i; for (i = 0; i < __DML2_WRAPPER_MAX_STREAMS_PLANES__; i++) { if (ctx->v21.dml_to_dc_pipe_mapping.dml_pipe_idx_to_stream_id_valid[i] && ctx->v21.dml_to_dc_pipe_mapping.dml_pipe_idx_to_stream_id[i] == stream_id) return i;
}
return -1;
}
int dml21_find_dml_pipe_idx_by_plane_id(struct dml2_context *ctx, unsignedint plane_id)
{ int i; for (i = 0; i < __DML2_WRAPPER_MAX_STREAMS_PLANES__; i++) { if (ctx->v21.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_id_valid[i] && ctx->v21.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_id[i] == plane_id) return i;
}
return -1;
}
bool dml21_get_plane_id(conststruct dc_state *state, conststruct dc_plane_state *plane, unsignedint *plane_id)
{ int i, j;
if (!plane_id) returnfalse;
for (i = 0; i < state->stream_count; i++) { for (j = 0; j < state->stream_status[i].plane_count; j++) { if (state->stream_status[i].plane_states[j] == plane) {
*plane_id = (i << 16) | j; returntrue;
}
}
}
/* find main plane based on id */
dc_plane_index = dml21_get_dc_plane_idx_from_plane_id(dml_ctx->v21.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_id[dml_plane_idx]);
dc_main_plane = dc_main_stream_status->plane_states[dc_plane_index];
if (dc_main_plane) {
num_pipes = dml_ctx->config.callbacks.get_dpp_pipes_for_plane(dc_main_plane, &context->res_ctx, dc_main_pipes);
} else { /* stream was configured with dummy plane, so get pipes from opp head */ struct pipe_ctx *otg_master_pipe = dml_ctx->config.callbacks.get_otg_master_for_stream(&context->res_ctx, dc_main_stream); if (otg_master_pipe != NULL)
num_pipes = dml_ctx->config.callbacks.get_opp_heads_for_otg_master(otg_master_pipe, &context->res_ctx, dc_main_pipes);
}
if (dc_phantom_stream_status) { /* phantom plane will have same index as main */
dc_phantom_plane = dc_phantom_stream_status->plane_states[dc_plane_index];
if (dc_phantom_plane) { /* only care about phantom pipes if they contain the phantom plane */
dml_ctx->config.callbacks.get_dpp_pipes_for_plane(dc_phantom_plane, &context->res_ctx, dc_phantom_pipes);
}
}
}
if (dml_ctx->config.svp_pstate.callbacks.get_pipe_subvp_type(context, pipe_ctx) == SUBVP_PHANTOM) { /* phantom has its own global sync */
global_sync = &stream_programming->phantom_stream.global_sync;
}
/* Reuse MALL Allocation Sizes logic from dcn32_fpu.c */ /* Count from active, top pipes per plane only. Only add mall_ss_size_bytes for each unique plane. */ if (dc_pipe->stream && dc_pipe->plane_state &&
(dc_pipe->top_pipe == NULL ||
dc_pipe->plane_state != dc_pipe->top_pipe->plane_state) &&
dc_pipe->prev_odm_pipe == NULL) { /* SS: all active surfaces stored in MALL */ if (in_ctx->config.svp_pstate.callbacks.get_pipe_subvp_type(context, dc_pipe) != SUBVP_PHANTOM) {
dc_pipe->surface_size_in_mall_bytes = pln_prog->surface_size_mall_bytes;
context->bw_ctx.bw.dcn.mall_ss_size_bytes += dc_pipe->surface_size_in_mall_bytes;
} else { /* SUBVP: phantom surfaces only stored in MALL */
dc_pipe->surface_size_in_mall_bytes = pln_prog->svp_size_mall_bytes;
context->bw_ctx.bw.dcn.mall_subvp_size_bytes += dc_pipe->surface_size_in_mall_bytes;
}
}
}
bool check_dp2p0_output_encoder(conststruct pipe_ctx *pipe_ctx)
{ /* If this assert is hit then we have a link encoder dynamic management issue */
ASSERT(pipe_ctx->stream_res.hpo_dp_stream_enc ? pipe_ctx->link_res.hpo_dp_link_enc != NULL : true); return (pipe_ctx->stream_res.hpo_dp_stream_enc &&
pipe_ctx->link_res.hpo_dp_link_enc &&
dc_is_dp_signal(pipe_ctx->stream->signal));
}
staticbool is_sub_vp_enabled(struct dc *dc, struct dc_state *context)
{ int i;
for (i = 0; i < dc->res_pool->pipe_count; i++) { struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (dml_ctx->v21.mode_programming.programming->fams2_required) { for (i = 0; i < context->stream_count; i++) { int dml_stream_idx; struct dc_stream_state *phantom_stream; struct dc_stream_status *phantom_status; enum fams2_stream_type type = 0;
union dmub_cmd_fams2_config *static_base_state = &context->bw_ctx.bw.dcn.fams2_stream_base_params[num_fams2_streams]; union dmub_cmd_fams2_config *static_sub_state = &context->bw_ctx.bw.dcn.fams2_stream_sub_params[num_fams2_streams];
switch (dc->debug.fams_version.minor) { case 1: default:
type = static_base_state->stream_v1.base.type;
/* get information from context */
static_base_state->stream_v1.base.num_planes = context->stream_status[i].plane_count;
static_base_state->stream_v1.base.otg_inst = context->stream_status[i].primary_otg_inst;
/* populate pipe masks for planes */ for (j = 0; j < context->stream_status[i].plane_count; j++) { for (k = 0; k < dc->res_pool->pipe_count; k++) { if (context->res_ctx.pipe_ctx[k].stream &&
context->res_ctx.pipe_ctx[k].stream->stream_id == stream->stream_id &&
context->res_ctx.pipe_ctx[k].plane_state == context->stream_status[i].plane_states[j]) {
static_base_state->stream_v1.base.pipe_mask |= (1 << k);
static_base_state->stream_v1.base.plane_pipe_masks[j] |= (1 << k);
}
}
}
}
/* get per method programming */ switch (type) { case FAMS2_STREAM_TYPE_VBLANK: case FAMS2_STREAM_TYPE_VACTIVE: case FAMS2_STREAM_TYPE_DRR: break; case FAMS2_STREAM_TYPE_SUBVP:
phantom_stream = dml_ctx->config.svp_pstate.callbacks.get_paired_subvp_stream(context, stream); if (!phantom_stream) break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.