1. 26 Jul, 2018 12 commits
  2. 24 Jul, 2018 1 commit
    • Takashi Iwai's avatar
      ALSA: hda/i915: Allow delayed i915 audio component binding · f9b54e19
      Takashi Iwai authored
      Currently HD-audio i915 audio binding doesn't support any delayed
      binding, and supposes that the i915 driver registers the component
      immediately.  This has been OK, so far, but the work-in-progress
      change in i915 may introduce the asynchronous binding, which
      effectively delays the component registration.
      
      For addressing it, implement a completion to be synced with the master
      binding.  The timeout is set to 10 seconds which should be long enough
      and hopefully be not too annoying if anyone boots up a debugging
      session with i915 KMS turned off.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f9b54e19
  3. 23 Jul, 2018 1 commit
  4. 22 Jul, 2018 1 commit
    • Srikanth K H's avatar
      ALSA: timer: catch invalid timer object creation · d10ee9c5
      Srikanth K H authored
      A timer object for the classes SNDRV_TIMER_CLASS_CARD and
      SNDRV_TIMER_CLASS_PCM has to be associated with a card object, but we
      have no check at creation time.  Such a timer object with NULL card
      causes various unexpected problems, e.g. NULL dereference at reading
      the sound timer proc file.
      
      So as preventive measure while the creating the sound timer object is
      created the card information availability is checked for the mentioned
      entries and returned error if its NULL.
      Signed-off-by: default avatarSrikanth K H <srikanth.h@samsung.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d10ee9c5
  5. 19 Jul, 2018 2 commits
  6. 18 Jul, 2018 3 commits
  7. 17 Jul, 2018 11 commits
    • Takashi Iwai's avatar
      ALSA: rawmidi: Minor code refactoring · f5beb598
      Takashi Iwai authored
      Unify a few open codes with helper functions to improve the
      readability.  Minor behavior changes (rather fixes) are:
      - runtime->drain clearance is done within lock
      - active_sensing is updated before resizing buffer in
        SNDRV_RAWMIDI_IOCTL_PARAMS ioctl.
      Other than that, simply code cleanups.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f5beb598
    • Takashi Iwai's avatar
      ALSA: rawmidi: Simplify error paths · 7fdc9b08
      Takashi Iwai authored
      Apply the standard idiom: rewrite the multiple unlocks in error paths
      in the goto-error-and-single-unlock way.
      
      Just a code refactoring, and no functional changes.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7fdc9b08
    • Takashi Iwai's avatar
      ALSA: rawmidi: Tidy up coding styles · 5bed9139
      Takashi Iwai authored
      Just minor coding style fixes like removal of superfluous white space,
      adding missing blank lines, etc.  No actual code changes at all.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5bed9139
    • Takashi Iwai's avatar
      Merge branch 'for-linus' into for-next · ed6b83d2
      Takashi Iwai authored
      Back-merge for further cleanup / improvements on rawmidi and HD-audio
      stuff.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ed6b83d2
    • Takashi Iwai's avatar
      ALSA: hda: Make audio component support more generic · a57942bf
      Takashi Iwai authored
      This is the final step for more generic support of DRM audio
      component.  The generic audio component code is now moved to its own
      file, and the symbols are renamed from snd_hac_i915_* to
      snd_hdac_acomp_*, respectively.  The generic code is enabled via the
      new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
      kept as the super-class.
      
      Along with the split, three new callbacks are added to audio_ops:
      pin2port is for providing the conversion between the pin number and
      the widget id, and master_bind/master_unbin are called at binding /
      unbinding the master component, respectively.  All these are optional,
      but used in i915 implementation and also other later implementations.
      
      A note about the new snd_hdac_acomp_init() function: there is a slight
      difference between this and the old snd_hdac_i915_init().  The latter
      (still) synchronizes with the master component binding, i.e. it
      assures that the relevant DRM component gets bound when it returns, or
      gives a negative error.  Meanwhile the new function doesn't
      synchronize but just leaves as is.  It's the responsibility by the
      caller's side to synchronize, or the caller may accept the
      asynchronous binding on the fly.
      
      v1->v2: Fix missing NULL check in master_bind/unbind
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a57942bf
    • Takashi Iwai's avatar
      ALSA: hda/i915: Associate audio component with devres · 82887c0b
      Takashi Iwai authored
      The HD-audio i915 binding code contains a single pointer, hdac_acomp,
      for allowing the access to audio component from the master bind/unbind
      callbacks.  This was needed because the callbacks pass only the device
      pointer and we can't guarantee the object type assigned to the drvdata
      (which is free for each controller driver implementation).
      And this implementation will be a problem if we support multiple
      components for different DRM drivers, not only i915.
      
      As a solution, allocate the audio component object via devres and
      associate it with the given device, so that the component callbacks
      can refer to it via devres_find().
      
      The removal of the object is still done half-manually via
      devres_destroy() to make the code consistent (although it may work
      without the explicit call).
      
      Also, the snd_hda_i915_register_notifier() had the reference to
      hdac_acomp as well.  In this patch, the corresponding code is removed
      by passing hdac_bus object to the function, too.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      82887c0b
    • Takashi Iwai's avatar
      drm/i915: Split audio component to a generic type · ae891abe
      Takashi Iwai authored
      For allowing other drivers to use the DRM audio component, rename the
      i915_audio_component_* with drm_audio_component_*, and split the
      generic part into drm_audio_component.h.  The i915 specific stuff
      remains in struct i915_audio_component, which contains
      drm_audio_component as the base.
      
      The license of drm_audio_component.h is kept to MIT as same as the the
      original i915_component.h.
      
      This is a preliminary change for further development, and no
      functional changes by this patch itself, merely code-split and
      renames.
      
      v1->v2: Use SPDX for drm_audio_component.h, fix remaining i915
              argument in drm_audio_component.h
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ae891abe
    • Takashi Iwai's avatar
      ALSA: rawmidi: Change resized buffers atomically · 39675f7a
      Takashi Iwai authored
      The SNDRV_RAWMIDI_IOCTL_PARAMS ioctl may resize the buffers and the
      current code is racy.  For example, the sequencer client may write to
      buffer while it being resized.
      
      As a simple workaround, let's switch to the resized buffer inside the
      stream runtime lock.
      
      Reported-by: syzbot+52f83f0ea8df16932f7f@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      39675f7a
    • Gustavo A. R. Silva's avatar
      ALSA: emu8000: Use swap macro in snd_emu8000_sample_new · 7373c2a9
      Gustavo A. R. Silva authored
      Make use of the swap macro and remove unnecessary variable *tmp*. This
      makes the code easier to read and maintain.
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7373c2a9
    • Gustavo A. R. Silva's avatar
      ALSA: emu10k1_patch: Use swap macro in snd_emu10k1_sample_new · e2d2f240
      Gustavo A. R. Silva authored
      Make use of the swap macro and remove unnecessary variable *tmp*. This
      makes the code easier to read and maintain.
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e2d2f240
    • Jim Qu's avatar
      vga_switcheroo: set audio client id according to bound GPU id · 4aaf448f
      Jim Qu authored
      On modern laptop, there are more and more platforms
      have two GPUs, and each of them maybe have audio codec
      for HDMP/DP output. For some dGPU which is no output,
      audio codec usually is disabled.
      
      In currect HDA audio driver, it will set all codec as
      VGA_SWITCHEROO_DIS, the audio which is binded to UMA
      will be suspended if user use debugfs to contorl power
      
      In HDA driver side, it is difficult to know which GPU
      the audio has binded to. So set the bound gpu pci dev
      to vga_switcheroo.
      
      if the audio client is not the third registration, audio
      id will set in vga_switcheroo enable function. if the
      audio client is the last registration when vga_switcheroo
      _ready() get true, we should get audio client id from bound
      GPU directly.
      Signed-off-by: default avatarJim Qu <Jim.Qu@amd.com>
      Reviewed-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4aaf448f
  8. 16 Jul, 2018 9 commits