Commit 66bfd4fd authored by Charlene Liu's avatar Charlene Liu Committed by Alex Deucher
Browse files

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: default avatarCharlene Liu <charlene.liu@amd.com>
Reviewed-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b7901be0
Loading
Loading
Loading
Loading
+8 −12
Original line number Original line Diff line number Diff line
@@ -1417,21 +1417,17 @@ static struct audio *find_first_free_audio(
		const struct resource_pool *pool)
		const struct resource_pool *pool)
{
{
	int i;
	int i;
	if (pool->audio_count >=  pool->stream_enc_count) {
	for (i = 0; i < pool->audio_count; 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)) {
		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];
			return pool->audios[i];
		}
		}
	}
	}
	} else { /*first come first serve*/
	/*not found the matching one, first come first serve*/
	for (i = 0; i < pool->audio_count; i++) {
	for (i = 0; i < pool->audio_count; i++) {
		if (res_ctx->is_audio_acquired[i] == false) {
		if (res_ctx->is_audio_acquired[i] == false) {

			return pool->audios[i];
			return pool->audios[i];
		}
		}
	}
	}
	}
	return 0;
	return 0;
}
}