1. 03 9月, 2017 1 次提交
    • W
      ALSA: hda: Fix regression of hdmi eld control created based on invalid pcm · 1f7f51a6
      Wang YanQing 提交于
      Commit fb087eaa ("ALSA: hda - hdmi eld control created based on pcm")
      forget to filter out invalid pcm numbers, if there is only one invalid pcm
      number, then this issue causes we create eld control for invalid pcm silently,
      but when there are more than one invalid pcm numbers, then this issue bring
      probe error looks like below dmesg:
      "
      kernel: [    1.647283] snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops 0xc2967540)
      kernel: [    1.651192] snd_hda_intel 0000:00:03.0: Too many HDMI devices
      kernel: [    1.651195] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
      kernel: [    1.651197] snd_hda_intel 0000:00:03.0: Too many HDMI devices
      kernel: [    1.651199] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
      kernel: [    1.651201] snd_hda_intel 0000:00:03.0: Too many HDMI devices
      kernel: [    1.651203] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
      kernel: [    1.651676] snd_hda_intel 0000:00:03.0: control 3:0:0:ELD:0 is already present
      kernel: [    1.651787] snd_hda_codec_hdmi: probe of hdaudioC0D0 failed with error -16
      "
      
      This patch add invalid pcm number filter before calling hdmi_create_eld_ctl.
      
      Fixes: fb087eaa ("ALSA: hda - hdmi eld control created based on pcm")
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1f7f51a6
  2. 15 7月, 2017 1 次提交
  3. 13 7月, 2017 1 次提交
  4. 28 6月, 2017 2 次提交
  5. 09 6月, 2017 1 次提交
  6. 13 4月, 2017 1 次提交
  7. 28 2月, 2017 1 次提交
  8. 22 2月, 2017 1 次提交
    • B
      ALSA: pci: constify snd_kcontrol_new structures · f3b827e0
      Bhumika Goyal 提交于
      Declare snd_kcontrol_new structures as const as they are only passed as
      an argument to the function snd_ctl_new1. This argument is of type
      const, so snd_kcontrol_new structures having the same property can be
      made const too.
      Done using Coccinelle:
      
      @r1 disable optional_qualifier @
      identifier i;
      position p;
      @@
      static struct snd_kcontrol_new i@p = {...};
      
      @ok1@
      identifier r1.i;
      position p;
      expression e1;
      @@
      snd_ctl_new1(&i@p,e1)
      
      @bad@
      position p!={r1.p,ok1.p};
      identifier r1.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      +const
      struct snd_kcontrol_new i;
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f3b827e0
  9. 09 2月, 2017 1 次提交
  10. 12 1月, 2017 1 次提交
  11. 23 9月, 2016 1 次提交
    • P
      drm/i915/dp: DP audio API changes for MST · f9318941
      Pandiyan, Dhinakaran 提交于
      DP MST provides the capability to send multiple video and audio streams
      through a single port. This requires the API's between i915 and audio
      drivers to distinguish between multiple audio capable displays that can be
      connected to a port. Currently only the port identity is shared in the
      APIs. This patch adds support for MST with an additional parameter
      'int pipe'. The existing parameter 'port' does not change it's meaning.
      
      pipe =
      	MST	: display pipe that the stream originates from
      	Non-MST	: -1
      
      Affected APIs:
      struct i915_audio_component_ops
      -       int (*sync_audio_rate)(struct device *, int port, int rate);
      +	int (*sync_audio_rate)(struct device *, int port, int pipe,
      +	     int rate);
      
      -       int (*get_eld)(struct device *, int port, bool *enabled,
      -                       unsigned char *buf, int max_bytes);
      +       int (*get_eld)(struct device *, int port, int pipe,
      +		       bool *enabled, unsigned char *buf, int max_bytes);
      
      struct i915_audio_component_audio_ops
      -       void (*pin_eld_notify)(void *audio_ptr, int port);
      +       void (*pin_eld_notify)(void *audio_ptr, int port, int pipe);
      
      This patch makes dummy changes in the audio drivers (thanks Libin) for
      build to succeed. The audio side drivers will send the right 'pipe' values
      for MST in patches that will follow.
      
      v2:
      Renamed the new API parameter from 'dev_id' to 'pipe'. (Jim, Ville)
      Included Asoc driver API compatibility changes from Jeeja.
      Added WARN_ON() for invalid pipe in get_saved_encoder(). (Takashi)
      Added comment for av_enc_map[] definition. (Takashi)
      
      v3:
      Fixed logic error introduced while renaming 'dev_id' as 'pipe' (Ville)
      Renamed get_saved_encoder() to get_saved_enc() to reduce line length
      
      v4:
      Rebased.
      Parameter check for pipe < -1 values in get_saved_enc() (Ville)
      Switched to for_each_pipe() in get_saved_enc() (Ville)
      Renamed 'pipe' to 'dev_id' in audio side code (Takashi)
      
      v5:
      Included a comment for the dev_id arg. (Libin)
      Signed-off-by: NDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1474488168-2343-1-git-send-email-dhinakaran.pandiyan@intel.com
      f9318941
  12. 16 6月, 2016 1 次提交
  13. 11 5月, 2016 1 次提交
    • T
      ALSA: hda - Fix regression on ATI HDMI audio · 39669225
      Takashi Iwai 提交于
      The HDMI/DP audio output on ATI/AMD chips got broken due to the recent
      restructuring of chmap.  Fortunately, Daniel Exner could bisect, and
      pointed the culprit commit [739ffee9: ALSA: hda - Add hdmi chmap
      verb programming ops to chmap object].
      
      This commit moved some ops from hdmi_ops to chmap_ops, and reassigned
      the ops in the embedded chmap object in hdmi_spec instead.
      Unfortunately, the reassignment of these ops in patch_atihdmi() were
      moved into an if block that is performed only for old chips.  Thus, on
      newer chips, the generic ops is still used, which doesn't work for
      such ATI/AMD chips.
      
      This patch addresses the regression, simply by moving the assignment
      of chmap ops to the right place.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=114981
      Fixes: 739ffee9 ('ALSA: hda - Add hdmi chmap verb programming ops to chmap object')
      Reported-and-tested-by: NDaniel Exner <dex@dragonslave.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      39669225
  14. 26 4月, 2016 1 次提交
    • T
      ALSA: hda - Update BCLK also at hotplug for i915 HSW/BDW · bb03ed21
      Takashi Iwai 提交于
      The recent bug report suggests that BCLK setup for i915 HSW/BDW needs
      to be updated at each HDMI hotplug, not only at initialization and
      resume.  That is, we need to update HSW_EM4 and HSW_EM5 registers at
      ELD notification, too.  Otherwise the HDMI audio may be out of sync
      and played in a wrong pitch.
      
      However, the HDA codec driver has no access to the controller
      registers, and currently the code managing these registers is in
      hda_intel.c, i.e. local to the controller driver.  For allowing the
      explicit BCLK update from the codec driver, as in this patch, the
      former haswell_set_bclk() in hda_intel.c is moved to hdac_i915.c and
      exposed as snd_hdac_i915_set_bclk().  This is called from both the HDA
      controller driver and intel_pin_eld_notify() in HDMI codec driver.
      
      Along with this change, snd_hdac_get_display_clk() gets dropped as
      it's no longer used.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91410
      Cc: <stable@vger.kernel.org> # v4.5+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      bb03ed21
  15. 18 4月, 2016 1 次提交
  16. 13 4月, 2016 2 次提交
    • T
      ALSA: hda - Fix inconsistent monitor_present state until repoll · c44da62b
      Takashi Iwai 提交于
      While the previous commit fixed the missing monitor_present flag
      update, it may be still in an inconsistent state while the driver
      repolls: the flag itself is updated, but the eld_valid flag and the
      contents don't follow until the repoll finishes (and may be repeated
      for a few times).
      
      The basic problem is that pin_eld->monitor_present is updated in the
      caller side.  This should have been updated only in update_eld().  So,
      the proper fix is to avoid accessing pin_eld but only spec->temp_eld.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c44da62b
    • H
      ALSA: hda - Fix regression of monitor_present flag in eld proc file · 023d8218
      Hyungwon Hwang 提交于
      The commit [bd481285: ALSA: hda - Fix forgotten HDMI
      monitor_present update] covered the missing update of monitor_present
      flag, but this caused a regression for devices without the i915 eld
      notifier.  Since the old code supposed that pin_eld->monitor_present
      was updated by the caller side, the hdmi_present_sense_via_verbs()
      doesn't update the temporary eld->monitor_present but only
      pin_eld->monitor_present, which is now overridden in update_eld().
      
      The fix is to update pin_eld->monitor_present as well before calling
      update_eld().
      
      Note that this may still leave monitor_present flag in an inconsistent
      state when the driver repolls, but this is at least the old behavior.
      More proper fix will follow in the later patch.
      
      Fixes: bd481285 ('ALSA: hda - Fix forgotten HDMI monitor_present update')
      Signed-off-by: NHyungwon Hwang <hyungwon.hwang7@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      023d8218
  17. 04 4月, 2016 1 次提交
    • S
      ALSA: hda - Update chmap tlv to report sink's capability · 44fde3b8
      Subhransu S. Prusty 提交于
      The existing TLV callback implementation copies all of the
      cea_channel_speaker_allocation map table to the TLV container
      irrespective of what is reported by sink. This is of little use
      to the userspace application.
      
      With this patch, it parses the spk_alloc block as queried from
      the ELD, and copies only the corresponding mapping channel
      allocation entries from the cea channel speaker allocation table.
      Thus the user can parse the TLV container to identify sink's
      capability and set the channel map accordingly.
      
      It shouldn't impact the behavior in AMD chipset, as this makes
      use of already parsed spk alloc block to calculate the channel
      map.
      Signed-off-by: NSubhransu S. Prusty <subhransu.s.prusty@intel.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      44fde3b8
  18. 28 3月, 2016 7 次提交
    • T
      ALSA: hda - Enable i915 ELD notifier for Intel IronLake and Baytrail · 7ff652ff
      Takashi Iwai 提交于
      Since we have the fixed pin-port mapping for Intel IronLake (IbexPeak)
      and Baytrail (ValleyView) platforms in the code side, now it's time to
      add the support in the codec driver side.  This patch simply enables
      the i915 ELD notifier for these in addition with the fix of the
      mapping from the port to NID in the callback.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7ff652ff
    • T
      ALSA: hda - Add the pin / port mapping on Intel ILK and VLV · d745f5e7
      Takashi Iwai 提交于
      Intel IronLake and ValleyView platforms have different HDMI widget pin
      and digital port mapping from other newer ones.  The recent ones
      (HSW+) have NID 0x05 to 0x07 for port B to port D, while these chips
      have NID 0x04 to 0x06.
      
      For adapting this mapping, pass the codec object instead of the bus
      object to snd_hdac_sync_audio_rate() and snd_hdac_acomp_get_eld() so
      that they can check the codec ID and calculate the mapping properly.
      
      The changes in the HDMI codec driver side will follow in the later
      patch.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d745f5e7
    • T
      ALSA: hda - Use eld notifier for Intel SandyBridge and IvyBridge HDMI/DP · e85015a3
      Takashi Iwai 提交于
      Intel SandyBridge and IvyBridge (CougarPoint and PantherPoint
      platforms) have also the same digital port vs audio widget mapping
      (from port B = NID 0x05 to port D = NID 0x07) as Haswell & co.
      So, we can reuse the existing functions for HSW+ for these platforms
      without changing there, but just by re-adding the on-demand i915
      binding in HDMI codec driver.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e85015a3
    • T
      ALSA: hda - Introduce pin_cvt_fixup() ops to hdmi parser · 4846a67e
      Takashi Iwai 提交于
      For reducing the splat of is_haswell_plus() or such macros, this patch
      introduces pin_cvt_fixup() ops to hdmi_spec.  For HSW+ and VLV+
      codecs, set this ops so that the driver can call the Intel-specific
      workarounds appropriately.
      
      A gratis bonus that we can remove the mux_id argument from
      hdmi_choose_cvt(), too, since the fixup function always refers the
      mux_idx from the given per_pin object.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4846a67e
    • T
      ALSA: hda - Override HDMI setup_stream ops for Intel HSW+ · 2c1c9b86
      Takashi Iwai 提交于
      Instead of checking at each time with is_haswell_plus() macro,
      override the setup_stream ops itself for HSW+ chips.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2c1c9b86
    • T
      ALSA: hda - Apply AMP fix in hdmi_setup_audio_infoframe() generically · 44bb6d0c
      Takashi Iwai 提交于
      The need for reprogramming the AMP mute bit at each audio info frame
      setup isn't always specific to Intel chips.  It's safer to set it
      generically for all codecs with the amp bit, as this verb execution
      itself isn't too much load.  This eliminates one usage of
      is_haswell_plus() macro, after all.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      44bb6d0c
    • T
      ALSA: hda - Split out Intel-specific codes from patch_generic_hdmi() · a686632f
      Takashi Iwai 提交于
      We have too many Intel-specific codes in patch_hdmi_generic() despite
      its function name.  And this makes it difficult to adjust per chipset,
      e.g. for allowing the audio notifier on an old chipset, one would need
      to add an explicit if() check.
      
      This patch attempts some code refactoring and cleanups in this regard;
      the Intel-specific codes are moved out of patch_generic_hdmi() into
      the new functions, patch_i915_hsw_hdmi() and patch_i915_byt_hdmi(),
      depending on the chipset.  The other old Intel chipsets keep using
      patch_generic_hdmi() without Intel hacks.  The existing
      patch_generic_hdmi() is also split to a few components so that they
      can be called from the Intel codec parsers.
      
      There are still many is_haswell*() and is_valleyview*() macro usages
      in the code.  They will be cleaned up later.  For the time being, only
      the entry are concerned.
      
      Along with this change, the i915_bound flag and the on-demand i915
      component binding have been removed as a cleanup, since there is no
      user at this moment.  This will be added back later once when Cougar
      Point and else start using the i915 eld notifier.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a686632f
  19. 21 3月, 2016 1 次提交
  20. 20 3月, 2016 1 次提交
    • T
      ALSA: hda - Workaround for unbalanced i915 power refcount by concurrent probe · 7169701a
      Takashi Iwai 提交于
      The recent addition of on-demand i915 audio component binding in the
      codec driver seems leading to the unbalanced i915 power refcount,
      according to Intel CI tests.  Typically, it gets a kernel WARNING
      like:
        WARNING: CPU: 3 PID: 173 at sound/hda/hdac_i915.c:91 snd_hdac_display_power+0xf1/0x110 [snd_hda_core]()
        Call Trace:
         [<ffffffff813fef15>] dump_stack+0x67/0x92
         [<ffffffff81078a21>] warn_slowpath_common+0x81/0xc0
         [<ffffffff81078b15>] warn_slowpath_null+0x15/0x20
         [<ffffffffa00f77e1>] snd_hdac_display_power+0xf1/0x110 [snd_hda_core]
         [<ffffffffa015039d>] azx_intel_link_power+0xd/0x10 [snd_hda_intel]
         [<ffffffffa011e32a>] azx_link_power+0x1a/0x30 [snd_hda_codec]
         [<ffffffffa00f21f9>] snd_hdac_link_power+0x29/0x40 [snd_hda_core]
         [<ffffffffa01192a6>] hda_codec_runtime_suspend+0x76/0xa0 [snd_hda_codec]
         .....
      
      The scenario is like below:
      - HD-audio driver and i915 driver are probed concurrently at the
        (almost) same time; HDA bus tries to bind with i915, but it fails
        because i915 initialization is still being processed.
      - Later on, HD-audio probes the HDMI codec, where it again tries to
        bind with i915.  At this time, it succeeds.
      - At finishing the probe of HDA, it decreases the refcount as if it
        were already bound at the bus probe, since the component is bound
        now.  This triggers a kernel WARNING due to the unbalance.
      
      As a workaround, in this patch, we just disable the on-demand i915
      component binding in the codec driver.  This essentially reverts back
      to the state of 4.4 kernel.
      
      We know that this is no real solution, but it's a minimalistic simple
      change that can be applied to 4.5.x kernel as stable.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94566Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.5
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7169701a
  21. 19 3月, 2016 2 次提交
  22. 18 3月, 2016 1 次提交
    • T
      ALSA: hda - Really restrict i915 notifier to HSW+ · 691be973
      Takashi Iwai 提交于
      The commit [b62232d4: ALSA: hda - Limit i915 HDMI binding only for
      HSW and later] tried to limit the usage of i915 audio notifier to the
      recent Intel models and switch to the old method on pre-Haswell
      models.  However, it assumed that the i915 component binding hasn't
      been done on such models, and the assumption was wrong: namely,
      Baytrail had already the i915 component binding due to powerwell
      control.  Thus, the workaround wasn't applied to Baytrail.
      
      For fixing this properly, this patch introduces a new flag indicating
      the usage of audio notifier and codec_has_acomp() refers to this flag
      instead of checking the existence of audio component.
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.5
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      691be973
  23. 17 3月, 2016 1 次提交
    • T
      ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug · 222bde03
      Takashi Iwai 提交于
      The recent change in HD-audio HDMI/DP codec driver for allowing the
      dynamic PCM binding introduced a new spec->pcm_mutex.  One of the
      protected area by this mutex is hdmi_present_sense().  As reported by
      Intel CI tests, unfortunately, the new mutex causes a deadlock when
      the hotplug/unplug is triggered during the codec is in runtime
      suspend.  The buggy code path is like the following:
      
        hdmi_unsol_event() -> ...
          -> hdmi_present_sense()
      ==>     ** here taking pcm_mutex
            -> hdmi_present_sense_via_verbs()
              -> snd_hda_power_up_pm() -> ... (runtime resume calls)
                -> generic_hdmi_resume()
                  -> hdmi_present_sense()
      ==>           ** here taking pcm_mutex again!
      
      As we can see here, the problem is that the mutex is taken before
      snd_hda_power_up_pm() call that triggers the runtime resume.  That is,
      the obvious solution is to move the power up/down call outside the
      mutex; it is exactly what this patch provides.
      
      The patch also clarifies why this bug wasn't caught beforehand.  We
      used to have the i915 audio component for hotplug for all Intel chips,
      and in that code path, there is no power up required but the
      information is taken directly from the graphics side.  However, we
      recently switched back to the old method for some old Intel chips due
      to regressions, and now the deadlock issue is surfaced.
      
      Fixes: a76056f2 ('ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug')
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      222bde03
  24. 16 3月, 2016 1 次提交
  25. 14 3月, 2016 2 次提交
  26. 10 3月, 2016 1 次提交
    • T
      ALSA: hda - Don't handle ELD notify from invalid port · 4f8e4f35
      Takashi Iwai 提交于
      The current Intel HDMI codec driver supports only three fixed ports
      from port B to port D.  However, i915 driver may assign a DP on other
      ports, e.g. port A, when no eDP is used.  This incompatibility is
      caught later at pin_nid_to_pin_index() and results in a warning
      message like "HDMI: pin nid 4 not registered" at each time.
      
      This patch filters out such invalid events beforehand, so that the
      kernel won't be too grumbling.
      Reported-by: NStefan Assmann <sassmann@kpanic.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4f8e4f35
  27. 07 3月, 2016 4 次提交