08 Dec, 2018

1 commit

  • commit c288248f5b26cd5563112fcdc077bf44964a942d upstream.

    hdmi_lpe_audio_probe() copies the pcm name string via strncpy(), but
    as a gcc8 warning suggests, it misses a NUL terminator, and unlikely
    the expected result.

    Use the proper one, strlcpy() instead.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

09 Mar, 2018

1 commit

  • commit 350144069abf351c743d766b2fba9cb9b7cd32a1 upstream.

    The commit change for supporting the multiple ports moved involved
    some code shuffling, and there the initializations of spinlock and
    mutex in snd_intelhad object were dropped mistakenly.

    This patch adds the missing initializations again for each port.

    Fixes: b4eb0d522fcb ("ALSA: x86: Split snd_intelhad into card and PCM specific structures")
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

10 Jul, 2017

1 commit

  • Pull drm updates from Dave Airlie:
    "This is the main pull request for the drm, I think I've got one later
    driver pull for mediatek SoC driver, I'm undecided on if it needs to
    go to you yet.

    Otherwise summary below:

    Core drm:
    - Atomic add driver private objects
    - Deprecate preclose hook in modern drivers
    - MST bandwidth tracking
    - Use kvmalloc in more places
    - Add mode_valid hook for crtc/encoder/bridge
    - Reduce sync_file construction time
    - Documentation updates
    - New DRM synchronisation object support

    New drivers:
    - pl111 - pl111 CLCD display controller

    Panel:
    - Innolux P079ZCA panel driver
    - Add NL12880B20-05, NL192108AC18-02D, P320HVN03 panels
    - panel-samsung-s6e3ha2: Add s6e3hf2 panel support

    i915:
    - SKL+ watermark fixes
    - G4x/G33 reset improvements
    - DP AUX backlight improvements
    - Buffer based GuC/host communication
    - New getparam for (sub)slice infomation
    - Cannonlake and Coffeelake initial patches
    - Execbuf optimisations

    radeon/amdgpu:
    - Lots of Vega10 bug fixes
    - Preliminary raven support
    - KIQ support for compute rings
    - MEC queue management rework
    - DCE6 Audio support
    - SR-IOV improvements
    - Better radeon/amdgpu selection support

    nouveau:
    - HDMI stereoscopic support
    - Display code rework for >= GM20x GPUs

    msm:
    - GEM rework for fine-grained locking
    - Per-process pagetable work
    - HDMI fixes for Snapdragon 820.

    vc4:
    - Remove 256MB CMA limit from vc4
    - Add out-fence support
    - Add support for cygnus
    - Get/set tiling ioctls support
    - Add T-format tiling support for scanout

    zte:
    - add VGA support.

    etnaviv:
    - Thermal throttle support for newer GPUs
    - Restore userspace buffer cache performance
    - dma-buf sync fix

    stm:
    - add stm32f429 display support

    exynos:
    - Rework vblank handling
    - Fixup sw-trigger code

    sun4i:
    - V3s display engine support
    - HDMI support for older SoCs
    - Preliminary work on dual-pipeline SoCs.

    rcar-du:
    - VSP work

    imx-drm:
    - Remove counter load enable from PRE
    - Double read/write reduction flag support

    tegra:
    - Documentation for the host1x and drm driver.
    - Lots of staging ioctl fixes due to grate project work.

    omapdrm:
    - dma-buf fence support
    - TILER rotation fixes"

    * tag 'drm-for-v4.13' of git://people.freedesktop.org/~airlied/linux: (1270 commits)
    drm: Remove unused drm_file parameter to drm_syncobj_replace_fence()
    drm/amd/powerplay: fix bug fail to remove sysfs when rmmod amdgpu.
    amdgpu: Set cik/si_support to 1 by default if radeon isn't built
    drm/amdgpu/gfx9: fix driver reload with KIQ
    drm/amdgpu/gfx8: fix driver reload with KIQ
    drm/amdgpu: Don't call amd_powerplay_destroy() if we don't have powerplay
    drm/ttm: Fix use-after-free in ttm_bo_clean_mm
    drm/amd/amdgpu: move get memory type function from early init to sw init
    drm/amdgpu/cgs: always set reference clock in mode_info
    drm/amdgpu: fix vblank_time when displays are off
    drm/amd/powerplay: power value format change for Vega10
    drm/amdgpu/gfx9: support the amdgpu.disable_cu option
    drm/amd/powerplay: change PPSMC_MSG_GetCurrPkgPwr for Vega10
    drm/amdgpu: Make amdgpu_cs_parser_init static (v2)
    drm/amdgpu/cs: fix a typo in a comment
    drm/amdgpu: Fix the exported always on CU bitmap
    drm/amdgpu/gfx9: gfx_v9_0_enable_gfx_static_mg_power_gating() can be static
    drm/amdgpu/psp: upper_32_bits/lower_32_bits for address setup
    drm/amd/powerplay/cz: print message if smc message fails
    drm/amdgpu: fix typo in amdgpu_debugfs_test_ib_init
    ...

    Linus Torvalds
     

01 Jul, 2017

1 commit

  • platform_get_irq() returns an error code, but the intel_hdmi_audio
    driver ignores it and always returns -ENODEV. This is not correct,
    and prevents -EPROBE_DEFER from being propagated properly. Also,
    notice that platform_get_irq() no longer returns 0 on error.

    Print error message and propagate the return value of platform_get_irq
    on failure.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Takashi Iwai

    Gustavo A. R. Silva
     

30 May, 2017

1 commit

  • More stuff for 4.13:

    - skl+ wm fixes from Mahesh Kumar
    - some refactor and tests for i915_sw_fence (Chris)
    - tune execlist/scheduler code (Chris)
    - g4x,g33 gpu reset improvements (Chris, Mika)
    - guc code cleanup (Michal Wajdeczko, Michał Winiarski)
    - dp aux backlight improvements (Puthikorn Voravootivat)
    - buffer based guc/host communication (Michal Wajdeczko)

    * tag 'drm-intel-next-2017-05-29' of git://anongit.freedesktop.org/git/drm-intel: (253 commits)
    drm/i915: Update DRIVER_DATE to 20170529
    drm/i915: Keep the forcewake timer alive for 1ms past the most recent use
    drm/i915/guc: capture GuC logs if FW fails to load
    drm/i915/guc: Introduce buffer based cmd transport
    drm/i915/guc: Disable send function on fini
    drm: Add definition for eDP backlight frequency
    drm/i915: Drop AUX backlight enable check for backlight control
    drm/i915: Consolidate #ifdef CONFIG_INTEL_IOMMU
    drm/i915: Only GGTT vma may be pinned and prevent shrinking
    drm/i915: Serialize GTT/Aperture accesses on BXT
    drm/i915: Convert i915_gem_object_ops->flags values to use BIT()
    drm/i915/selftests: Silence compiler warning in igt_ctx_exec
    drm/i915/guc: Skip port assign on first iteration of GuC dequeue
    drm/i915: Remove misleading comment in request_alloc
    drm/i915/g33: Improve reset reliability
    Revert "drm/i915: Restore lost "Initialized i915" welcome message"
    drm/i915/huc: Update GLK HuC version
    drm/i915: Check for allocation failure
    drm/i915/guc: Remove action status and statistics from debugfs
    drm/i915/g4x: Improve gpu reset reliability
    ...

    Dave Airlie
     

15 May, 2017

1 commit

  • Not calling pm_runtime_enable() means that runtime PM can't be
    enabled at all via sysfs. So we definitely need to call it
    from somewhere.

    Calling it from the driver seems like a bad idea because it
    would have to be paired with a pm_runtime_disable() at driver
    unload time, otherwise the core gets upset. Also if there's
    no LPE audio driver loaded then we couldn't runtime suspend
    i915 either.

    So it looks like a better plan is to call it from i915 when
    we register the platform device. That seems to match how
    pci generally does things. I cargo culted the
    pm_runtime_forbid() and pm_runtime_set_active() calls from
    pci as well.

    The exposed runtime PM API is massive an thorougly misleading, so
    I don't actually know if this is how you're supposed to use the API
    or not. But it seems to work. I can now runtime suspend i915 again
    with or without the LPE audio driver loaded, and reloading the
    LPE audio driver also seems to work.

    Note that powertop won't auto-tune runtime PM for platform devices,
    which is a little annoying. So I'm not sure that leaving runtime
    PM in "on" mode by default is the best choice here. But I've left
    it like that for now at least.

    Also remove the comment about there not being much benefit from
    LPE audio runtime PM. Not allowing runtime PM blocks i915 runtime
    PM, which will also block s0ix, and that could have a measurable
    impact on power consumption.

    Cc: stable@vger.kernel.org
    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Fixes: 0b6b524f3915 ("ALSA: x86: Don't enable runtime PM as default")
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-2-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai
    (cherry picked from commit 183c00350ccda86781f6695840e6c5f5b22efbd1)
    Signed-off-by: Jani Nikula

    Ville Syrjälä
     

09 May, 2017

1 commit

  • set_memory_* functions have moved to set_memory.h. Switch to this
    explicitly.

    Link: http://lkml.kernel.org/r/1488920133-27229-14-git-send-email-labbott@redhat.com
    Signed-off-by: Laura Abbott
    Acked-by: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Laura Abbott
     

03 May, 2017

9 commits

  • Now that everything is in place let's register a PCM device for
    each port of the display engine. This will make it possible to
    actually output audio to multiple displays at the same time. And
    it avoids modesets on unrelated displays from clobbering up the
    ELD and whatnot for the display currently doing the playback.

    v2: Add a PCM per port instead of per pipe
    v3: Fix off by one error with port numbers (Pierre-Louis)
    Fix .notify_audio_lpe() prototype (Pierre-Louis)

    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-12-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     
  • To allow multiple PCM devices to be registered for the LPE audio card,
    split the private data into card and PCM specific chunks. For now we'll
    stick to just one PCM device as before.

    v2: Rework to do a pcm device per port instead of per pipe

    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-11-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     
  • In preparation for register a PCM device for each pipe adjust
    link up the ctl elements with the corresponding PCM device.

    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-10-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     
  • Split the LPE audio platform data into a port specific
    chunk and device specific chunk. Eventually we'll have
    a port specific chunk for each port, but for now we'll
    stick to just one.

    We'll also get rid of the intel_hdmi_lpe_audio_eld structure
    which doesn't seem to have any real reason to exist.

    v2: Organize per port instead of per pipe

    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-9-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     
  • We can determine that the pipe was shut down from pipe
    Cc: Pierre-Louis Bossart
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-7-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     
  • There's no need to distinguish between the DP link rate and HDMI TMDS
    clock for the purposes of the LPE audio. Both are actually the same
    thing more or less, which is the link symbol clock. So let's just
    call the thing ls_clock and simplify the code.

    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-6-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     
  • The pending_notify flag in the LPE audio platform data is pointless,
    actually unused. So let's kill it off.

    v2: Fix typo in patch subject

    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-5-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     
  • Clear the notify function pointer in the platform data before we tear
    down the driver. Otherwise i915 would end up calling a stale function
    pointer and possibly explode.

    Cc: stable@vger.kernel.org
    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-3-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     
  • Not calling pm_runtime_enable() means that runtime PM can't be
    enabled at all via sysfs. So we definitely need to call it
    from somewhere.

    Calling it from the driver seems like a bad idea because it
    would have to be paired with a pm_runtime_disable() at driver
    unload time, otherwise the core gets upset. Also if there's
    no LPE audio driver loaded then we couldn't runtime suspend
    i915 either.

    So it looks like a better plan is to call it from i915 when
    we register the platform device. That seems to match how
    pci generally does things. I cargo culted the
    pm_runtime_forbid() and pm_runtime_set_active() calls from
    pci as well.

    The exposed runtime PM API is massive an thorougly misleading, so
    I don't actually know if this is how you're supposed to use the API
    or not. But it seems to work. I can now runtime suspend i915 again
    with or without the LPE audio driver loaded, and reloading the
    LPE audio driver also seems to work.

    Note that powertop won't auto-tune runtime PM for platform devices,
    which is a little annoying. So I'm not sure that leaving runtime
    PM in "on" mode by default is the best choice here. But I've left
    it like that for now at least.

    Also remove the comment about there not being much benefit from
    LPE audio runtime PM. Not allowing runtime PM blocks i915 runtime
    PM, which will also block s0ix, and that could have a measurable
    impact on power consumption.

    Cc: stable@vger.kernel.org
    Cc: Takashi Iwai
    Cc: Pierre-Louis Bossart
    Fixes: 0b6b524f3915 ("ALSA: x86: Don't enable runtime PM as default")
    Signed-off-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-2-ville.syrjala@linux.intel.com
    Reviewed-by: Takashi Iwai

    Ville Syrjälä
     

21 Mar, 2017

1 commit

  • CONFIG_SND_X86 is a menu config to filter only for x86-specific
    drivers in its sub-menu, and this doesn't have to be tristate but
    rather it should be a bool. Also, like other sub-menu configs, it's
    more user-friendly to be default=y; it's merely a menu config and the
    actual drivers are configured in the sub-menu, after all.

    Fixes: 287599cf2d77 ("ALSA: add Intel HDMI LPE audio driver for BYT/CHT-T")
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

22 Feb, 2017

3 commits

  • The newly added driver uses the PCM helpers and fails to link if they are disabled:

    sound/built-in.o: In function `hdmi_lpe_audio_runtime_suspend':
    intel_hdmi_audio.c:(.text+0x15906): undefined reference to `snd_pcm_suspend'
    sound/built-in.o: In function `had_pcm_hw_params':
    intel_hdmi_audio.c:(.text+0x15ac7): undefined reference to `snd_pcm_lib_malloc_pages'
    sound/built-in.o: In function `had_pcm_open':
    intel_hdmi_audio.c:(.text+0x15d49): undefined reference to `snd_pcm_hw_constraint_integer'

    This uses a Kconfig 'select' statement to make sure they are enabled.

    Fixes: 5dab11d89777 ("ALSA: x86: hdmi: Add audio support for BYT and CHT")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     
  • Unlike HSW and newer, BYT/CHT devices have no fine control of audio
    power domain in i915 side. Since there is little gain by runtime PM
    on BYT/CHT, so far, this commit removes the pm_runtime_enable() call
    as default.

    User who still wants the runtime PM may adjust the corresponding
    sysfs files (power/control and power/autosuspend_delay_ms)
    appropriately, of course.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • This patch adds a few lines to the driver to use autosuspend for the
    runtime PM. It'll become useful with the combination of the keep-link
    feature.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

16 Feb, 2017

8 commits


13 Feb, 2017

2 commits

  • The pcm_stream_info.running field is only set in the PCM trigger
    callback but never referred, thus it can be safely removed.

    Also, properly cover the spinlock in both the trigger START and STOP
    to protect had_enable_audio() calls.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Currently the driver handles some reset procedure at the trigger STOP
    and the underrun functions, where both are executed in the interrupt
    context. Especially the underrun function has a sync-loop to clear
    the UNDERRUN status bit, and this is supposed to be one of plausible
    causes of GPU hangup.

    Since the job to be done in the interrupt handler should be minimum,
    we move the reset function out of trigger and underrun, and push it
    into the prepare (and hw_free) callbacks instead. Here a new flag,
    need_reset, is introduced to indicate the requirement of the reset
    procedure. This is for avoiding the multiple resets when PCM prepare
    is called sequentially.

    Also in the UNDERRUN bit-clear sync loop, take a longer pause to be in
    the safer side. Taking a longer delay is no longer a problem now
    because we're running in the normal context.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

10 Feb, 2017

5 commits

  • Now we support S16 PCM format in addition. For this, we need to set
    packet_mode=1 in AUD_CONFIG register.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The hardware has the support for the left-aligned 24bit format in
    32bit packet. This corresponds to S32 format in ALSA. We need to set
    the msbits restriction as well to inform user-space that only MSB
    24bit are available.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • In the current implementation, the driver may update the BDs even at
    PCM pointer callback. This allows us to skip the period interrupt
    effectively.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • This is an implementation of PCM streaming with only 1 period.
    Since the hardware requires the refresh of BDs after each BD
    processing finishes, we'd need at least two BDs. The trick is that
    both BDs point to the same content: the address of the PCM buffer
    head, and the whole buffer size. Then it loops over to the whole
    buffer again after it finished once.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The PCM engine on LPE audio isn't like a batch-style process any
    longer, but rather it deals with the standard ring buffer. Remove the
    BATCH info flag so that PA can handle the buffer in timer-sched mode.

    Similarly, the DOUBLE flag is also superfluous. Drop both bits.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

07 Feb, 2017

5 commits

  • At enabling the audio, we modify AUD_CONFIG register bit 0. So far,
    it does read-modify-write procedure with a special hack for the
    channel bits due to the silicon bug. But we can optimize it by
    remembering the AUD_CONFIG register value privately. This simplifies
    the things a lot.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • We have two header files and everything is mixed up chaotically.
    Move the chip-specific definitions like the hardware registers to
    intel_hdmi_lpe_audio.h, and the rest, the implementation specific
    stuff into intel_hdmi_audio.h.

    In addition, put some more comments to the register fields, and fix
    the incorrect name prefix for AUD_HDMI_STATUS bits, too.

    The whole changes are merely a code shuffling, and there is no
    functional change.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The two functions are unused when CONFIG_PM_SLEEP is disabled:

    sound/x86/intel_hdmi_audio.c:1633:12: error: 'hdmi_lpe_audio_resume' defined but not used [-Werror=unused-function]
    sound/x86/intel_hdmi_audio.c:1622:12: error: 'hdmi_lpe_audio_suspend' defined but not used [-Werror=unused-function]

    Marking them as __maybe_unused avoids the warning without introducing an
    ugly #ifdef.

    Fixes: 182cdf23dbf6 ("ALSA: x86: Implement runtime PM")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     
  • The driver sets card->driver name string over its size (16 bytes).
    Shorten the name string to fit with it.

    Also, set more verbose string to card->shortname and ->longname.
    This doesn't have to be identical with card->driver at all.

    Reported-by: Dan Carpenter
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • had_enable_audio_int() came from the LPE audio shell set_caps
    callback with ENABLE_INT and DISABLE_INT caps. I interpreted as these
    correspond to enabling / disabling the audio interface, but the actual
    implementation is only to clear (send ACK) to both BUFFER_DONE and
    BUFFER_UNDERRUN interrupts unconditionally. And, there is no
    counterpart, DISABLE_INT, code at all.

    For avoiding the further misunderstanding, rename the function to the
    more fitting one, had_ack_irqs(), and drop the calls with enable=false
    in allover places. There is no functional changes at all.

    After this patch, there is only one caller at the PCM trigger start.
    Then it's doubtful whether this call is still really needed or not; I
    bet it not, but let's stay in the safer side for now and keep it as
    was.

    Signed-off-by: Takashi Iwai

    Takashi Iwai