aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo (Hanghong) Ma <[email protected]>2022-03-10 17:20:35 -0500
committerAlex Deucher <[email protected]>2022-03-15 14:41:10 -0400
commit10499e4055949e4682d2e7c428365175e99e0800 (patch)
treee658f15e156fd0300397542d754e4d58ca4f027a
parenta0248d543bbf2a977e7e6d9966ce8d96f6e5c358 (diff)
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: Martin Leung <[email protected]> Acked-by: Agustin Gutierrez <[email protected]> Signed-off-by: Leo (Hanghong) Ma <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_stream.c14
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc_stream.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index dc5fd27b031a..c4e871f358ab 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -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(
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index f631b61abedd..99a750f561f8 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -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_ */