1. 04 Nov, 2020 14 commits
  2. 30 Oct, 2020 11 commits
  3. 29 Oct, 2020 13 commits
  4. 28 Oct, 2020 1 commit
    • Daniel Vetter's avatar
      drm/shme-helpers: Fix dma_buf_mmap forwarding bug · f49a51bf
      Daniel Vetter authored
      When we forward an mmap to the dma_buf exporter, they get to own
      everything. Unfortunately drm_gem_mmap_obj() overwrote
      vma->vm_private_data after the driver callback, wreaking the
      exporter complete. This was noticed because vb2_common_vm_close blew
      up on mali gpu with panfrost after commit 26d3ac3c
      ("drm/shmem-helpers: Redirect mmap for imported dma-buf").
      
      Unfortunately drm_gem_mmap_obj also acquires a surplus reference that
      we need to drop in shmem helpers, which is a bit of a mislayer
      situation. Maybe the entire dma_buf_mmap forwarding should be pulled
      into core gem code.
      
      Note that the only two other drivers which forward mmap in their own
      code (etnaviv and exynos) get this somewhat right by overwriting the
      gem mmap code. But they seem to still have the leak. This might be a
      good excuse to move these drivers over to shmem helpers completely.
      Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Cc: Russell King <linux+etnaviv@armlinux.org.uk>
      Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Joonyoung Shim <jy0922.shim@samsung.com>
      Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
      Cc: Kyungmin Park <kyungmin.park@samsung.com>
      Fixes: 26d3ac3c ("drm/shmem-helpers: Redirect mmap for imported dma-buf")
      Cc: Boris Brezillon <boris.brezillon@collabora.com>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-media@vger.kernel.org
      Cc: linaro-mm-sig@lists.linaro.org
      Cc: <stable@vger.kernel.org> # v5.9+
      Reported-and-tested-by: piotr.oniszczuk@gmail.com
      Cc: piotr.oniszczuk@gmail.com
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201027214922.3566743-1-daniel.vetter@ffwll.ch
      f49a51bf
  5. 27 Oct, 2020 1 commit
    • Maxime Ripard's avatar
      drm/vc4: hdmi: Avoid sleeping in atomic context · 58d04369
      Maxime Ripard authored
      When running the trigger hook, ALSA by default will take a spinlock, and
      thus will run the trigger hook in atomic context.
      
      However, our HDMI driver will send the infoframes as part of the trigger
      hook, and part of that process is to wait for a bit to be cleared for up to
      100ms. To be nicer to the system, that wait has some usleep_range that
      interact poorly with the atomic context.
      
      There's several ways we can fix this, but the more obvious one is to make
      ALSA take a mutex instead by setting the nonatomic flag on the DAI link.
      That doesn't work though, since now the cyclic callback installed by the
      dmaengine helpers in ALSA will take a mutex, while that callback is run by
      dmaengine's virt-chan code in a tasklet where sleeping is not allowed
      either.
      
      Given the delay we need to poll the bit for, changing the usleep_range for
      a udelay and keep running it from a context where interrupts are disabled
      is not really a good option either.
      
      However, we can move the infoframe setup code in the hw_params hook, like
      is usually done in other HDMI controllers, that isn't protected by a
      spinlock and thus where we can sleep. Infoframes will be sent on a regular
      basis anyway, and since hw_params is where the audio parameters that end up
      in the infoframes are setup, this also makes a bit more sense.
      
      Fixes: bb7d7856 ("drm/vc4: Add HDMI audio support")
      Suggested-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Reviewed-by: default avatarMark Brown <broonie@kernel.org>
      Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201027101558.427256-1-maxime@cerno.tech
      58d04369