1. 22 Nov, 2020 6 commits
    • Gustavo A. R. Silva's avatar
      drm: Fix fall-through warnings for Clang · 8ce9daf8
      Gustavo A. R. Silva authored
      In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
      by explicitly adding a break statement instead of letting the code fall
      through to the next case.
      
      Link: https://github.com/KSPP/linux/issues/115Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/111e9d3d55c686892357aa5269022024b4d48330.1605896059.git.gustavoars@kernel.org
      8ce9daf8
    • John Stultz's avatar
      dma-buf: system_heap: Allocate higher order pages if available · d963ab0f
      John Stultz authored
      While the system heap can return non-contiguous pages,
      try to allocate larger order pages if possible.
      
      This will allow slight performance gains and make implementing
      page pooling easier.
      
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Liam Mark <lmark@codeaurora.org>
      Cc: Laura Abbott <labbott@kernel.org>
      Cc: Brian Starkey <Brian.Starkey@arm.com>
      Cc: Hridya Valsaraju <hridya@google.com>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: Sandeep Patil <sspatil@google.com>
      Cc: Daniel Mentz <danielmentz@google.com>
      Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
      Cc: Ørjan Eide <orjan.eide@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Ezequiel Garcia <ezequiel@collabora.com>
      Cc: Simon Ser <contact@emersion.fr>
      Cc: James Jones <jajones@nvidia.com>
      Cc: linux-media@vger.kernel.org
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: default avatarBrian Starkey <brian.starkey@arm.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201121235002.69945-6-john.stultz@linaro.org
      d963ab0f
    • John Stultz's avatar
      dma-buf: heaps: Skip sync if not mapped · 4c68e499
      John Stultz authored
      This patch is basically a port of Ørjan Eide's similar patch for ION
       https://lore.kernel.org/lkml/20200414134629.54567-1-orjan.eide@arm.com/
      
      Only sync the sg-list of dma-buf heap attachment when the attachment
      is actually mapped on the device.
      
      dma-bufs may be synced at any time. It can be reached from user space
      via DMA_BUF_IOCTL_SYNC, so there are no guarantees from callers on when
      syncs may be attempted, and dma_buf_end_cpu_access() and
      dma_buf_begin_cpu_access() may not be paired.
      
      Since the sg_list's dma_address isn't set up until the buffer is used
      on the device, and dma_map_sg() is called on it, the dma_address will be
      NULL if sync is attempted on the dma-buf before it's mapped on a device.
      
      Before v5.0 (commit 55897af6 ("dma-direct: merge swiotlb_dma_ops
      into the dma_direct code")) this was a problem as the dma-api (at least
      the swiotlb_dma_ops on arm64) would use the potentially invalid
      dma_address. How that failed depended on how the device handled physical
      address 0. If 0 was a valid address to physical ram, that page would get
      flushed a lot, while the actual pages in the buffer would not get synced
      correctly. While if 0 is an invalid physical address it may cause a
      fault and trigger a crash.
      
      In v5.0 this was incidentally fixed by commit 55897af6 ("dma-direct:
      merge swiotlb_dma_ops into the dma_direct code"), as this moved the
      dma-api to use the page pointer in the sg_list, and (for Ion buffers at
      least) this will always be valid if the sg_list exists at all.
      
      But, this issue is re-introduced in v5.3 with
      commit 449fa54d ("dma-direct: correct the physical addr in
      dma_direct_sync_sg_for_cpu/device") moves the dma-api back to the old
      behaviour and picks the dma_address that may be invalid.
      
      dma-buf core doesn't ensure that the buffer is mapped on the device, and
      thus have a valid sg_list, before calling the exporter's
      begin_cpu_access.
      
      Logic and commit message originally by: Ørjan Eide <orjan.eide@arm.com>
      
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Liam Mark <lmark@codeaurora.org>
      Cc: Laura Abbott <labbott@kernel.org>
      Cc: Brian Starkey <Brian.Starkey@arm.com>
      Cc: Hridya Valsaraju <hridya@google.com>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: Sandeep Patil <sspatil@google.com>
      Cc: Daniel Mentz <danielmentz@google.com>
      Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
      Cc: Ørjan Eide <orjan.eide@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Ezequiel Garcia <ezequiel@collabora.com>
      Cc: Simon Ser <contact@emersion.fr>
      Cc: James Jones <jajones@nvidia.com>
      Cc: linux-media@vger.kernel.org
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: default avatarBrian Starkey <brian.starkey@arm.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201121235002.69945-5-john.stultz@linaro.org
      4c68e499
    • John Stultz's avatar
      dma-buf: heaps: Remove heap-helpers code · 064fae53
      John Stultz authored
      The heap-helpers code was not as generic as initially hoped
      and it is now not being used, so remove it from the tree.
      
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Liam Mark <lmark@codeaurora.org>
      Cc: Laura Abbott <labbott@kernel.org>
      Cc: Brian Starkey <Brian.Starkey@arm.com>
      Cc: Hridya Valsaraju <hridya@google.com>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: Sandeep Patil <sspatil@google.com>
      Cc: Daniel Mentz <danielmentz@google.com>
      Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
      Cc: Ørjan Eide <orjan.eide@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Ezequiel Garcia <ezequiel@collabora.com>
      Cc: Simon Ser <contact@emersion.fr>
      Cc: James Jones <jajones@nvidia.com>
      Cc: linux-media@vger.kernel.org
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: default avatarBrian Starkey <brian.starkey@arm.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201121235002.69945-4-john.stultz@linaro.org
      064fae53
    • John Stultz's avatar
      dma-buf: heaps: Move heap-helper logic into the cma_heap implementation · a5d2d29e
      John Stultz authored
      Since the heap-helpers logic ended up not being as generic as
      hoped, move the heap-helpers dma_buf_ops implementations into
      the cma_heap directly.
      
      This will allow us to remove the heap_helpers code in a following
      patch.
      
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Liam Mark <lmark@codeaurora.org>
      Cc: Laura Abbott <labbott@kernel.org>
      Cc: Brian Starkey <Brian.Starkey@arm.com>
      Cc: Hridya Valsaraju <hridya@google.com>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: Sandeep Patil <sspatil@google.com>
      Cc: Daniel Mentz <danielmentz@google.com>
      Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
      Cc: Ørjan Eide <orjan.eide@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Ezequiel Garcia <ezequiel@collabora.com>
      Cc: Simon Ser <contact@emersion.fr>
      Cc: James Jones <jajones@nvidia.com>
      Cc: linux-media@vger.kernel.org
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: default avatarBrian Starkey <brian.starkey@arm.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201121235002.69945-3-john.stultz@linaro.org
      a5d2d29e
    • John Stultz's avatar
      dma-buf: system_heap: Rework system heap to use sgtables instead of pagelists · 38129575
      John Stultz authored
      In preparation for some patches to optmize the system
      heap code, rework the dmabuf exporter to utilize sgtables rather
      then pageslists for tracking the associated pages.
      
      This will allow for large order page allocations, as well as
      more efficient page pooling.
      
      In doing so, the system heap stops using the heap-helpers logic
      which sadly is not quite as generic as I was hoping it to be, so
      this patch adds heap specific implementations of the dma_buf_ops
      function handlers.
      
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Liam Mark <lmark@codeaurora.org>
      Cc: Laura Abbott <labbott@kernel.org>
      Cc: Brian Starkey <Brian.Starkey@arm.com>
      Cc: Hridya Valsaraju <hridya@google.com>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: Sandeep Patil <sspatil@google.com>
      Cc: Daniel Mentz <danielmentz@google.com>
      Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
      Cc: Ørjan Eide <orjan.eide@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Ezequiel Garcia <ezequiel@collabora.com>
      Cc: Simon Ser <contact@emersion.fr>
      Cc: James Jones <jajones@nvidia.com>
      Cc: linux-media@vger.kernel.org
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: default avatarBrian Starkey <brian.starkey@arm.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201121235002.69945-2-john.stultz@linaro.org
      38129575
  2. 20 Nov, 2020 14 commits
  3. 19 Nov, 2020 3 commits
  4. 18 Nov, 2020 11 commits
  5. 17 Nov, 2020 6 commits
    • Lee Jones's avatar
      drm/v3d/v3d_gem: Provide descriptions for 'v3d_lookup_bos's params · e226878e
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/v3d/v3d_gem.c:292: warning: Function parameter or member 'bo_handles' not described in 'v3d_lookup_bos'
       drivers/gpu/drm/v3d/v3d_gem.c:292: warning: Function parameter or member 'bo_count' not described in 'v3d_lookup_bos'
      
      Cc: Eric Anholt <eric@anholt.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-media@vger.kernel.org
      Cc: linaro-mm-sig@lists.linaro.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201116174112.1833368-36-lee.jones@linaro.org
      e226878e
    • Lee Jones's avatar
      drm/v3d/v3d_drv: Remove unused static variable 'v3d_v3d_pm_ops' · 8b6864e3
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/v3d/v3d_drv.c:73:32: warning: ‘v3d_v3d_pm_ops’ defined but not used [-Wunused-const-variable=]
      
      Cc: Eric Anholt <eric@anholt.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201116174112.1833368-35-lee.jones@linaro.org
      8b6864e3
    • Lee Jones's avatar
      drm/ttm/ttm_tt: Demote kernel-doc header format abuses · 78616b88
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/ttm/ttm_tt.c:45: warning: Function parameter or member 'bo' not described in 'ttm_tt_create'
       drivers/gpu/drm/ttm/ttm_tt.c:45: warning: Function parameter or member 'zero_alloc' not described in 'ttm_tt_create'
       drivers/gpu/drm/ttm/ttm_tt.c:83: warning: Function parameter or member 'ttm' not described in 'ttm_tt_alloc_page_directory'
      
      Cc: Christian Koenig <christian.koenig@amd.com>
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201116174112.1833368-33-lee.jones@linaro.org
      78616b88
    • Lee Jones's avatar
      drm/ttm/ttm_range_manager: Demote non-conformant kernel-doc header · 0aa1e107
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/ttm/ttm_range_manager.c:46: warning: cannot understand function prototype: 'struct ttm_range_manager '
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Cc: Christian Koenig <christian.koenig@amd.com>
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201116174112.1833368-34-lee.jones@linaro.org
      0aa1e107
    • Lee Jones's avatar
      drm/ttm/ttm_bo: Fix one function header - demote lots of kernel-doc abuses · 108cfddf
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/ttm/ttm_bo.c:51: warning: Function parameter or member 'ttm_global_mutex' not described in 'DEFINE_MUTEX'
       drivers/gpu/drm/ttm/ttm_bo.c:286: warning: Function parameter or member 'bo' not described in 'ttm_bo_cleanup_memtype_use'
       drivers/gpu/drm/ttm/ttm_bo.c:359: warning: Function parameter or member 'bo' not described in 'ttm_bo_cleanup_refs'
       drivers/gpu/drm/ttm/ttm_bo.c:359: warning: Function parameter or member 'interruptible' not described in 'ttm_bo_cleanup_refs'
       drivers/gpu/drm/ttm/ttm_bo.c:359: warning: Function parameter or member 'no_wait_gpu' not described in 'ttm_bo_cleanup_refs'
       drivers/gpu/drm/ttm/ttm_bo.c:359: warning: Function parameter or member 'unlock_resv' not described in 'ttm_bo_cleanup_refs'
       drivers/gpu/drm/ttm/ttm_bo.c:424: warning: Function parameter or member 'bdev' not described in 'ttm_bo_delayed_delete'
       drivers/gpu/drm/ttm/ttm_bo.c:424: warning: Function parameter or member 'remove_all' not described in 'ttm_bo_delayed_delete'
       drivers/gpu/drm/ttm/ttm_bo.c:635: warning: Function parameter or member 'bo' not described in 'ttm_bo_evict_swapout_allowable'
       drivers/gpu/drm/ttm/ttm_bo.c:635: warning: Function parameter or member 'ctx' not described in 'ttm_bo_evict_swapout_allowable'
       drivers/gpu/drm/ttm/ttm_bo.c:635: warning: Function parameter or member 'locked' not described in 'ttm_bo_evict_swapout_allowable'
       drivers/gpu/drm/ttm/ttm_bo.c:635: warning: Function parameter or member 'busy' not described in 'ttm_bo_evict_swapout_allowable'
       drivers/gpu/drm/ttm/ttm_bo.c:769: warning: Function parameter or member 'bo' not described in 'ttm_bo_add_move_fence'
       drivers/gpu/drm/ttm/ttm_bo.c:769: warning: Function parameter or member 'man' not described in 'ttm_bo_add_move_fence'
       drivers/gpu/drm/ttm/ttm_bo.c:769: warning: Function parameter or member 'mem' not described in 'ttm_bo_add_move_fence'
       drivers/gpu/drm/ttm/ttm_bo.c:769: warning: Function parameter or member 'no_wait_gpu' not described in 'ttm_bo_add_move_fence'
       drivers/gpu/drm/ttm/ttm_bo.c:806: warning: Function parameter or member 'bo' not described in 'ttm_bo_mem_force_space'
       drivers/gpu/drm/ttm/ttm_bo.c:806: warning: Function parameter or member 'place' not described in 'ttm_bo_mem_force_space'
       drivers/gpu/drm/ttm/ttm_bo.c:806: warning: Function parameter or member 'mem' not described in 'ttm_bo_mem_force_space'
       drivers/gpu/drm/ttm/ttm_bo.c:806: warning: Function parameter or member 'ctx' not described in 'ttm_bo_mem_force_space'
       drivers/gpu/drm/ttm/ttm_bo.c:872: warning: Function parameter or member 'bo' not described in 'ttm_bo_mem_space'
       drivers/gpu/drm/ttm/ttm_bo.c:872: warning: Function parameter or member 'placement' not described in 'ttm_bo_mem_space'
       drivers/gpu/drm/ttm/ttm_bo.c:872: warning: Function parameter or member 'mem' not described in 'ttm_bo_mem_space'
       drivers/gpu/drm/ttm/ttm_bo.c:872: warning: Function parameter or member 'ctx' not described in 'ttm_bo_mem_space'
       drivers/gpu/drm/ttm/ttm_bo.c:1387: warning: Function parameter or member 'ctx' not described in 'ttm_bo_swapout'
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Cc: Christian Koenig <christian.koenig@amd.com>
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-media@vger.kernel.org
      Cc: linaro-mm-sig@lists.linaro.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201116174112.1833368-32-lee.jones@linaro.org
      108cfddf
    • Lee Jones's avatar
      drm/selftests/test-drm_dp_mst_helper: Move 'sideband_msg_req_encode_decode' onto the heap · 09234b88
      Lee Jones authored
      There is too much data being stored on the stack.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c: In function ‘sideband_msg_req_encode_decode’:
       drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c:168:1: warning: the frame size of 1072 bytes is larger than 1024 bytes [-Wframe-larger-than=]
      
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201116174112.1833368-31-lee.jones@linaro.org
      09234b88