File tree Expand file tree Collapse file tree
drivers/gpu/drm/amd/display/dc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -262,12 +262,10 @@ bool resource_construct(
262262 DC_ERR ("DC: failed to create audio!\n" );
263263 return false;
264264 }
265-
266265 if (!aud -> funcs -> endpoint_valid (aud )) {
267266 aud -> funcs -> destroy (& aud );
268267 break ;
269268 }
270-
271269 pool -> audios [i ] = aud ;
272270 pool -> audio_count ++ ;
273271 }
@@ -1621,24 +1619,25 @@ static struct audio *find_first_free_audio(
16211619 const struct resource_pool * pool ,
16221620 enum engine_id id )
16231621{
1624- int i ;
1625- for (i = 0 ; i < pool -> audio_count ; i ++ ) {
1622+ int i , available_audio_count ;
1623+
1624+ available_audio_count = pool -> audio_count ;
1625+
1626+ for (i = 0 ; i < available_audio_count ; i ++ ) {
16261627 if ((res_ctx -> is_audio_acquired [i ] == false) && (res_ctx -> is_stream_enc_acquired [i ] == true)) {
16271628 /*we have enough audio endpoint, find the matching inst*/
16281629 if (id != i )
16291630 continue ;
1630-
16311631 return pool -> audios [i ];
16321632 }
16331633 }
16341634
1635- /* use engine id to find free audio */
1636- if ((id < pool -> audio_count ) && (res_ctx -> is_audio_acquired [id ] == false)) {
1635+ /* use engine id to find free audio */
1636+ if ((id < available_audio_count ) && (res_ctx -> is_audio_acquired [id ] == false)) {
16371637 return pool -> audios [id ];
16381638 }
1639-
16401639 /*not found the matching one, first come first serve*/
1641- for (i = 0 ; i < pool -> audio_count ; i ++ ) {
1640+ for (i = 0 ; i < available_audio_count ; i ++ ) {
16421641 if (res_ctx -> is_audio_acquired [i ] == false) {
16431642 return pool -> audios [i ];
16441643 }
Original file line number Diff line number Diff line change @@ -613,6 +613,8 @@ void dce_aud_az_configure(
613613
614614 AZ_REG_WRITE (AZALIA_F0_CODEC_PIN_CONTROL_SINK_INFO1 ,
615615 value );
616+ DC_LOG_HW_AUDIO ("\n\tAUDIO:az_configure: index: %u data, 0x%x, displayName %s: \n" ,
617+ audio -> inst , value , audio_info -> display_name );
616618
617619 /*
618620 *write the port ID:
@@ -922,7 +924,6 @@ static const struct audio_funcs funcs = {
922924 .az_configure = dce_aud_az_configure ,
923925 .destroy = dce_aud_destroy ,
924926};
925-
926927void dce_aud_destroy (struct audio * * audio )
927928{
928929 struct dce_audio * aud = DCE_AUD (* audio );
@@ -953,7 +954,6 @@ struct audio *dce_audio_create(
953954 audio -> regs = reg ;
954955 audio -> shifts = shifts ;
955956 audio -> masks = masks ;
956-
957957 return & audio -> base ;
958958}
959959
You can’t perform that action at this time.
0 commit comments