diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-08-17 08:14:35 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-08-17 08:14:35 +0000 |
commit | 930aaeb99d69d40ae42559a3dd575b072bbf3d76 (patch) | |
tree | 9eff5d67423bc46d8d8d5eecff2b583b775e8193 /sys | |
parent | edbe36acaf4951d7cab697800cc75cd5696357ba (diff) |
drm/amd/display: use encoder's engine id to find matched free audio device
From Tai Man
e7a8a794109c07e0b8d7bd55fbfcb3082991626a in linux 4.19.y/4.19.67
74eda776d7a4e69ec7aa1ce30a87636f14220fbb in mainline linux
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/amd/display/dc/core/dc_resource.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/core/dc_resource.c b/sys/dev/pci/drm/amd/display/dc/core/dc_resource.c index cb522395556..69a4f52aa38 100644 --- a/sys/dev/pci/drm/amd/display/dc/core/dc_resource.c +++ b/sys/dev/pci/drm/amd/display/dc/core/dc_resource.c @@ -222,7 +222,7 @@ bool resource_construct( * PORT_CONNECTIVITY == 1 (as instructed by HW team). */ update_num_audio(&straps, &num_audio, &pool->audio_support); - for (i = 0; i < pool->pipe_count && i < num_audio; i++) { + for (i = 0; i < caps->num_audio; i++) { struct audio *aud = create_funcs->create_audio(ctx, i); if (aud == NULL) { @@ -1713,6 +1713,12 @@ static struct audio *find_first_free_audio( return pool->audios[i]; } } + + /* use engine id to find free audio */ + if ((id < pool->audio_count) && (res_ctx->is_audio_acquired[id] == false)) { + return pool->audios[id]; + } + /*not found the matching one, first come first serve*/ for (i = 0; i < pool->audio_count; i++) { if (res_ctx->is_audio_acquired[i] == false) { |