Commit 10499e40 authored by Leo (Hanghong) Ma's avatar Leo (Hanghong) Ma Committed by Alex Deucher
Browse files

drm/amd/display: Add function to get the pipe from the stream context



[Why]
We need a helper function in dc to grab the pipe from the stream
context.

[How]
Add it.

Reviewed-by: default avatarMartin Leung <Martin.Leung@amd.com>
Acked-by: default avatarAgustin Gutierrez <agustin.gutierrez@amd.com>
Signed-off-by: default avatarLeo (Hanghong) Ma <hanghong.ma@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a0248d54
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -718,6 +718,20 @@ enum dc_status dc_stream_add_dsc_to_resource(struct dc *dc,
	}
}

struct pipe_ctx *dc_stream_get_pipe_ctx(struct dc_stream_state *stream)
{
	int i = 0;

	for (i = 0; i < MAX_PIPES; i++) {
		struct pipe_ctx *pipe = &stream->ctx->dc->current_state->res_ctx.pipe_ctx[i];

		if (pipe->stream == stream)
			return pipe;
	}

	return NULL;
}

void dc_stream_log(const struct dc *dc, const struct dc_stream_state *stream)
{
	DC_LOG_DC(
+2 −0
Original line number Diff line number Diff line
@@ -524,4 +524,6 @@ bool dc_stream_get_crtc_position(struct dc *dc,
				 unsigned int *v_pos,
				 unsigned int *nom_v_pos);

struct pipe_ctx *dc_stream_get_pipe_ctx(struct dc_stream_state *stream);

#endif /* DC_STREAM_H_ */