Commit 8e9c4c8c authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher
Browse files

drm/amd/display: Move stream_enc 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->stream_enc/pipes->stream_res\.stream_enc/g'

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

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe->stream_enc/pipe->stream_res\.stream_enc/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->stream_enc/pipe_ctx->stream_res\.stream_enc/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\]\.stream_enc/pipe_ctx\[pipe_offset\]\.stream_res\.stream_enc/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\]->stream_enc/grouped_pipes\[i\]->stream_^Cs\.stream_enc/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\]->stream_enc/grouped_pipes\[0\]->stream_res\.stream_enc/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\]->stream_enc/grouped_pipes\[1\]->stream_res\.stream_enc/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\]->stream_enc/pipe_ctx\[i\]->stream_res\.stream_enc/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->stream_enc/pipe_ctx_old->stream_res\.stream_enc/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\]->stream_enc/pipe_set\[j\]->stream_res\.stream_enc/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\]\.stream_enc/pipe_ctx\[i\]\.stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipes\[i\]\.stream_enc/pipes\[i\]\.stream_res\.stream_enc/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 6b670fa9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ static bool stream_adjust_vmin_vmax(struct dc *dc,
	for (i = 0; i < MAX_PIPES; i++) {
		struct pipe_ctx *pipe = &core_dc->current_context->res_ctx.pipe_ctx[i];

		if (pipe->stream == stream && pipe->stream_enc) {
		if (pipe->stream == stream && pipe->stream_res.stream_enc) {
			core_dc->hwss.set_drr(&pipe, 1, vmin, vmax);

			/* build and update the info frame */
@@ -189,7 +189,7 @@ static bool stream_get_crtc_position(struct dc *dc,
		struct pipe_ctx *pipe =
				&core_dc->current_context->res_ctx.pipe_ctx[i];

		if (pipe->stream == stream && pipe->stream_enc) {
		if (pipe->stream == stream && pipe->stream_res.stream_enc) {
			core_dc->hwss.get_position(&pipe, 1, &position);

			*v_pos = position.vertical_count;
+6 −6
Original line number Diff line number Diff line
@@ -1311,8 +1311,8 @@ static enum dc_status enable_link(struct pipe_ctx *pipe_ctx)

		/* un-mute audio */
		/* TODO: audio should be per stream rather than per link */
		pipe_ctx->stream_enc->funcs->audio_mute_control(
			pipe_ctx->stream_enc, false);
		pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control(
			pipe_ctx->stream_res.stream_enc, false);
	}

	return status;
@@ -1699,7 +1699,7 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
	struct dc_stream_state *stream = pipe_ctx->stream;
	struct dc_link *link = stream->sink->link;
	struct link_encoder *link_encoder = link->link_enc;
	struct stream_encoder *stream_encoder = pipe_ctx->stream_enc;
	struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;
	struct dp_mst_stream_allocation_table proposed_table = {0};
	struct fixed31_32 avg_time_slots_per_mtp;
	struct fixed31_32 pbn;
@@ -1718,7 +1718,7 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
		&proposed_table,
		true)) {
		update_mst_stream_alloc_table(
					link, pipe_ctx->stream_enc, &proposed_table);
					link, pipe_ctx->stream_res.stream_enc, &proposed_table);
	}
	else
		dm_logger_write(link->ctx->logger, LOG_WARNING,
@@ -1781,7 +1781,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
	struct dc_stream_state *stream = pipe_ctx->stream;
	struct dc_link *link = stream->sink->link;
	struct link_encoder *link_encoder = link->link_enc;
	struct stream_encoder *stream_encoder = pipe_ctx->stream_enc;
	struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;
	struct dp_mst_stream_allocation_table proposed_table = {0};
	struct fixed31_32 avg_time_slots_per_mtp = dal_fixed31_32_from_int(0);
	uint8_t i;
@@ -1808,7 +1808,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
				false)) {

			update_mst_stream_alloc_table(
				link, pipe_ctx->stream_enc, &proposed_table);
				link, pipe_ctx->stream_res.stream_enc, &proposed_table);
		}
		else {
				dm_logger_write(link->ctx->logger, LOG_WARNING,
+1 −1
Original line number Diff line number Diff line
@@ -2464,7 +2464,7 @@ bool dc_link_dp_set_test_pattern(
			 * MuteAudioEndpoint(pPathMode->pDisplayPath, true);
			 */
			/* Blank stream */
			pipes->stream_enc->funcs->dp_blank(pipe_ctx->stream_enc);
			pipes->stream_res.stream_enc->funcs->dp_blank(pipe_ctx->stream_res.stream_enc);
		}

		dp_set_hw_test_pattern(link, test_pattern,
+3 −3
Original line number Diff line number Diff line
@@ -243,12 +243,12 @@ void dp_retrain_link_dp_test(struct dc_link *link,
		if (pipes[i].stream != NULL &&
			pipes[i].stream->sink != NULL &&
			pipes[i].stream->sink->link != NULL &&
			pipes[i].stream_enc != NULL &&
			pipes[i].stream_res.stream_enc != NULL &&
			pipes[i].stream->sink->link == link) {
			dm_delay_in_microseconds(link->ctx, 100);

			pipes[i].stream_enc->funcs->dp_blank(
					pipes[i].stream_enc);
			pipes[i].stream_res.stream_enc->funcs->dp_blank(
					pipes[i].stream_res.stream_enc);

			/* disable any test pattern that might be active */
			dp_set_hw_test_pattern(link,
+8 −8
Original line number Diff line number Diff line
@@ -925,7 +925,7 @@ struct pipe_ctx *resource_get_head_pipe_for_stream(
	int i;
	for (i = 0; i < MAX_PIPES; i++) {
		if (res_ctx->pipe_ctx[i].stream == stream &&
				res_ctx->pipe_ctx[i].stream_enc) {
				res_ctx->pipe_ctx[i].stream_res.stream_enc) {
			return &res_ctx->pipe_ctx[i];
			break;
		}
@@ -1096,7 +1096,7 @@ bool resource_attach_surfaces_to_context(
		if (tail_pipe) {
			free_pipe->stream_res.tg = tail_pipe->stream_res.tg;
			free_pipe->stream_res.opp = tail_pipe->stream_res.opp;
			free_pipe->stream_enc = tail_pipe->stream_enc;
			free_pipe->stream_res.stream_enc = tail_pipe->stream_res.stream_enc;
			free_pipe->audio = tail_pipe->audio;
			free_pipe->clock_source = tail_pipe->clock_source;
			free_pipe->top_pipe = tail_pipe;
@@ -1461,12 +1461,12 @@ enum dc_status resource_map_pool_resources(
			copy_pipe_ctx(old_pipe_ctx, pipe_ctx);

			/* Split pipe resource, do not acquire back end */
			if (!pipe_ctx->stream_enc)
			if (!pipe_ctx->stream_res.stream_enc)
				continue;

			set_stream_engine_in_use(
				&context->res_ctx, pool,
				pipe_ctx->stream_enc);
				pipe_ctx->stream_res.stream_enc);

			/* Switch to dp clock source only if there is
			 * no non dp stream that shares the same timing
@@ -1503,16 +1503,16 @@ enum dc_status resource_map_pool_resources(

		pipe_ctx = &context->res_ctx.pipe_ctx[pipe_idx];

		pipe_ctx->stream_enc =
		pipe_ctx->stream_res.stream_enc =
			find_first_free_match_stream_enc_for_link(
				&context->res_ctx, pool, stream);

		if (!pipe_ctx->stream_enc)
		if (!pipe_ctx->stream_res.stream_enc)
			return DC_NO_STREAM_ENG_RESOURCE;

		set_stream_engine_in_use(
			&context->res_ctx, pool,
			pipe_ctx->stream_enc);
			pipe_ctx->stream_res.stream_enc);

		/* TODO: Add check if ASIC support and EDID audio */
		if (!stream->sink->converter_disable_audio &&
@@ -2382,7 +2382,7 @@ bool pipe_need_reprogram(
			&& pipe_ctx_old->stream != pipe_ctx->stream)
		return true;

	if (pipe_ctx_old->stream_enc != pipe_ctx->stream_enc)
	if (pipe_ctx_old->stream_res.stream_enc != pipe_ctx->stream_res.stream_enc)
		return true;

	if (is_timing_changed(pipe_ctx_old->stream, pipe_ctx->stream))
Loading