summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
diff options
context:
space:
mode:
authorCharlene Liu <charlene.liu@amd.com>2017-09-28 15:38:01 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-10-21 16:46:27 -0400
commit66bfd4fd17737d0a644fa74e0cb309c0daf8fb22 (patch)
tree30e2d07700dc4f058f9e5b14fd55abcd7c019e41 /drivers/gpu/drm/amd/display/dc/core/dc_resource.c
parentb7901be0ed5d43525ac2c3fc2a3f9a0cdc5d069c (diff)
drm/amd/display: arbitration find the matching dig-az first.
[Description] this change is in branch already. without this change, after resume, az_inst might swapped. Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc_resource.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_resource.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 68c613229a10..c31dccdc3d2e 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -1417,19 +1417,15 @@ static struct audio *find_first_free_audio(
const struct resource_pool *pool)
{
int i;
- if (pool->audio_count >= pool->stream_enc_count) {
- for (i = 0; i < pool->audio_count; i++) {
- if ((res_ctx->is_audio_acquired[i] == false) && (res_ctx->is_stream_enc_acquired[i] == true)) {
- /*we have enough audio endpoint, no need to do dynamic distribution*/
- return pool->audios[i];
- }
+ for (i = 0; i < pool->audio_count; i++) {
+ if ((res_ctx->is_audio_acquired[i] == false) && (res_ctx->is_stream_enc_acquired[i] == true)) {
+ return pool->audios[i];
}
- } else { /*first come first serve*/
- for (i = 0; i < pool->audio_count; i++) {
- if (res_ctx->is_audio_acquired[i] == false) {
-
- return pool->audios[i];
- }
+ }
+ /*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) {
+ return pool->audios[i];
}
}
return 0;