blob: f06bcb536083dffb30a4aaae80ec4715c5f52779 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
From d5895f28c946863ab31f91b0753cec65b2296520 Mon Sep 17 00:00:00 2001
From: Charlene Liu <charlene.liu@amd.com>
Date: Thu, 28 Sep 2017 15:38:01 -0400
Subject: [PATCH 2524/4131] 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>
---
drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 20 ++++++++------------
1 file 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 68c6132..c31dccd 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;
--
2.7.4
|