Commit 6b670fa9 authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher

drm/amd/display: Move TG to stream_res

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipes->tg/pipes->stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/ctx->tg->/ctx->stream_res\.tg->/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe->tg/pipe->stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe_ctx->tg/pipe_ctx->stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx\[pipe_offset\]\.tg/pipe_ctx\[pipe_offset\]\.stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i
's/grouped_pipes\[i\]->tg/grouped_pipes\[i\]->stream_^Cs\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i
's/grouped_pipes\[0\]->tg/grouped_pipes\[0\]->stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i
's/grouped_pipes\[1\]->tg/grouped_pipes\[1\]->stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe_ctx\[i\]->tg/pipe_ctx\[i\]->stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe_ctx_old->tg/pipe_ctx_old->stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe_set\[j\]->tg/pipe_set\[j\]->stream_res\.tg/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe_ctx\[i\]\.tg/pipe_ctx\[i\]\.stream_res\.tg/g'
Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a6a6cb34
...@@ -846,7 +846,7 @@ static void program_timing_sync( ...@@ -846,7 +846,7 @@ static void program_timing_sync(
for (j = 0; j < group_size; j++) { for (j = 0; j < group_size; j++) {
struct pipe_ctx *temp; struct pipe_ctx *temp;
if (!pipe_set[j]->tg->funcs->is_blanked(pipe_set[j]->tg)) { if (!pipe_set[j]->stream_res.tg->funcs->is_blanked(pipe_set[j]->stream_res.tg)) {
if (j == 0) if (j == 0)
break; break;
...@@ -859,7 +859,7 @@ static void program_timing_sync( ...@@ -859,7 +859,7 @@ static void program_timing_sync(
/* remove any other unblanked pipes as they have already been synced */ /* remove any other unblanked pipes as they have already been synced */
for (j = j + 1; j < group_size; j++) { for (j = j + 1; j < group_size; j++) {
if (!pipe_set[j]->tg->funcs->is_blanked(pipe_set[j]->tg)) { if (!pipe_set[j]->stream_res.tg->funcs->is_blanked(pipe_set[j]->stream_res.tg)) {
group_size--; group_size--;
pipe_set[j] = pipe_set[group_size]; pipe_set[j] = pipe_set[group_size];
j--; j--;
......
...@@ -309,7 +309,7 @@ void context_timing_trace( ...@@ -309,7 +309,7 @@ void context_timing_trace(
|| pipe_ctx->pipe_idx == underlay_idx) || pipe_ctx->pipe_idx == underlay_idx)
continue; continue;
pipe_ctx->tg->funcs->get_position(pipe_ctx->tg, &position); pipe_ctx->stream_res.tg->funcs->get_position(pipe_ctx->stream_res.tg, &position);
h_pos[i] = position.horizontal_count; h_pos[i] = position.horizontal_count;
v_pos[i] = position.vertical_count; v_pos[i] = position.vertical_count;
} }
...@@ -320,7 +320,7 @@ void context_timing_trace( ...@@ -320,7 +320,7 @@ void context_timing_trace(
continue; continue;
TIMING_TRACE("OTG_%d H_tot:%d V_tot:%d H_pos:%d V_pos:%d\n", TIMING_TRACE("OTG_%d H_tot:%d V_tot:%d H_pos:%d V_pos:%d\n",
pipe_ctx->tg->inst, pipe_ctx->stream_res.tg->inst,
pipe_ctx->stream->timing.h_total, pipe_ctx->stream->timing.h_total,
pipe_ctx->stream->timing.v_total, pipe_ctx->stream->timing.v_total,
h_pos[i], v_pos[i]); h_pos[i], v_pos[i]);
......
...@@ -1398,7 +1398,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level, ...@@ -1398,7 +1398,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,
*/ */
controller_id = controller_id =
core_dc->current_context-> core_dc->current_context->
res_ctx.pipe_ctx[i].tg->inst + res_ctx.pipe_ctx[i].stream_res.tg->inst +
1; 1;
} }
} }
...@@ -1504,7 +1504,7 @@ bool dc_link_setup_psr(struct dc_link *link, ...@@ -1504,7 +1504,7 @@ bool dc_link_setup_psr(struct dc_link *link,
*/ */
psr_context->controllerId = psr_context->controllerId =
core_dc->current_context->res_ctx. core_dc->current_context->res_ctx.
pipe_ctx[i].tg->inst + 1; pipe_ctx[i].stream_res.tg->inst + 1;
break; break;
} }
} }
...@@ -1879,7 +1879,7 @@ void core_link_enable_stream(struct pipe_ctx *pipe_ctx) ...@@ -1879,7 +1879,7 @@ void core_link_enable_stream(struct pipe_ctx *pipe_ctx)
} }
/* turn off otg test pattern if enable */ /* turn off otg test pattern if enable */
pipe_ctx->tg->funcs->set_test_pattern(pipe_ctx->tg, pipe_ctx->stream_res.tg->funcs->set_test_pattern(pipe_ctx->stream_res.tg,
CONTROLLER_DP_TEST_PATTERN_VIDEOMODE, CONTROLLER_DP_TEST_PATTERN_VIDEOMODE,
COLOR_DEPTH_UNDEFINED); COLOR_DEPTH_UNDEFINED);
......
...@@ -2375,7 +2375,7 @@ static void set_crtc_test_pattern(struct dc_link *link, ...@@ -2375,7 +2375,7 @@ static void set_crtc_test_pattern(struct dc_link *link,
pipe_ctx->stream_res.opp->funcs-> pipe_ctx->stream_res.opp->funcs->
opp_program_bit_depth_reduction(pipe_ctx->stream_res.opp, &params); opp_program_bit_depth_reduction(pipe_ctx->stream_res.opp, &params);
pipe_ctx->tg->funcs->set_test_pattern(pipe_ctx->tg, pipe_ctx->stream_res.tg->funcs->set_test_pattern(pipe_ctx->stream_res.tg,
controller_test_pattern, color_depth); controller_test_pattern, color_depth);
} }
break; break;
...@@ -2388,7 +2388,7 @@ static void set_crtc_test_pattern(struct dc_link *link, ...@@ -2388,7 +2388,7 @@ static void set_crtc_test_pattern(struct dc_link *link,
pipe_ctx->stream_res.opp->funcs-> pipe_ctx->stream_res.opp->funcs->
opp_program_bit_depth_reduction(pipe_ctx->stream_res.opp, &params); opp_program_bit_depth_reduction(pipe_ctx->stream_res.opp, &params);
pipe_ctx->tg->funcs->set_test_pattern(pipe_ctx->tg, pipe_ctx->stream_res.tg->funcs->set_test_pattern(pipe_ctx->stream_res.tg,
CONTROLLER_DP_TEST_PATTERN_VIDEOMODE, CONTROLLER_DP_TEST_PATTERN_VIDEOMODE,
color_depth); color_depth);
} }
......
...@@ -1011,7 +1011,7 @@ static int acquire_first_split_pipe( ...@@ -1011,7 +1011,7 @@ static int acquire_first_split_pipe(
pipe_ctx->bottom_pipe->top_pipe = pipe_ctx->top_pipe; pipe_ctx->bottom_pipe->top_pipe = pipe_ctx->top_pipe;
memset(pipe_ctx, 0, sizeof(*pipe_ctx)); memset(pipe_ctx, 0, sizeof(*pipe_ctx));
pipe_ctx->tg = pool->timing_generators[i]; pipe_ctx->stream_res.tg = pool->timing_generators[i];
pipe_ctx->plane_res.mi = pool->mis[i]; pipe_ctx->plane_res.mi = pool->mis[i];
pipe_ctx->plane_res.ipp = pool->ipps[i]; pipe_ctx->plane_res.ipp = pool->ipps[i];
pipe_ctx->plane_res.xfm = pool->transforms[i]; pipe_ctx->plane_res.xfm = pool->transforms[i];
...@@ -1094,7 +1094,7 @@ bool resource_attach_surfaces_to_context( ...@@ -1094,7 +1094,7 @@ bool resource_attach_surfaces_to_context(
free_pipe->plane_state = plane_state; free_pipe->plane_state = plane_state;
if (tail_pipe) { if (tail_pipe) {
free_pipe->tg = tail_pipe->tg; free_pipe->stream_res.tg = tail_pipe->stream_res.tg;
free_pipe->stream_res.opp = tail_pipe->stream_res.opp; free_pipe->stream_res.opp = tail_pipe->stream_res.opp;
free_pipe->stream_enc = tail_pipe->stream_enc; free_pipe->stream_enc = tail_pipe->stream_enc;
free_pipe->audio = tail_pipe->audio; free_pipe->audio = tail_pipe->audio;
...@@ -1241,7 +1241,7 @@ static int acquire_first_free_pipe( ...@@ -1241,7 +1241,7 @@ static int acquire_first_free_pipe(
if (!res_ctx->pipe_ctx[i].stream) { if (!res_ctx->pipe_ctx[i].stream) {
struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i]; struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
pipe_ctx->tg = pool->timing_generators[i]; pipe_ctx->stream_res.tg = pool->timing_generators[i];
pipe_ctx->plane_res.mi = pool->mis[i]; pipe_ctx->plane_res.mi = pool->mis[i];
pipe_ctx->plane_res.ipp = pool->ipps[i]; pipe_ctx->plane_res.ipp = pool->ipps[i];
pipe_ctx->plane_res.xfm = pool->transforms[i]; pipe_ctx->plane_res.xfm = pool->transforms[i];
...@@ -1532,7 +1532,7 @@ enum dc_status resource_map_pool_resources( ...@@ -1532,7 +1532,7 @@ enum dc_status resource_map_pool_resources(
pipe_ctx->audio); pipe_ctx->audio);
} }
context->stream_status[i].primary_otg_inst = pipe_ctx->tg->inst; context->stream_status[i].primary_otg_inst = pipe_ctx->stream_res.tg->inst;
} }
return DC_OK; return DC_OK;
......
...@@ -253,7 +253,7 @@ uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream) ...@@ -253,7 +253,7 @@ uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream)
&core_dc->current_context->res_ctx; &core_dc->current_context->res_ctx;
for (i = 0; i < MAX_PIPES; i++) { for (i = 0; i < MAX_PIPES; i++) {
struct timing_generator *tg = res_ctx->pipe_ctx[i].tg; struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
if (res_ctx->pipe_ctx[i].stream != stream) if (res_ctx->pipe_ctx[i].stream != stream)
continue; continue;
...@@ -277,7 +277,7 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream, ...@@ -277,7 +277,7 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
&core_dc->current_context->res_ctx; &core_dc->current_context->res_ctx;
for (i = 0; i < MAX_PIPES; i++) { for (i = 0; i < MAX_PIPES; i++) {
struct timing_generator *tg = res_ctx->pipe_ctx[i].tg; struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
if (res_ctx->pipe_ctx[i].stream != stream) if (res_ctx->pipe_ctx[i].stream != stream)
continue; continue;
......
...@@ -53,7 +53,7 @@ void dce_pipe_control_lock(struct core_dc *dc, ...@@ -53,7 +53,7 @@ void dce_pipe_control_lock(struct core_dc *dc,
struct dce_hwseq *hws = dc->hwseq; struct dce_hwseq *hws = dc->hwseq;
/* Not lock pipe when blank */ /* Not lock pipe when blank */
if (lock && pipe->tg->funcs->is_blanked(pipe->tg)) if (lock && pipe->stream_res.tg->funcs->is_blanked(pipe->stream_res.tg))
return; return;
val = REG_GET_4(BLND_V_UPDATE_LOCK[pipe->pipe_idx], val = REG_GET_4(BLND_V_UPDATE_LOCK[pipe->pipe_idx],
......
...@@ -710,7 +710,7 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx) ...@@ -710,7 +710,7 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)
*/ */
uint32_t active_total_with_borders; uint32_t active_total_with_borders;
uint32_t early_control = 0; uint32_t early_control = 0;
struct timing_generator *tg = pipe_ctx->tg; struct timing_generator *tg = pipe_ctx->stream_res.tg;
/* TODOFPGA may change to hwss.update_info_frame */ /* TODOFPGA may change to hwss.update_info_frame */
dce110_update_info_frame(pipe_ctx); dce110_update_info_frame(pipe_ctx);
...@@ -967,9 +967,9 @@ static void program_scaler(const struct core_dc *dc, ...@@ -967,9 +967,9 @@ static void program_scaler(const struct core_dc *dc,
pipe_ctx->plane_res.scl_data.lb_params.depth, pipe_ctx->plane_res.scl_data.lb_params.depth,
&pipe_ctx->stream->bit_depth_params); &pipe_ctx->stream->bit_depth_params);
if (pipe_ctx->tg->funcs->set_overscan_blank_color) if (pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color)
pipe_ctx->tg->funcs->set_overscan_blank_color( pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color(
pipe_ctx->tg, pipe_ctx->stream_res.tg,
&color); &color);
pipe_ctx->plane_res.xfm->funcs->transform_set_scaler(pipe_ctx->plane_res.xfm, pipe_ctx->plane_res.xfm->funcs->transform_set_scaler(pipe_ctx->plane_res.xfm,
...@@ -991,15 +991,15 @@ static enum dc_status dce110_prog_pixclk_crtc_otg( ...@@ -991,15 +991,15 @@ static enum dc_status dce110_prog_pixclk_crtc_otg(
/* program blank color */ /* program blank color */
color_space_to_black_color(dc, color_space_to_black_color(dc,
stream->output_color_space, &black_color); stream->output_color_space, &black_color);
pipe_ctx->tg->funcs->set_blank_color( pipe_ctx->stream_res.tg->funcs->set_blank_color(
pipe_ctx->tg, pipe_ctx->stream_res.tg,
&black_color); &black_color);
/* /*
* Must blank CRTC after disabling power gating and before any * Must blank CRTC after disabling power gating and before any
* programming, otherwise CRTC will be hung in bad state * programming, otherwise CRTC will be hung in bad state
*/ */
pipe_ctx->tg->funcs->set_blank(pipe_ctx->tg, true); pipe_ctx->stream_res.tg->funcs->set_blank(pipe_ctx->stream_res.tg, true);
if (false == pipe_ctx->clock_source->funcs->program_pix_clk( if (false == pipe_ctx->clock_source->funcs->program_pix_clk(
pipe_ctx->clock_source, pipe_ctx->clock_source,
...@@ -1009,19 +1009,19 @@ static enum dc_status dce110_prog_pixclk_crtc_otg( ...@@ -1009,19 +1009,19 @@ static enum dc_status dce110_prog_pixclk_crtc_otg(
return DC_ERROR_UNEXPECTED; return DC_ERROR_UNEXPECTED;
} }
pipe_ctx->tg->funcs->program_timing( pipe_ctx->stream_res.tg->funcs->program_timing(
pipe_ctx->tg, pipe_ctx->stream_res.tg,
&stream->timing, &stream->timing,
true); true);
pipe_ctx->tg->funcs->set_static_screen_control( pipe_ctx->stream_res.tg->funcs->set_static_screen_control(
pipe_ctx->tg, pipe_ctx->stream_res.tg,
0x182); 0x182);
} }
if (!pipe_ctx_old->stream) { if (!pipe_ctx_old->stream) {
if (false == pipe_ctx->tg->funcs->enable_crtc( if (false == pipe_ctx->stream_res.tg->funcs->enable_crtc(
pipe_ctx->tg)) { pipe_ctx->stream_res.tg)) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
return DC_ERROR_UNEXPECTED; return DC_ERROR_UNEXPECTED;
} }
...@@ -1073,7 +1073,7 @@ static enum dc_status apply_single_controller_ctx_to_hw( ...@@ -1073,7 +1073,7 @@ static enum dc_status apply_single_controller_ctx_to_hw(
if (pipe_ctx->stream->signal != SIGNAL_TYPE_VIRTUAL) if (pipe_ctx->stream->signal != SIGNAL_TYPE_VIRTUAL)
pipe_ctx->stream_enc->funcs->setup_stereo_sync( pipe_ctx->stream_enc->funcs->setup_stereo_sync(
pipe_ctx->stream_enc, pipe_ctx->stream_enc,
pipe_ctx->tg->inst, pipe_ctx->stream_res.tg->inst,
stream->timing.timing_3d_format != TIMING_3D_FORMAT_NONE); stream->timing.timing_3d_format != TIMING_3D_FORMAT_NONE);
...@@ -1359,7 +1359,7 @@ static void set_drr(struct pipe_ctx **pipe_ctx, ...@@ -1359,7 +1359,7 @@ static void set_drr(struct pipe_ctx **pipe_ctx,
*/ */
for (i = 0; i < num_pipes; i++) { for (i = 0; i < num_pipes; i++) {
pipe_ctx[i]->tg->funcs->set_drr(pipe_ctx[i]->tg, &params); pipe_ctx[i]->stream_res.tg->funcs->set_drr(pipe_ctx[i]->stream_res.tg, &params);
} }
} }
...@@ -1372,7 +1372,7 @@ static void get_position(struct pipe_ctx **pipe_ctx, ...@@ -1372,7 +1372,7 @@ static void get_position(struct pipe_ctx **pipe_ctx,
/* TODO: handle pipes > 1 /* TODO: handle pipes > 1
*/ */
for (i = 0; i < num_pipes; i++) for (i = 0; i < num_pipes; i++)
pipe_ctx[i]->tg->funcs->get_position(pipe_ctx[i]->tg, position); pipe_ctx[i]->stream_res.tg->funcs->get_position(pipe_ctx[i]->stream_res.tg, position);
} }
static void set_static_screen_control(struct pipe_ctx **pipe_ctx, static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
...@@ -1393,8 +1393,8 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx, ...@@ -1393,8 +1393,8 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
#endif #endif
for (i = 0; i < num_pipes; i++) for (i = 0; i < num_pipes; i++)
pipe_ctx[i]->tg->funcs-> pipe_ctx[i]->stream_res.tg->funcs->
set_static_screen_control(pipe_ctx[i]->tg, value); set_static_screen_control(pipe_ctx[i]->stream_res.tg, value);
} }
/* unit: in_khz before mode set, get pixel clock from context. ASIC register /* unit: in_khz before mode set, get pixel clock from context. ASIC register
...@@ -1646,12 +1646,12 @@ static void dce110_reset_hw_ctx_wrap( ...@@ -1646,12 +1646,12 @@ static void dce110_reset_hw_ctx_wrap(
if (!pipe_ctx->stream || if (!pipe_ctx->stream ||
pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) { pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {
core_link_disable_stream(pipe_ctx_old); core_link_disable_stream(pipe_ctx_old);
pipe_ctx_old->tg->funcs->set_blank(pipe_ctx_old->tg, true); pipe_ctx_old->stream_res.tg->funcs->set_blank(pipe_ctx_old->stream_res.tg, true);
if (!hwss_wait_for_blank_complete(pipe_ctx_old->tg)) { if (!hwss_wait_for_blank_complete(pipe_ctx_old->stream_res.tg)) {
dm_error("DC: failed to blank crtc!\n"); dm_error("DC: failed to blank crtc!\n");
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
} }
pipe_ctx_old->tg->funcs->disable_crtc(pipe_ctx_old->tg); pipe_ctx_old->stream_res.tg->funcs->disable_crtc(pipe_ctx_old->stream_res.tg);
pipe_ctx_old->plane_res.mi->funcs->free_mem_input( pipe_ctx_old->plane_res.mi->funcs->free_mem_input(
pipe_ctx_old->plane_res.mi, dc->current_context->stream_count); pipe_ctx_old->plane_res.mi, dc->current_context->stream_count);
resource_unreference_clock_source( resource_unreference_clock_source(
...@@ -1984,7 +1984,7 @@ static void program_surface_visibility(const struct core_dc *dc, ...@@ -1984,7 +1984,7 @@ static void program_surface_visibility(const struct core_dc *dc,
blank_target = true; blank_target = true;
dce_set_blender_mode(dc->hwseq, pipe_ctx->pipe_idx, blender_mode); dce_set_blender_mode(dc->hwseq, pipe_ctx->pipe_idx, blender_mode);
pipe_ctx->tg->funcs->set_blank(pipe_ctx->tg, blank_target); pipe_ctx->stream_res.tg->funcs->set_blank(pipe_ctx->stream_res.tg, blank_target);
} }
...@@ -2152,9 +2152,9 @@ void dce110_update_pending_status(struct pipe_ctx *pipe_ctx) ...@@ -2152,9 +2152,9 @@ void dce110_update_pending_status(struct pipe_ctx *pipe_ctx)
plane_state->status.current_address = pipe_ctx->plane_res.mi->current_address; 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 && if (pipe_ctx->plane_res.mi->current_address.type == PLN_ADDR_TYPE_GRPH_STEREO &&
pipe_ctx->tg->funcs->is_stereo_left_eye) { pipe_ctx->stream_res.tg->funcs->is_stereo_left_eye) {
plane_state->status.is_right_eye =\ plane_state->status.is_right_eye =\
!pipe_ctx->tg->funcs->is_stereo_left_eye(pipe_ctx->tg); !pipe_ctx->stream_res.tg->funcs->is_stereo_left_eye(pipe_ctx->stream_res.tg);
} }
} }
...@@ -2218,28 +2218,28 @@ static void dce110_enable_timing_synchronization( ...@@ -2218,28 +2218,28 @@ static void dce110_enable_timing_synchronization(
* Since HW doesn't care which one, we always assign * Since HW doesn't care which one, we always assign
* the 1st one in the group. */ * the 1st one in the group. */
gsl_params.gsl_group = 0; gsl_params.gsl_group = 0;
gsl_params.gsl_master = grouped_pipes[0]->tg->inst; gsl_params.gsl_master = grouped_pipes[0]->stream_res.tg->inst;
for (i = 0; i < group_size; i++) for (i = 0; i < group_size; i++)
grouped_pipes[i]->tg->funcs->setup_global_swap_lock( grouped_pipes[i]->stream_res.tg->funcs->setup_global_swap_lock(
grouped_pipes[i]->tg, &gsl_params); grouped_pipes[i]->stream_res.tg, &gsl_params);
/* Reset slave controllers on master VSync */ /* Reset slave controllers on master VSync */
DC_SYNC_INFO("GSL: enabling trigger-reset\n"); DC_SYNC_INFO("GSL: enabling trigger-reset\n");
for (i = 1 /* skip the master */; i < group_size; i++) for (i = 1 /* skip the master */; i < group_size; i++)
grouped_pipes[i]->tg->funcs->enable_reset_trigger( grouped_pipes[i]->stream_res.tg->funcs->enable_reset_trigger(
grouped_pipes[i]->tg, gsl_params.gsl_group); grouped_pipes[i]->stream_res.tg, gsl_params.gsl_group);
for (i = 1 /* skip the master */; i < group_size; i++) { for (i = 1 /* skip the master */; i < group_size; i++) {
DC_SYNC_INFO("GSL: waiting for reset to occur.\n"); DC_SYNC_INFO("GSL: waiting for reset to occur.\n");
wait_for_reset_trigger_to_occur(dc_ctx, grouped_pipes[i]->tg); wait_for_reset_trigger_to_occur(dc_ctx, grouped_pipes[i]->stream_res.tg);
/* Regardless of success of the wait above, remove the reset or /* Regardless of success of the wait above, remove the reset or
* the driver will start timing out on Display requests. */ * the driver will start timing out on Display requests. */
DC_SYNC_INFO("GSL: disabling trigger-reset.\n"); DC_SYNC_INFO("GSL: disabling trigger-reset.\n");
grouped_pipes[i]->tg->funcs->disable_reset_trigger(grouped_pipes[i]->tg); grouped_pipes[i]->stream_res.tg->funcs->disable_reset_trigger(grouped_pipes[i]->stream_res.tg);
} }
...@@ -2247,7 +2247,7 @@ static void dce110_enable_timing_synchronization( ...@@ -2247,7 +2247,7 @@ static void dce110_enable_timing_synchronization(
* is that the sync'ed displays will not drift out of sync over time*/ * is that the sync'ed displays will not drift out of sync over time*/
DC_SYNC_INFO("GSL: Restoring register states.\n"); DC_SYNC_INFO("GSL: Restoring register states.\n");
for (i = 0; i < group_size; i++) for (i = 0; i < group_size; i++)
grouped_pipes[i]->tg->funcs->tear_down_global_swap_lock(grouped_pipes[i]->tg); grouped_pipes[i]->stream_res.tg->funcs->tear_down_global_swap_lock(grouped_pipes[i]->stream_res.tg);
DC_SYNC_INFO("GSL: Set-up complete.\n"); DC_SYNC_INFO("GSL: Set-up complete.\n");
} }
......
...@@ -1016,7 +1016,7 @@ static struct pipe_ctx *dce110_acquire_underlay( ...@@ -1016,7 +1016,7 @@ static struct pipe_ctx *dce110_acquire_underlay(
if (res_ctx->pipe_ctx[underlay_idx].stream) if (res_ctx->pipe_ctx[underlay_idx].stream)
return NULL; return NULL;
pipe_ctx->tg = pool->timing_generators[underlay_idx]; pipe_ctx->stream_res.tg = pool->timing_generators[underlay_idx];
pipe_ctx->plane_res.mi = pool->mis[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.ipp = res_ctx->pool->ipps[underlay_idx];*/
pipe_ctx->plane_res.xfm = pool->transforms[underlay_idx]; pipe_ctx->plane_res.xfm = pool->transforms[underlay_idx];
...@@ -1040,12 +1040,12 @@ static struct pipe_ctx *dce110_acquire_underlay( ...@@ -1040,12 +1040,12 @@ static struct pipe_ctx *dce110_acquire_underlay(
* need to be enabled * need to be enabled
*/ */
pipe_ctx->tg->funcs->program_timing(pipe_ctx->tg, pipe_ctx->stream_res.tg->funcs->program_timing(pipe_ctx->stream_res.tg,
&stream->timing, &stream->timing,
false); false);
pipe_ctx->tg->funcs->enable_advanced_request( pipe_ctx->stream_res.tg->funcs->enable_advanced_request(
pipe_ctx->tg, pipe_ctx->stream_res.tg,
true, true,
&stream->timing); &stream->timing);
...@@ -1057,8 +1057,8 @@ static struct pipe_ctx *dce110_acquire_underlay( ...@@ -1057,8 +1057,8 @@ static struct pipe_ctx *dce110_acquire_underlay(
color_space_to_black_color(dc, color_space_to_black_color(dc,
COLOR_SPACE_YCBCR601, &black_color); COLOR_SPACE_YCBCR601, &black_color);
pipe_ctx->tg->funcs->set_blank_color( pipe_ctx->stream_res.tg->funcs->set_blank_color(
pipe_ctx->tg, pipe_ctx->stream_res.tg,
&black_color); &black_color);
} }
......
...@@ -960,7 +960,7 @@ static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer( ...@@ -960,7 +960,7 @@ static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer(
return false; return false;
idle_pipe->stream = head_pipe->stream; idle_pipe->stream = head_pipe->stream;
idle_pipe->tg = head_pipe->tg; idle_pipe->stream_res.tg = head_pipe->stream_res.tg;
idle_pipe->stream_res.opp = head_pipe->stream_res.opp; idle_pipe->stream_res.opp = head_pipe->stream_res.opp;
idle_pipe->plane_res.mi = pool->mis[idle_pipe->pipe_idx]; idle_pipe->plane_res.mi = pool->mis[idle_pipe->pipe_idx];
......
...@@ -154,6 +154,7 @@ struct resource_pool { ...@@ -154,6 +154,7 @@ struct resource_pool {
struct stream_resource { struct stream_resource {
struct output_pixel_processor *opp; struct output_pixel_processor *opp;
struct timing_generator *tg;
}; };
struct plane_resource { struct plane_resource {
...@@ -171,8 +172,6 @@ struct pipe_ctx { ...@@ -171,8 +172,6 @@ struct pipe_ctx {
struct plane_resource plane_res; struct plane_resource plane_res;
struct stream_resource stream_res; struct stream_resource stream_res;
struct timing_generator *tg;
struct stream_encoder *stream_enc; struct stream_encoder *stream_enc;
struct display_clock *dis_clk; struct display_clock *dis_clk;
struct clock_source *clock_source; struct clock_source *clock_source;
......
...@@ -214,7 +214,7 @@ bool dce110_vblank_set( ...@@ -214,7 +214,7 @@ bool dce110_vblank_set(
uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK; uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
struct timing_generator *tg = struct timing_generator *tg =
core_dc->current_context->res_ctx.pipe_ctx[pipe_offset].tg; core_dc->current_context->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
if (enable) { if (enable) {
if (!tg->funcs->arm_vert_intr(tg, 2)) { if (!tg->funcs->arm_vert_intr(tg, 2)) {
......
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