*secondary_pipe = *primary_pipe;
secondary_pipe->pipe_idx = pipe_idx;
- secondary_pipe->mi = pool->mis[secondary_pipe->pipe_idx];
- secondary_pipe->ipp = pool->ipps[secondary_pipe->pipe_idx];
- secondary_pipe->xfm = pool->transforms[secondary_pipe->pipe_idx];
+ secondary_pipe->plane_res.mi = pool->mis[secondary_pipe->pipe_idx];
+ secondary_pipe->plane_res.ipp = pool->ipps[secondary_pipe->pipe_idx];
+ secondary_pipe->plane_res.xfm = pool->transforms[secondary_pipe->pipe_idx];
if (primary_pipe->bottom_pipe) {
secondary_pipe->bottom_pipe = primary_pipe->bottom_pipe;
secondary_pipe->bottom_pipe->top_pipe = secondary_pipe;
pipe_ctx->plane_res.scl_data.v_active = timing->v_addressable;
/* Taps calculations */
- res = pipe_ctx->xfm->funcs->transform_get_optimal_number_of_taps(
- pipe_ctx->xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
+ res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps(
+ pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
if (!res) {
/* Try 24 bpp linebuffer */
pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_24BPP;
- res = pipe_ctx->xfm->funcs->transform_get_optimal_number_of_taps(
- pipe_ctx->xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
+ res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps(
+ pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
}
if (res)
memset(pipe_ctx, 0, sizeof(*pipe_ctx));
pipe_ctx->tg = pool->timing_generators[i];
- pipe_ctx->mi = pool->mis[i];
- pipe_ctx->ipp = pool->ipps[i];
- pipe_ctx->xfm = pool->transforms[i];
+ pipe_ctx->plane_res.mi = pool->mis[i];
+ pipe_ctx->plane_res.ipp = pool->ipps[i];
+ pipe_ctx->plane_res.xfm = pool->transforms[i];
pipe_ctx->opp = pool->opps[i];
pipe_ctx->dis_clk = pool->display_clock;
pipe_ctx->pipe_idx = i;
struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
pipe_ctx->tg = pool->timing_generators[i];
- pipe_ctx->mi = pool->mis[i];
- pipe_ctx->ipp = pool->ipps[i];
- pipe_ctx->xfm = pool->transforms[i];
+ pipe_ctx->plane_res.mi = pool->mis[i];
+ pipe_ctx->plane_res.ipp = pool->ipps[i];
+ pipe_ctx->plane_res.xfm = pool->transforms[i];
pipe_ctx->opp = pool->opps[i];
pipe_ctx->dis_clk = pool->display_clock;
pipe_ctx->pipe_idx = i;
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
- if (pipe_ctx->stream != stream || !pipe_ctx->ipp)
+ if (pipe_ctx->stream != stream || !pipe_ctx->plane_res.ipp)
continue;
if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state)
continue;
- pipe_ctx->ipp->funcs->ipp_cursor_set_attributes(
- pipe_ctx->ipp, attributes);
+ pipe_ctx->plane_res.ipp->funcs->ipp_cursor_set_attributes(
+ pipe_ctx->plane_res.ipp, attributes);
}
return true;
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
- struct input_pixel_processor *ipp = pipe_ctx->ipp;
+ struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp;
struct dc_cursor_position pos_cpy = *position;
struct dc_cursor_mi_param param = {
.pixel_clk_khz = stream->timing.pix_clk_khz,
};
if (pipe_ctx->stream != stream ||
- !pipe_ctx->ipp || !pipe_ctx->plane_state)
+ !pipe_ctx->plane_res.ipp || !pipe_ctx->plane_state)
continue;
if (pipe_ctx->plane_state->address.type
struct pipe_ctx *pipe_ctx,
const struct dc_plane_state *plane_state)
{
- struct input_pixel_processor *ipp = pipe_ctx->ipp;
+ struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp;
const struct dc_transfer_func *tf = NULL;
struct ipp_prescale_params prescale_params = { 0 };
bool result = true;
struct pipe_ctx *pipe_ctx,
const struct dc_stream_state *stream)
{
- struct transform *xfm = pipe_ctx->xfm;
+ struct transform *xfm = pipe_ctx->plane_res.xfm;
xfm->funcs->opp_power_on_regamma_lut(xfm, true);
xfm->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM;
#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
/* TOFPGA */
- if (pipe_ctx->xfm->funcs->transform_set_pixel_storage_depth == NULL)
+ if (pipe_ctx->plane_res.xfm->funcs->transform_set_pixel_storage_depth == NULL)
return;
#endif
pipe_ctx->stream->output_color_space,
&color);
- pipe_ctx->xfm->funcs->transform_set_pixel_storage_depth(
- pipe_ctx->xfm,
+ pipe_ctx->plane_res.xfm->funcs->transform_set_pixel_storage_depth(
+ pipe_ctx->plane_res.xfm,
pipe_ctx->plane_res.scl_data.lb_params.depth,
&pipe_ctx->stream->bit_depth_params);
pipe_ctx->tg,
&color);
- pipe_ctx->xfm->funcs->transform_set_scaler(pipe_ctx->xfm,
+ pipe_ctx->plane_res.xfm->funcs->transform_set_scaler(pipe_ctx->plane_res.xfm,
&pipe_ctx->plane_res.scl_data);
}
/* mst support - use total stream count */
#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
- if (pipe_ctx->mi->funcs->allocate_mem_input != NULL)
+ if (pipe_ctx->plane_res.mi->funcs->allocate_mem_input != NULL)
#endif
- pipe_ctx->mi->funcs->allocate_mem_input(
- pipe_ctx->mi,
+ pipe_ctx->plane_res.mi->funcs->allocate_mem_input(
+ pipe_ctx->plane_res.mi,
stream->timing.h_total,
stream->timing.v_total,
stream->timing.pix_clk_khz,
total_dest_line_time_ns = compute_pstate_blackout_duration(
dc->bw_vbios.blackout_duration, pipe_ctx->stream);
- pipe_ctx->mi->funcs->mem_input_program_display_marks(
- pipe_ctx->mi,
+ pipe_ctx->plane_res.mi->funcs->mem_input_program_display_marks(
+ pipe_ctx->plane_res.mi,
context->bw.dce.nbp_state_change_wm_ns[num_pipes],
context->bw.dce.stutter_exit_wm_ns[num_pipes],
context->bw.dce.urgent_wm_ns[num_pipes],
total_dest_line_time_ns);
if (i == underlay_idx) {
num_pipes++;
- pipe_ctx->mi->funcs->mem_input_program_chroma_display_marks(
- pipe_ctx->mi,
+ pipe_ctx->plane_res.mi->funcs->mem_input_program_chroma_display_marks(
+ pipe_ctx->plane_res.mi,
context->bw.dce.nbp_state_change_wm_ns[num_pipes],
context->bw.dce.stutter_exit_wm_ns[num_pipes],
context->bw.dce.urgent_wm_ns[num_pipes],
if (res_ctx->pipe_ctx[i].stream == NULL)
continue;
- res_ctx->pipe_ctx[i].mi->funcs->mem_input_program_display_marks(
- res_ctx->pipe_ctx[i].mi,
+ res_ctx->pipe_ctx[i].plane_res.mi->funcs->mem_input_program_display_marks(
+ res_ctx->pipe_ctx[i].plane_res.mi,
nbp_marks,
max_marks,
max_marks,
MAX_WATERMARK);
if (i == underlay_idx)
- res_ctx->pipe_ctx[i].mi->funcs->mem_input_program_chroma_display_marks(
- res_ctx->pipe_ctx[i].mi,
+ res_ctx->pipe_ctx[i].plane_res.mi->funcs->mem_input_program_chroma_display_marks(
+ res_ctx->pipe_ctx[i].plane_res.mi,
nbp_marks,
max_marks,
max_marks,
BREAK_TO_DEBUGGER();
}
pipe_ctx_old->tg->funcs->disable_crtc(pipe_ctx_old->tg);
- pipe_ctx_old->mi->funcs->free_mem_input(
- pipe_ctx_old->mi, dc->current_context->stream_count);
+ pipe_ctx_old->plane_res.mi->funcs->free_mem_input(
+ pipe_ctx_old->plane_res.mi, dc->current_context->stream_count);
resource_unreference_clock_source(
&dc->current_context->res_ctx, dc->res_pool,
&pipe_ctx_old->clock_source);
/* Lb color depth */
default_adjust.lb_color_depth = pipe_ctx->plane_res.scl_data.lb_params.depth;
- pipe_ctx->xfm->funcs->opp_set_csc_default(
- pipe_ctx->xfm, &default_adjust);
+ pipe_ctx->plane_res.xfm->funcs->opp_set_csc_default(
+ pipe_ctx->plane_res.xfm, &default_adjust);
}
gamut_remap_matrix.matrix[10];
}
- pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust);
+ pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust);
}
/**
struct pipe_ctx *pipe_ctx,
struct resource_context *res_ctx)
{
- struct mem_input *mi = pipe_ctx->mi;
+ struct mem_input *mi = pipe_ctx->plane_res.mi;
struct dc_plane_state *plane_state = pipe_ctx->plane_state;
struct xfm_grph_csc_adjustment adjust;
struct out_csc_color_matrix tbl_entry;
tbl_entry.regval[i] =
pipe_ctx->stream->csc_color_matrix.matrix[i];
- pipe_ctx->xfm->funcs->opp_set_csc_adjustment
- (pipe_ctx->xfm, &tbl_entry);
+ pipe_ctx->plane_res.xfm->funcs->opp_set_csc_adjustment
+ (pipe_ctx->plane_res.xfm, &tbl_entry);
}
if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) {
gamut_remap_matrix.matrix[10];
}
- pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust);
+ pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust);
pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
program_scaler(dc, pipe_ctx);
if (dc->public.config.gpu_vm_support)
mi->funcs->mem_input_program_pte_vm(
- pipe_ctx->mi,
+ pipe_ctx->plane_res.mi,
plane_state->format,
&plane_state->tiling_info,
plane_state->rotation);
if (plane_state == NULL)
return;
- pipe_ctx->mi->funcs->mem_input_program_surface_flip_and_addr(
- pipe_ctx->mi,
+ pipe_ctx->plane_res.mi->funcs->mem_input_program_surface_flip_and_addr(
+ pipe_ctx->plane_res.mi,
&plane_state->address,
plane_state->flip_immediate);
return;
plane_state->status.is_flip_pending =
- pipe_ctx->mi->funcs->mem_input_is_flip_pending(
- pipe_ctx->mi);
+ pipe_ctx->plane_res.mi->funcs->mem_input_is_flip_pending(
+ pipe_ctx->plane_res.mi);
if (plane_state->status.is_flip_pending && !plane_state->visible)
- pipe_ctx->mi->current_address = pipe_ctx->mi->request_address;
+ pipe_ctx->plane_res.mi->current_address = pipe_ctx->plane_res.mi->request_address;
- plane_state->status.current_address = pipe_ctx->mi->current_address;
- if (pipe_ctx->mi->current_address.type == PLN_ADDR_TYPE_GRPH_STEREO &&
+ plane_state->status.current_address = pipe_ctx->plane_res.mi->current_address;
+ if (pipe_ctx->plane_res.mi->current_address.type == PLN_ADDR_TYPE_GRPH_STEREO &&
pipe_ctx->tg->funcs->is_stereo_left_eye) {
plane_state->status.is_right_eye =\
!pipe_ctx->tg->funcs->is_stereo_left_eye(pipe_ctx->tg);
static void dce110_program_front_end_for_pipe(
struct core_dc *dc, struct pipe_ctx *pipe_ctx)
{
- struct mem_input *mi = pipe_ctx->mi;
+ struct mem_input *mi = pipe_ctx->plane_res.mi;
struct pipe_ctx *old_pipe = NULL;
struct dc_plane_state *plane_state = pipe_ctx->plane_state;
struct xfm_grph_csc_adjustment adjust;
tbl_entry.regval[i] =
pipe_ctx->stream->csc_color_matrix.matrix[i];
- pipe_ctx->xfm->funcs->opp_set_csc_adjustment
- (pipe_ctx->xfm, &tbl_entry);
+ pipe_ctx->plane_res.xfm->funcs->opp_set_csc_adjustment
+ (pipe_ctx->plane_res.xfm, &tbl_entry);
}
if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) {
gamut_remap_matrix.matrix[10];
}
- pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust);
+ pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust);
pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
if (dc->public.config.gpu_vm_support)
mi->funcs->mem_input_program_pte_vm(
- pipe_ctx->mi,
+ pipe_ctx->plane_res.mi,
plane_state->format,
&plane_state->tiling_info,
plane_state->rotation);
tbl_entry.color_space = color_space;
//tbl_entry.regval = matrix;
- pipe_ctx->xfm->funcs->opp_set_csc_adjustment(pipe_ctx->xfm, &tbl_entry);
+ pipe_ctx->plane_res.xfm->funcs->opp_set_csc_adjustment(pipe_ctx->plane_res.xfm, &tbl_entry);
}
}
return NULL;
pipe_ctx->tg = pool->timing_generators[underlay_idx];
- pipe_ctx->mi = pool->mis[underlay_idx];
- /*pipe_ctx->ipp = res_ctx->pool->ipps[underlay_idx];*/
- pipe_ctx->xfm = pool->transforms[underlay_idx];
+ pipe_ctx->plane_res.mi = pool->mis[underlay_idx];
+ /*pipe_ctx->plane_res.ipp = res_ctx->pool->ipps[underlay_idx];*/
+ pipe_ctx->plane_res.xfm = pool->transforms[underlay_idx];
pipe_ctx->opp = pool->opps[underlay_idx];
pipe_ctx->dis_clk = pool->display_clock;
pipe_ctx->pipe_idx = underlay_idx;
true,
&stream->timing);
- pipe_ctx->mi->funcs->allocate_mem_input(pipe_ctx->mi,
+ pipe_ctx->plane_res.mi->funcs->allocate_mem_input(pipe_ctx->plane_res.mi,
stream->timing.h_total,
stream->timing.v_total,
stream->timing.pix_clk_khz,
if (plane_state == NULL)
return;
addr_patched = patch_address_for_sbs_tb_stereo(pipe_ctx, &addr);
- pipe_ctx->mi->funcs->mem_input_program_surface_flip_and_addr(
- pipe_ctx->mi,
+ pipe_ctx->plane_res.mi->funcs->mem_input_program_surface_flip_and_addr(
+ pipe_ctx->plane_res.mi,
&plane_state->address,
plane_state->flip_immediate);
plane_state->status.requested_address = plane_state->address;
static bool dcn10_set_input_transfer_func(
struct pipe_ctx *pipe_ctx, const struct dc_plane_state *plane_state)
{
- struct input_pixel_processor *ipp = pipe_ctx->ipp;
+ struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp;
const struct dc_transfer_func *tf = NULL;
bool result = true;
struct pipe_ctx *pipe_ctx,
const struct dc_stream_state *stream)
{
- struct transform *xfm = pipe_ctx->xfm;
+ struct transform *xfm = pipe_ctx->plane_res.xfm;
if (xfm == NULL)
return false;
gamut_remap_matrix.matrix[10];
}
- pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust);
+ pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust);
}
tbl_entry.color_space = color_space;
//tbl_entry.regval = matrix;
- pipe_ctx->xfm->funcs->opp_set_csc_adjustment(pipe_ctx->xfm, &tbl_entry);
+ pipe_ctx->plane_res.xfm->funcs->opp_set_csc_adjustment(pipe_ctx->plane_res.xfm, &tbl_entry);
}
}
static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx)
struct validate_context *context)
{
struct dce_hwseq *hws = dc->hwseq;
- struct mem_input *mi = pipe_ctx->mi;
- struct input_pixel_processor *ipp = pipe_ctx->ipp;
+ struct mem_input *mi = pipe_ctx->plane_res.mi;
+ struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp;
struct dc_plane_state *plane_state = pipe_ctx->plane_state;
union plane_size size = plane_state->plane_size;
struct default_adjustment ocsc = {0};
if (dc->public.config.gpu_vm_support)
mi->funcs->mem_input_program_pte_vm(
- pipe_ctx->mi,
+ pipe_ctx->plane_res.mi,
plane_state->format,
&plane_state->tiling_info,
plane_state->rotation);
pipe_ctx->plane_res.scl_data.lb_params.alpha_en = per_pixel_alpha;
pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;
/* scaler configuration */
- pipe_ctx->xfm->funcs->transform_set_scaler(
- pipe_ctx->xfm, &pipe_ctx->plane_res.scl_data);
+ pipe_ctx->plane_res.xfm->funcs->transform_set_scaler(
+ pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data);
mi->funcs->mem_program_viewport(mi,
&pipe_ctx->plane_res.scl_data.viewport, &pipe_ctx->plane_res.scl_data.viewport_c);
/*TODO add adjustments parameters*/
ocsc.out_color_space = pipe_ctx->stream->output_color_space;
- pipe_ctx->xfm->funcs->opp_set_csc_default(pipe_ctx->xfm, &ocsc);
+ pipe_ctx->plane_res.xfm->funcs->opp_set_csc_default(pipe_ctx->plane_res.xfm, &ocsc);
mi->funcs->mem_input_program_surface_config(
mi,
*/
if (pipe_ctx->plane_state && !old_pipe_ctx->plane_state) {
- if (pipe_ctx->mi->opp_id != 0xf && pipe_ctx->tg->inst == be_idx) {
+ if (pipe_ctx->plane_res.mi->opp_id != 0xf && pipe_ctx->tg->inst == be_idx) {
dcn10_power_down_fe(dc, pipe_ctx->pipe_idx);
/*
* power down fe will unlock when calling reset, need
dc->res_pool->mpc,
old_pipe_ctx->opp,
old_pipe_ctx->pipe_idx);
- old_pipe_ctx->opp->mpcc_disconnect_pending[old_pipe_ctx->mi->mpcc_id] = true;
+ old_pipe_ctx->opp->mpcc_disconnect_pending[old_pipe_ctx->plane_res.mi->mpcc_id] = true;
/*dm_logger_write(dc->ctx->logger, LOG_ERROR,
"[debug_mpo: apply_ctx disconnect pending on mpcc %d]\n",
return;
plane_state->status.is_flip_pending =
- pipe_ctx->mi->funcs->mem_input_is_flip_pending(
- pipe_ctx->mi);
+ pipe_ctx->plane_res.mi->funcs->mem_input_is_flip_pending(
+ pipe_ctx->plane_res.mi);
/* DCN we read INUSE address in MI, do we still need this wa? */
if (plane_state->status.is_flip_pending &&
!plane_state->visible) {
- pipe_ctx->mi->current_address =
- pipe_ctx->mi->request_address;
+ pipe_ctx->plane_res.mi->current_address =
+ pipe_ctx->plane_res.mi->request_address;
BREAK_TO_DEBUGGER();
}
- plane_state->status.current_address = pipe_ctx->mi->current_address;
- if (pipe_ctx->mi->current_address.type == PLN_ADDR_TYPE_GRPH_STEREO &&
+ plane_state->status.current_address = pipe_ctx->plane_res.mi->current_address;
+ if (pipe_ctx->plane_res.mi->current_address.type == PLN_ADDR_TYPE_GRPH_STEREO &&
tg->funcs->is_stereo_left_eye) {
plane_state->status.is_right_eye =
!tg->funcs->is_stereo_left_eye(pipe_ctx->tg);
idle_pipe->tg = head_pipe->tg;
idle_pipe->opp = head_pipe->opp;
- idle_pipe->mi = pool->mis[idle_pipe->pipe_idx];
- idle_pipe->ipp = pool->ipps[idle_pipe->pipe_idx];
- idle_pipe->xfm = pool->transforms[idle_pipe->pipe_idx];
+ idle_pipe->plane_res.mi = pool->mis[idle_pipe->pipe_idx];
+ idle_pipe->plane_res.ipp = pool->ipps[idle_pipe->pipe_idx];
+ idle_pipe->plane_res.xfm = pool->transforms[idle_pipe->pipe_idx];
return idle_pipe;
}
struct plane_resource {
struct scaler_data scl_data;
+
+ struct mem_input *mi;
+ struct input_pixel_processor *ipp;
+ struct transform *xfm;
};
struct pipe_ctx {
struct plane_resource plane_res;
struct stream_resource stream_res;
- struct mem_input *mi;
- struct input_pixel_processor *ipp;
- struct transform *xfm;
struct output_pixel_processor *opp;
struct timing_generator *tg;