Merge tag 'drm-next-2018-12-14' of git://anongit.freedesktop.org/drm/drm
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 25 Dec 2018 19:48:26 +0000 (11:48 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 25 Dec 2018 19:48:26 +0000 (11:48 -0800)
Pull drm updates from Dave Airlie:
 "Core:
   - shared fencing staging removal
   - drop transactional atomic helpers and move helpers to new location
   - DP/MST atomic cleanup
   - Leasing cleanups and drop EXPORT_SYMBOL
   - Convert drivers to atomic helpers and generic fbdev.
   - removed deprecated obj_ref/unref in favour of get/put
   - Improve dumb callback documentation
   - MODESET_LOCK_BEGIN/END helpers

  panels:
   - CDTech panels, Banana Pi Panel, DLC1010GIG,
   - Olimex LCD-O-LinuXino, Samsung S6D16D0, Truly NT35597 WQXGA,
   - Himax HX8357D, simulated RTSM AEMv8.
   - GPD Win2 panel
   - AUO G101EVN010

  vgem:
   - render node support

  ttm:
   - move global init out of drivers
   - fix LRU handling for ghost objects
   - Support for simultaneous submissions to multiple engines

  scheduler:
   - timeout/fault handling changes to help GPU recovery
   - helpers for hw with preemption support

  i915:
   - Scaler/Watermark fixes
   - DP MST + powerwell fixes
   - PSR fixes
   - Break long get/put shmemfs pages
   - Icelake fixes
   - Icelake DSI video mode enablement
   - Engine workaround improvements

  amdgpu:
   - freesync support
   - GPU reset enabled on CI, VI, SOC15 dGPUs
   - ABM support in DC
   - KFD support for vega12/polaris12
   - SDMA paging queue on vega
   - More amdkfd code sharing
   - DCC scanout on GFX9
   - DC kerneldoc
   - Updated SMU firmware for GFX8 chips
   - XGMI PSP + hive reset support
   - GPU reset
   - DC trace support
   - Powerplay updates for newer Polaris
   - Cursor plane update fast path
   - kfd dma-buf support

  virtio-gpu:
   - add EDID support

  vmwgfx:
   - pageflip with damage support

  nouveau:
   - Initial Turing TU104/TU106 modesetting support

  msm:
   - a2xx gpu support for apq8060 and imx5
   - a2xx gpummu support
   - mdp4 display support for apq8060
   - DPU fixes and cleanups
   - enhanced profiling support
   - debug object naming interface
   - get_iova/page pinning decoupling

  tegra:
   - Tegra194 host1x, VIC and display support enabled
   - Audio over HDMI for Tegra186 and Tegra194

  exynos:
   - DMA/IOMMU refactoring
   - plane alpha + blend mode support
   - Color format fixes for mixer driver

  rcar-du:
   - R8A7744 and R8A77470 support
   - R8A77965 LVDS support

  imx:
   - fbdev emulation fix
   - multi-tiled scalling fixes
   - SPDX identifiers

  rockchip
   - dw_hdmi support
   - dw-mipi-dsi + dual dsi support
   - mailbox read size fix

  qxl:
   - fix cursor pinning

  vc4:
   - YUV support (scaling + cursor)

  v3d:
   - enable TFU (Texture Formatting Unit)

  mali-dp:
   - add support for linear tiled formats

  sun4i:
   - Display Engine 3 support
   - H6 DE3 mixer 0 support
   - H6 display engine support
   - dw-hdmi support
   - H6 HDMI phy support
   - implicit fence waiting
   - BGRX8888 support

  meson:
   - Overlay plane support
   - implicit fence waiting
   - HDMI 1.4 4k modes

  bridge:
   - i2c fixes for sii902x"

* tag 'drm-next-2018-12-14' of git://anongit.freedesktop.org/drm/drm: (1403 commits)
  drm/amd/display: Add fast path for cursor plane updates
  drm/amdgpu: Enable GPU recovery by default for CI
  drm/amd/display: Fix duplicating scaling/underscan connector state
  drm/amd/display: Fix unintialized max_bpc state values
  Revert "drm/amd/display: Set RMX_ASPECT as default"
  drm/amdgpu: Fix stub function name
  drm/msm/dpu: Fix clock issue after bind failure
  drm/msm/dpu: Clean up dpu_media_info.h static inline functions
  drm/msm/dpu: Further cleanups for static inline functions
  drm/msm/dpu: Cleanup the debugfs functions
  drm/msm/dpu: Remove dpu_irq and unused functions
  drm/msm: Make irq_postinstall optional
  drm/msm/dpu: Cleanup callers of dpu_hw_blk_init
  drm/msm/dpu: Remove unused functions
  drm/msm/dpu: Remove dpu_crtc_is_enabled()
  drm/msm/dpu: Remove dpu_crtc_get_mixer_height
  drm/msm/dpu: Remove dpu_dbg
  drm/msm: dpu: Remove crtc_lock
  drm/msm: dpu: Remove vblank_requested flag from dpu_crtc
  drm/msm: dpu: Separate crtc assignment from vblank enable
  ...

46 files changed:
1  2 
MAINTAINERS
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
drivers/gpu/drm/amd/amdkfd/kfd_device.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/drm_internal.h
drivers/gpu/drm/drm_lease.c
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/meson/meson_crtc.c
drivers/gpu/drm/meson/meson_dw_hdmi.c
drivers/gpu/drm/meson/meson_venc.c
drivers/gpu/drm/meson/meson_viu.c
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c
drivers/gpu/drm/msm/hdmi/hdmi.c
drivers/gpu/drm/msm/hdmi/hdmi_connector.c
drivers/gpu/drm/msm/msm_atomic.c
drivers/gpu/drm/msm/msm_debugfs.c
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_gem_submit.c
drivers/gpu/drm/msm/msm_gpu.c
drivers/gpu/drm/msm/msm_iommu.c
drivers/gpu/drm/msm/msm_rd.c
drivers/gpu/drm/nouveau/dispnv50/disp.c
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
drivers/gpu/drm/vmwgfx/vmwgfx_validation.c
mm/shmem.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -223,9 -214,9 +215,9 @@@ static int vcn_v1_0_hw_fini(void *handl
        struct amdgpu_ring *ring = &adev->vcn.ring_dec;
  
        if (RREG32_SOC15(VCN, 0, mmUVD_STATUS))
 -              vcn_v1_0_stop(adev);
 +              vcn_v1_0_set_powergating_state(adev, AMD_PG_STATE_GATE);
  
-       ring->ready = false;
+       ring->sched.ready = false;
  
        return 0;
  }
@@@ -337,14 -378,13 +378,19 @@@ static const struct kfd_deviceid suppor
        { 0x6864, &vega10_device_info },        /* Vega10 */
        { 0x6867, &vega10_device_info },        /* Vega10 */
        { 0x6868, &vega10_device_info },        /* Vega10 */
 +      { 0x6869, &vega10_device_info },        /* Vega10 */
 +      { 0x686A, &vega10_device_info },        /* Vega10 */
 +      { 0x686B, &vega10_device_info },        /* Vega10 */
        { 0x686C, &vega10_vf_device_info },     /* Vega10  vf*/
 +      { 0x686D, &vega10_device_info },        /* Vega10 */
 +      { 0x686E, &vega10_device_info },        /* Vega10 */
 +      { 0x686F, &vega10_device_info },        /* Vega10 */
        { 0x687F, &vega10_device_info },        /* Vega10 */
+       { 0x69A0, &vega12_device_info },        /* Vega12 */
+       { 0x69A1, &vega12_device_info },        /* Vega12 */
+       { 0x69A2, &vega12_device_info },        /* Vega12 */
+       { 0x69A3, &vega12_device_info },        /* Vega12 */
+       { 0x69AF, &vega12_device_info },        /* Vega12 */
        { 0x66a0, &vega20_device_info },        /* Vega20 */
        { 0x66a1, &vega20_device_info },        /* Vega20 */
        { 0x66a2, &vega20_device_info },        /* Vega20 */
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -126,8 -115,8 +131,10 @@@ static void meson_crtc_atomic_disable(s
        struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
        struct meson_drm *priv = meson_crtc->priv;
  
+       DRM_DEBUG_DRIVER("\n");
 +      drm_crtc_vblank_off(crtc);
 +
        priv->viu.osd1_enabled = false;
        priv->viu.osd1_commit = false;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -553,18 -563,17 +563,18 @@@ static int msm_drm_init(struct device *
                        kthread_run(kthread_worker_fn,
                                &priv->disp_thread[i].worker,
                                "crtc_commit:%d", priv->disp_thread[i].crtc_id);
 -              ret = sched_setscheduler(priv->disp_thread[i].thread,
 -                                                      SCHED_FIFO, &param);
 -              if (ret)
 -                      pr_warn("display thread priority update failed: %d\n",
 -                                                                      ret);
 -
                if (IS_ERR(priv->disp_thread[i].thread)) {
-                       dev_err(dev, "failed to create crtc_commit kthread\n");
+                       DRM_DEV_ERROR(dev, "failed to create crtc_commit kthread\n");
                        priv->disp_thread[i].thread = NULL;
 +                      goto err_msm_uninit;
                }
  
 +              ret = sched_setscheduler(priv->disp_thread[i].thread,
 +                                       SCHED_FIFO, &param);
 +              if (ret)
 +                      dev_warn(dev, "disp_thread set priority failed: %d\n",
 +                               ret);
 +
                /* initialize event thread */
                priv->event_thread[i].crtc_id = priv->crtcs[i]->base.id;
                kthread_init_worker(&priv->event_thread[i].worker);
                        kthread_run(kthread_worker_fn,
                                &priv->event_thread[i].worker,
                                "crtc_event:%d", priv->event_thread[i].crtc_id);
-                       dev_err(dev, "failed to create crtc_event kthread\n");
 +              if (IS_ERR(priv->event_thread[i].thread)) {
++                      DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
 +                      priv->event_thread[i].thread = NULL;
 +                      goto err_msm_uninit;
 +              }
  
                /**
                 * event thread should also run at same priority as disp_thread
@@@ -442,11 -445,14 +447,16 @@@ int msm_ioctl_gem_submit(struct drm_dev
        if (!queue)
                return -ENOENT;
  
+       /* Get a unique identifier for the submission for logging purposes */
+       submitid = atomic_inc_return(&ident) - 1;
        ring = gpu->rb[queue->prio];
+       trace_msm_gpu_submit(pid_nr(pid), ring->id, submitid,
+               args->nr_bos, args->nr_cmds);
  
        if (args->flags & MSM_SUBMIT_FENCE_FD_IN) {
 +              struct dma_fence *in_fence;
 +
                in_fence = sync_file_get_fence(args->fence_fd);
  
                if (!in_fence)
@@@ -453,13 -455,13 +458,13 @@@ static void recover_worker(struct work_
                         * about the submit going away.
                         */
                        mutex_unlock(&dev->struct_mutex);
 -                      cmd = kstrdup_quotable_cmdline(task, GFP_ATOMIC);
 +                      cmd = kstrdup_quotable_cmdline(task, GFP_KERNEL);
 +                      put_task_struct(task);
                        mutex_lock(&dev->struct_mutex);
                }
 -              rcu_read_unlock();
  
                if (comm && cmd) {
-                       dev_err(dev->dev, "%s: offending task: %s (%s)\n",
+                       DRM_DEV_ERROR(dev->dev, "%s: offending task: %s (%s)\n",
                                gpu->name, comm, cmd);
  
                        msm_rd_dump_submit(priv->hangrd, submit,
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -845,12 -829,8 +832,10 @@@ extern int vmw_fifo_flush(struct vmw_pr
   * TTM glue - vmwgfx_ttm_glue.c
   */
  
- extern int vmw_ttm_global_init(struct vmw_private *dev_priv);
- extern void vmw_ttm_global_release(struct vmw_private *dev_priv);
  extern int vmw_mmap(struct file *filp, struct vm_area_struct *vma);
  
 +extern void vmw_validation_mem_init_ttm(struct vmw_private *dev_priv,
 +                                      size_t gran);
  /**
   * TTM buffer object driver - vmwgfx_ttm_buffer.c
   */
@@@ -42,93 -42,3 +42,39 @@@ int vmw_mmap(struct file *filp, struct 
        dev_priv = vmw_priv(file_priv->minor->dev);
        return ttm_bo_mmap(filp, vma, &dev_priv->bdev);
  }
- static int vmw_ttm_mem_global_init(struct drm_global_reference *ref)
- {
-       DRM_INFO("global init.\n");
-       return ttm_mem_global_init(ref->object);
- }
- static void vmw_ttm_mem_global_release(struct drm_global_reference *ref)
- {
-       ttm_mem_global_release(ref->object);
- }
- int vmw_ttm_global_init(struct vmw_private *dev_priv)
- {
-       struct drm_global_reference *global_ref;
-       int ret;
-       global_ref = &dev_priv->mem_global_ref;
-       global_ref->global_type = DRM_GLOBAL_TTM_MEM;
-       global_ref->size = sizeof(struct ttm_mem_global);
-       global_ref->init = &vmw_ttm_mem_global_init;
-       global_ref->release = &vmw_ttm_mem_global_release;
-       ret = drm_global_item_ref(global_ref);
-       if (unlikely(ret != 0)) {
-               DRM_ERROR("Failed setting up TTM memory accounting.\n");
-               return ret;
-       }
-       dev_priv->bo_global_ref.mem_glob =
-               dev_priv->mem_global_ref.object;
-       global_ref = &dev_priv->bo_global_ref.ref;
-       global_ref->global_type = DRM_GLOBAL_TTM_BO;
-       global_ref->size = sizeof(struct ttm_bo_global);
-       global_ref->init = &ttm_bo_global_init;
-       global_ref->release = &ttm_bo_global_release;
-       ret = drm_global_item_ref(global_ref);
-       if (unlikely(ret != 0)) {
-               DRM_ERROR("Failed setting up TTM buffer objects.\n");
-               goto out_no_bo;
-       }
-       return 0;
- out_no_bo:
-       drm_global_item_unref(&dev_priv->mem_global_ref);
-       return ret;
- }
- void vmw_ttm_global_release(struct vmw_private *dev_priv)
- {
-       drm_global_item_unref(&dev_priv->bo_global_ref.ref);
-       drm_global_item_unref(&dev_priv->mem_global_ref);
- }
 +
 +/* struct vmw_validation_mem callback */
 +static int vmw_vmt_reserve(struct vmw_validation_mem *m, size_t size)
 +{
 +      static struct ttm_operation_ctx ctx = {.interruptible = false,
 +                                             .no_wait_gpu = false};
 +      struct vmw_private *dev_priv = container_of(m, struct vmw_private, vvm);
 +
 +      return ttm_mem_global_alloc(vmw_mem_glob(dev_priv), size, &ctx);
 +}
 +
 +/* struct vmw_validation_mem callback */
 +static void vmw_vmt_unreserve(struct vmw_validation_mem *m, size_t size)
 +{
 +      struct vmw_private *dev_priv = container_of(m, struct vmw_private, vvm);
 +
 +      return ttm_mem_global_free(vmw_mem_glob(dev_priv), size);
 +}
 +
 +/**
 + * vmw_validation_mem_init_ttm - Interface the validation memory tracker
 + * to ttm.
 + * @dev_priv: Pointer to struct vmw_private. The reason we choose a vmw private
 + * rather than a struct vmw_validation_mem is to make sure assumption in the
 + * callbacks that struct vmw_private derives from struct vmw_validation_mem
 + * holds true.
 + * @gran: The recommended allocation granularity
 + */
 +void vmw_validation_mem_init_ttm(struct vmw_private *dev_priv, size_t gran)
 +{
 +      struct vmw_validation_mem *vvm = &dev_priv->vvm;
 +
 +      vvm->reserve_mem = vmw_vmt_reserve;
 +      vvm->unreserve_mem = vmw_vmt_unreserve;
 +      vvm->gran = gran;
 +}
diff --cc mm/shmem.c
Simple merge