<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Am 27.01.21 um 13:23 schrieb Ernst
      Sjöstrand:<br>
    </div>
    <blockquote type="cite" cite="mid:CAD=4a=WiL5m0jJOgEDe9xrM3bsX1Xt+YTtV_WY5_j+sAOEGe=g@mail.gmail.com">
      
      <div dir="ltr">
        <div>
          <div style="font-family:arial,helvetica,sans-serif" class="gmail_default">Just some additional thoughts...</div>
          <br>
        </div>
        <div>The amdgpu driver already supports this as I mentioned,
          however only for the non-DC codepath.</div>
        <div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">"</span>Set
          HDMI/DPAudio. Only affects non-DC display handling. The
          default is -1 (Enabled), set 0 to disabled it.<span class="gmail_default" style="font-family:arial,helvetica,sans-serif">"</span></div>
      </div>
    </blockquote>
    <br>
    I've added this because I completely reverse engineered this roughly
    10 years ago without any hardware documentation.<br>
    <br>
    <blockquote type="cite" cite="mid:CAD=4a=WiL5m0jJOgEDe9xrM3bsX1Xt+YTtV_WY5_j+sAOEGe=g@mail.gmail.com">
      <div dir="ltr">
        <div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
          </span></div>
        <div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Linux doesn't
            have a good infrastructure to disable sound cards afaik. If
            someone has 6 displays, do they really need 6 extra sound
            cards? Minor thing, I know.</span></div>
      </div>
    </blockquote>
    <br>
    Well yes, that is intentional :) In general the kernel should expose
    and manage all available hardware.<br>
    <br>
    What you do with that in userspace is a completely different
    question.<br>
    <br>
    Christian.<br>
    <br>
    <blockquote type="cite" cite="mid:CAD=4a=WiL5m0jJOgEDe9xrM3bsX1Xt+YTtV_WY5_j+sAOEGe=g@mail.gmail.com">
      <div dir="ltr">
        <div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
          </span></div>
        <div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">It was very
            easy to do, and didn't feel intrusive.<br>
          </span></div>
        <div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span></div>
        <div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">//E<br>
          </span></div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">Den ons 27 jan. 2021 kl 12:11
          skrev Christian König <<a href="mailto:ckoenig.leichtzumerken@gmail.com" moz-do-not-send="true">ckoenig.leichtzumerken@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">Am
          26.01.21 um 17:15 schrieb Harry Wentland:<br>
          > On 2021-01-26 9:51 a.m., Ernst Sjöstrand wrote:<br>
          >> No problems with amdgpu, but when my headphone port
          is glitching I <br>
          >> often end up with some HDMI audio output selected
          instead.<br>
          >><br>
          ><br>
          > Wouldn't this be better fixed in the audio management
          service, like <br>
          > PulseAudio? It sounds like it's not remembering your
          preferences <br>
          > correctly.<br>
          <br>
          Yeah agree. A feature like this in a specific hardware driver
          is <br>
          justified if it prevents hangs or something similar.<br>
          <br>
          But this just sounds like a problem in a higher level of the
          stack which <br>
          should be fixed hardware driver independently.<br>
          <br>
          Christian.<br>
          <br>
          ><br>
          > Harry<br>
          ><br>
          >> It also cleans up the clutter in the audio selection
          list.<br>
          >><br>
          >> //E<br>
          >><br>
          >> Den tis 26 jan. 2021 kl 15:34 skrev Alex Deucher <br>
          >> <<a href="mailto:alexdeucher@gmail.com" target="_blank" moz-do-not-send="true">alexdeucher@gmail.com</a>
          <mailto:<a href="mailto:alexdeucher@gmail.com" target="_blank" moz-do-not-send="true">alexdeucher@gmail.com</a>>>:<br>
          >><br>
          >>     On Tue, Jan 26, 2021 at 9:32 AM Ernst Sjöstrand
          <<a href="mailto:ernstp@gmail.com" target="_blank" moz-do-not-send="true">ernstp@gmail.com</a><br>
          >>     <mailto:<a href="mailto:ernstp@gmail.com" target="_blank" moz-do-not-send="true">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" moz-do-not-send="true">ernstp@gmail.com</a><br>
          >>     <mailto:<a href="mailto:ernstp@gmail.com" target="_blank" moz-do-not-send="true">ernstp@gmail.com</a>>><br>
          >><br>
          >>     Is there a reason you want this?  I.e., is audio
          causing problems<br>
          >>     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<br>
          >>    
          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<br>
          >>     amdgpu_device *adev)<br>
          >>      >         if (amdgpu_dc_feature_mask & <br>
          >> 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<br>
          >>    
          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 <br>
          >> 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 &&<br>
          >>     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 &&<br>
          >>     stream->audio_info.flags.all) {<br>
          >>      >               
           pipe_ctx->stream_res.audio = <br>
          >> find_first_free_audio(<br>
          >>      >                 &context->res_ctx,
          pool,<br>
          >>     pipe_ctx->stream_res.stream_enc->id,
          dc_ctx->dce_version);<br>
          >>      ><br>
          >>      > diff --git
          a/drivers/gpu/drm/amd/display/dc/dc.h<br>
          >>     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<br>
          >>     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" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a> <br>
          >> <mailto:<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a>><br>
          >>      > <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cchristian.koenig%40amd.com%7C3354fa4fd15e44cf893008d8c2be6eae%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637473470463299654%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=z7%2FzAtqTi3XNYmiX3xe7u9IhsxpwclmNIlQUAEolFnI%3D&reserved=0" originalsrc="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" shash="krmYkxgSfMqwIq7ySynkZkB4cP2mfQL0Vf1k4Ot6hgiJbxhAWim5HbW8JhYn9BWkzSS5ZxB1lX2U0AMMtFvAoqROWuM6rfxg6zoRUwh8EWc6Mf9F+pwQDNopRqYvDtcJRed6sj+gNYJ9X79Zta+ZvDO8i/mZkvwqsBK44+Kgsbg=" rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
          >> <<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cchristian.koenig%40amd.com%7C3354fa4fd15e44cf893008d8c2be6eae%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637473470463299654%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=z7%2FzAtqTi3XNYmiX3xe7u9IhsxpwclmNIlQUAEolFnI%3D&reserved=0" originalsrc="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" shash="krmYkxgSfMqwIq7ySynkZkB4cP2mfQL0Vf1k4Ot6hgiJbxhAWim5HbW8JhYn9BWkzSS5ZxB1lX2U0AMMtFvAoqROWuM6rfxg6zoRUwh8EWc6Mf9F+pwQDNopRqYvDtcJRed6sj+gNYJ9X79Zta+ZvDO8i/mZkvwqsBK44+Kgsbg=" rel="noreferrer" target="_blank" moz-do-not-send="true">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CHARRY.WENTLAND%40amd.com%7C736532bfba5d4b96e9ac08d8c209e99d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637472695123517788%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1MWOfMfaIhdV%2BcnH%2BeAC0aRqb9BMVrdvReZBKG2ZJSc%3D&reserved=0</a>><br>
          >><br>
          >><br>
          >> _______________________________________________<br>
          >> amd-gfx mailing list<br>
          >> <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
          >> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cchristian.koenig%40amd.com%7C3354fa4fd15e44cf893008d8c2be6eae%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637473470463309647%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=P1LjkrSmbCSv0NuUJiS3aMO2poxzg3BzrlYr2p%2FSISw%3D&reserved=0" originalsrc="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" shash="AgEx6lB5XYMuj0DaZIRAHgNvMIRDilSlJBiDJdbnjmSZrcr/2ufW0qSnsbrIC2Tgj50ba95UxOXG9/veoj0d9zcznwlbnDvJLLckL4TUVeL+tkv1aGT/3BusXhPNKEJMdE9XmDTPjfz18Z41lQjiMcnbScmMVizFIYV/HKXVKFU=" rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
          >><br>
          > _______________________________________________<br>
          > amd-gfx mailing list<br>
          > <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
          > <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cchristian.koenig%40amd.com%7C3354fa4fd15e44cf893008d8c2be6eae%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637473470463309647%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=P1LjkrSmbCSv0NuUJiS3aMO2poxzg3BzrlYr2p%2FSISw%3D&reserved=0" originalsrc="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" shash="AgEx6lB5XYMuj0DaZIRAHgNvMIRDilSlJBiDJdbnjmSZrcr/2ufW0qSnsbrIC2Tgj50ba95UxOXG9/veoj0d9zcznwlbnDvJLLckL4TUVeL+tkv1aGT/3BusXhPNKEJMdE9XmDTPjfz18Z41lQjiMcnbScmMVizFIYV/HKXVKFU=" rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>