<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">No problems with amdgpu, but when my headphone port is glitching I often end up with some HDMI audio output selected instead.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">It also cleans up the clutter in the audio selection list.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">//E<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den tis 26 jan. 2021 kl 15:34 skrev Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Jan 26, 2021 at 9:32 AM Ernst Sjöstrand <<a href="mailto:ernstp@gmail.com" target="_blank">ernstp@gmail.com</a>> wrote:<br>
><br>
> With the pre-DC path you could set audio=0 to disable audio.<br>
> This adds a similar feature for the DC path with<br>
> amdgpu.dcfeaturemask=0x10.<br>
><br>
> Signed-off-by: Ernst Sjöstrand <<a href="mailto:ernstp@gmail.com" target="_blank">ernstp@gmail.com</a>><br>
<br>
Is there a reason you want this?  I.e., is audio causing problems for you?<br>
<br>
Alex<br>
<br>
> ---<br>
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++<br>
>  drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 7 ++++---<br>
>  drivers/gpu/drm/amd/display/dc/dc.h               | 1 +<br>
>  drivers/gpu/drm/amd/include/amd_shared.h          | 1 +<br>
>  4 files changed, 9 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> index e490fc2486f7..322d9439b9c2 100644<br>
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> @@ -1013,6 +1013,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)<br>
>         if (amdgpu_dc_feature_mask & DC_DISABLE_FRACTIONAL_PWM_MASK)<br>
>                 init_data.flags.disable_fractional_pwm = true;<br>
><br>
> +       if (amdgpu_dc_feature_mask & DC_DISABLE_AUDIO)<br>
> +               init_data.flags.disable_audio = true;<br>
> +<br>
>         init_data.flags.power_down_display_on_boot = true;<br>
><br>
>         init_data.soc_bounding_box = adev->dm.soc_bounding_box;<br>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c<br>
> index 68b65a090d17..4cc0d2308c98 100644<br>
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c<br>
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c<br>
> @@ -2141,9 +2141,10 @@ enum dc_status resource_map_pool_resources(<br>
>                 true);<br>
><br>
>         /* TODO: Add check if ASIC support and EDID audio */<br>
> -       if (!stream->converter_disable_audio &&<br>
> -           dc_is_audio_capable_signal(pipe_ctx->stream->signal) &&<br>
> -           stream->audio_info.mode_count && stream->audio_info.flags.all) {<br>
> +       if (!dc->config.disable_audio &&<br>
> +               !stream->converter_disable_audio &&<br>
> +               dc_is_audio_capable_signal(pipe_ctx->stream->signal) &&<br>
> +               stream->audio_info.mode_count && stream->audio_info.flags.all) {<br>
>                 pipe_ctx->stream_res.audio = find_first_free_audio(<br>
>                 &context->res_ctx, pool, pipe_ctx->stream_res.stream_enc->id, dc_ctx->dce_version);<br>
><br>
> diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h<br>
> index 71d46ade24e5..2ab6d770c66b 100644<br>
> --- a/drivers/gpu/drm/amd/display/dc/dc.h<br>
> +++ b/drivers/gpu/drm/amd/display/dc/dc.h<br>
> @@ -297,6 +297,7 @@ struct dc_config {<br>
>         bool multi_mon_pp_mclk_switch;<br>
>         bool disable_dmcu;<br>
>         bool enable_4to1MPC;<br>
> +       bool disable_audio;<br>
>  #if defined(CONFIG_DRM_AMD_DC_DCN)<br>
>         bool clamp_min_dcfclk;<br>
>  #endif<br>
> diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h<br>
> index 9676016a37ce..7202d816a97e 100644<br>
> --- a/drivers/gpu/drm/amd/include/amd_shared.h<br>
> +++ b/drivers/gpu/drm/amd/include/amd_shared.h<br>
> @@ -220,6 +220,7 @@ enum DC_FEATURE_MASK {<br>
>         DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2,<br>
>         DC_DISABLE_FRACTIONAL_PWM_MASK = 0x4,<br>
>         DC_PSR_MASK = 0x8,<br>
> +       DC_DISABLE_AUDIO = 0x10,<br>
>  };<br>
><br>
>  enum DC_DEBUG_MASK {<br>
> --<br>
> 2.27.0<br>
><br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</blockquote></div>