]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Expose audio inst from DC to DM
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Fri, 28 Jun 2019 17:39:41 +0000 (13:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Aug 2019 17:08:09 +0000 (19:08 +0200)
[ Upstream commit 5fdb7c4c7f2691efd760b0b0dc00da4a3699f1a6 ]

[Why]
In order to give pin notifications to the sound driver from DM we need
to know whether audio is enabled on a stream and what pin it's using
from DC.

[How]
Expose the instance via stream status if it's a mapped resource for
the stream. It will be -1 if there's no audio mapped.

Cc: Leo Li <sunpeng.li@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dc_stream.h

index eac7186e4f0841fdb771dd722b59dc7e819afb16..12142d13f22f235097a2f3a0c8f6cf7d4f699d2a 100644 (file)
@@ -2034,6 +2034,9 @@ enum dc_status resource_map_pool_resources(
                if (context->streams[i] == stream) {
                        context->stream_status[i].primary_otg_inst = pipe_ctx->stream_res.tg->inst;
                        context->stream_status[i].stream_enc_inst = pipe_ctx->stream_res.stream_enc->id;
+                       context->stream_status[i].audio_inst =
+                               pipe_ctx->stream_res.audio ? pipe_ctx->stream_res.audio->inst : -1;
+
                        return DC_OK;
                }
 
index 189bdab929a55651c40245c3de205c6ef65b5fdb..c20803b71fa52df9212036e023de1a75d513bcdb 100644 (file)
@@ -42,6 +42,7 @@ struct dc_stream_status {
        int primary_otg_inst;
        int stream_enc_inst;
        int plane_count;
+       int audio_inst;
        struct timing_sync_info timing_sync_info;
        struct dc_plane_state *plane_states[MAX_SURFACE_NUM];
 };