drm/amd/display: audio endpoint cannot switch
authorPaul Hsieh <paul.hsieh@amd.com>
Tue, 1 Oct 2019 09:06:04 +0000 (17:06 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 25 Oct 2019 20:50:08 +0000 (16:50 -0400)
[Why]
On some systems, we need to check the dcn version in runtime
system, not in compile time.

[How]
Stub in dcn version parameter to find_first_free_audio

Signed-off-by: Paul Hsieh <paul.hsieh@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 25da0c4..da9e2e5 100644 (file)
@@ -1629,7 +1629,8 @@ static int acquire_first_free_pipe(
 static struct audio *find_first_free_audio(
                struct resource_context *res_ctx,
                const struct resource_pool *pool,
-               enum engine_id id)
+               enum engine_id id,
+               enum dce_version dc_version)
 {
        int i, available_audio_count;
 
@@ -1965,7 +1966,7 @@ enum dc_status resource_map_pool_resources(
            dc_is_audio_capable_signal(pipe_ctx->stream->signal) &&
            stream->audio_info.mode_count && stream->audio_info.flags.all) {
                pipe_ctx->stream_res.audio = find_first_free_audio(
-               &context->res_ctx, pool, pipe_ctx->stream_res.stream_enc->id);
+               &context->res_ctx, pool, pipe_ctx->stream_res.stream_enc->id, dc_ctx->dce_version);
 
                /*
                 * Audio assigned in order first come first get.