Merge drm/drm-next into drm-misc-next
authorMaxime Ripard <maxime@cerno.tech>
Tue, 5 Apr 2022 09:06:58 +0000 (11:06 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Tue, 5 Apr 2022 09:06:58 +0000 (11:06 +0200)
Let's start the 5.19 development cycle.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
35 files changed:
1  2 
MAINTAINERS
arch/x86/Kconfig
drivers/dma-buf/dma-buf.c
drivers/firmware/Kconfig
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
drivers/gpu/drm/bridge/Kconfig
drivers/gpu/drm/bridge/nwl-dsi.c
drivers/gpu/drm/bridge/ti-sn65dsi86.c
drivers/gpu/drm/drm_atomic_uapi.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/drm_gem_vram_helper.c
drivers/gpu/drm/exynos/exynos_drm_dsi.c
drivers/gpu/drm/i915/gem/i915_gem_ttm.c
drivers/gpu/drm/mediatek/mtk_dsi.c
drivers/gpu/drm/meson/meson_drv.c
drivers/gpu/drm/solomon/ssd130x.c
drivers/gpu/drm/tiny/repaper.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/ttm/ttm_resource.c
drivers/gpu/drm/ttm/ttm_tt.c
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hdmi.h
drivers/video/fbdev/Kconfig
drivers/video/fbdev/core/fb_defio.c
include/drm/drm_gem.h
include/drm/ttm/ttm_bo_api.h
include/drm/ttm/ttm_resource.h
include/linux/dma-buf.h

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -187,20 -200,17 +187,17 @@@ static void amdgpu_gtt_mgr_del(struct t
   *
   * Re-init the gart for each known BO in the GTT.
   */
int amdgpu_gtt_mgr_recover(struct amdgpu_gtt_mgr *mgr)
void amdgpu_gtt_mgr_recover(struct amdgpu_gtt_mgr *mgr)
  {
 -      struct amdgpu_gtt_node *node;
 +      struct ttm_range_mgr_node *node;
        struct drm_mm_node *mm_node;
        struct amdgpu_device *adev;
-       int r = 0;
  
        adev = container_of(mgr, typeof(*adev), mman.gtt_mgr);
        spin_lock(&mgr->lock);
        drm_mm_for_each_node(mm_node, &mgr->mm) {
 -              node = container_of(mm_node, typeof(*node), base.mm_nodes[0]);
 -              amdgpu_ttm_recover_gart(node->tbo);
 +              node = container_of(mm_node, typeof(*node), mm_nodes[0]);
-               r = amdgpu_ttm_recover_gart(node->base.bo);
-               if (r)
-                       break;
++              amdgpu_ttm_recover_gart(node->base.bo);
        }
        spin_unlock(&mgr->lock);
  
@@@ -375,7 -375,9 +375,9 @@@ static void amdgpu_vm_bo_base_init(stru
        if (bo->tbo.base.resv != vm->root.bo->tbo.base.resv)
                return;
  
 -      vm->bulk_moveable = false;
+       dma_resv_assert_held(vm->root.bo->tbo.base.resv);
 +      ttm_bo_set_bulk_move(&bo->tbo, &vm->lru_bulk_move);
        if (bo->tbo.type == ttm_bo_type_kernel && bo->parent)
                amdgpu_vm_bo_relocated(base);
        else
@@@ -2597,9 -2660,12 +2606,12 @@@ void amdgpu_vm_bo_del(struct amdgpu_dev
        struct amdgpu_vm *vm = bo_va->base.vm;
        struct amdgpu_vm_bo_base **base;
  
+       dma_resv_assert_held(vm->root.bo->tbo.base.resv);
        if (bo) {
+               dma_resv_assert_held(bo->tbo.base.resv);
                if (bo->tbo.base.resv == vm->root.bo->tbo.base.resv)
 -                      vm->bulk_moveable = false;
 +                      ttm_bo_set_bulk_move(&bo->tbo, NULL);
  
                for (base = &bo_va->base.bo->vm_bo; *base;
                     base = &(*base)->next) {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -842,14 -915,28 +915,28 @@@ void i915_ttm_adjust_lru(struct drm_i91
        } else if (obj->mm.madv != I915_MADV_WILLNEED) {
                bo->priority = I915_TTM_PRIO_PURGE;
        } else if (!i915_gem_object_has_pages(obj)) {
-               if (bo->priority < I915_TTM_PRIO_HAS_PAGES)
-                       bo->priority = I915_TTM_PRIO_HAS_PAGES;
+               bo->priority = I915_TTM_PRIO_NO_PAGES;
        } else {
-               if (bo->priority > I915_TTM_PRIO_NO_PAGES)
-                       bo->priority = I915_TTM_PRIO_NO_PAGES;
+               struct ttm_resource_manager *man =
+                       ttm_manager_type(bo->bdev, bo->resource->mem_type);
+               /*
+                * If we need to place an LMEM resource which doesn't need CPU
+                * access then we should try not to victimize mappable objects
+                * first, since we likely end up stealing more of the mappable
+                * portion. And likewise when we try to find space for a mappble
+                * object, we know not to ever victimize objects that don't
+                * occupy any mappable pages.
+                */
+               if (i915_ttm_cpu_maps_iomem(bo->resource) &&
+                   i915_ttm_buddy_man_visible_size(man) < man->size &&
+                   !(obj->flags & I915_BO_ALLOC_GPU_ONLY))
+                       bo->priority = I915_TTM_PRIO_NEEDS_CPU_ACCESS;
+               else
+                       bo->priority = I915_TTM_PRIO_HAS_PAGES;
        }
  
 -      ttm_bo_move_to_lru_tail(bo, bo->resource, NULL);
 +      ttm_bo_move_to_lru_tail(bo);
        spin_unlock(&bo->bdev->lru_lock);
  }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -405,59 -273,8 +405,59 @@@ void ttm_resource_manager_debug(struct 
  }
  EXPORT_SYMBOL(ttm_resource_manager_debug);
  
 +/**
 + * ttm_resource_manager_first
 + *
 + * @man: resource manager to iterate over
 + * @cursor: cursor to record the position
 + *
 + * Returns the first resource from the resource manager.
 + */
 +struct ttm_resource *
 +ttm_resource_manager_first(struct ttm_resource_manager *man,
 +                         struct ttm_resource_cursor *cursor)
 +{
 +      struct ttm_resource *res;
 +
 +      lockdep_assert_held(&man->bdev->lru_lock);
 +
 +      for (cursor->priority = 0; cursor->priority < TTM_MAX_BO_PRIORITY;
 +           ++cursor->priority)
 +              list_for_each_entry(res, &man->lru[cursor->priority], lru)
 +                      return res;
 +
 +      return NULL;
 +}
 +
 +/**
 + * ttm_resource_manager_next
 + *
 + * @man: resource manager to iterate over
 + * @cursor: cursor to record the position
 + * @res: the current resource pointer
 + *
 + * Returns the next resource from the resource manager.
 + */
 +struct ttm_resource *
 +ttm_resource_manager_next(struct ttm_resource_manager *man,
 +                        struct ttm_resource_cursor *cursor,
 +                        struct ttm_resource *res)
 +{
 +      lockdep_assert_held(&man->bdev->lru_lock);
 +
 +      list_for_each_entry_continue(res, &man->lru[cursor->priority], lru)
 +              return res;
 +
 +      for (++cursor->priority; cursor->priority < TTM_MAX_BO_PRIORITY;
 +           ++cursor->priority)
 +              list_for_each_entry(res, &man->lru[cursor->priority], lru)
 +                      return res;
 +
 +      return NULL;
 +}
 +
  static void ttm_kmap_iter_iomap_map_local(struct ttm_kmap_iter *iter,
-                                         struct dma_buf_map *dmap,
+                                         struct iosys_map *dmap,
                                          pgoff_t i)
  {
        struct ttm_kmap_iter_iomap *iter_io =
Simple merge
@@@ -1610,11 -1249,11 +1604,12 @@@ static int vc4_hdmi_encoder_atomic_chec
        struct vc4_hdmi_connector_state *vc4_state = conn_state_to_vc4_hdmi_conn_state(conn_state);
        struct drm_display_mode *mode = &crtc_state->adjusted_mode;
        struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
 -      unsigned long long pixel_rate = mode->clock * 1000;
 -      unsigned long long tmds_rate;
 +      unsigned long long tmds_char_rate = mode->clock * 1000;
 +      unsigned long long tmds_bit_rate;
 +      int ret;
  
        if (vc4_hdmi->variant->unsupported_odd_h_timings &&
+           !(mode->flags & DRM_MODE_FLAG_DBLCLK) &&
            ((mode->hdisplay % 2) || (mode->hsync_start % 2) ||
             (mode->hsync_end % 2) || (mode->htotal % 2)))
                return -EINVAL;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  #define _TTM_RESOURCE_H_
  
  #include <linux/types.h>
 +#include <linux/list.h>
  #include <linux/mutex.h>
- #include <linux/atomic.h>
- #include <linux/dma-buf-map.h>
+ #include <linux/iosys-map.h>
  #include <linux/dma-fence.h>
 +
  #include <drm/drm_print.h>
  #include <drm/ttm/ttm_caching.h>
  #include <drm/ttm/ttm_kmap_iter.h>
Simple merge