Merge tag 'drm-intel-next-2017-03-06' of git://anongit.freedesktop.org/git/drm-intel...
authorDave Airlie <airlied@redhat.com>
Wed, 8 Mar 2017 02:41:47 +0000 (12:41 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 8 Mar 2017 02:41:47 +0000 (12:41 +1000)
4 weeks worth of stuff since I was traveling&lazy:

- lspcon improvements (Imre)
- proper atomic state for cdclk handling (Ville)
- gpu reset improvements (Chris)
- lots and lots of polish around fences, requests, waiting and
  everything related all over (both gem and modeset code), from Chris
- atomic by default on gen5+ minus byt/bsw (Maarten did the patch to
  flip the default, really this is a massive joint team effort)
- moar power domains, now 64bit (Ander)
- big pile of in-kernel unit tests for various gem subsystems (Chris),
  including simple mock objects for i915 device and and the ggtt
  manager.
- i915_gpu_info in debugfs, for taking a snapshot of the current gpu
  state. Same thing as i915_error_state, but useful if the kernel didn't
  notice something is stick. From Chris.
- bxt dsi fixes (Umar Shankar)
- bxt w/a updates (Jani)
- no more struct_mutex for gem object unreference (Chris)
- some execlist refactoring (Tvrtko)
- color manager support for glk (Ander)
- improve the power-well sync code to better take over from the
  firmware (Imre)
- gem tracepoint polish (Tvrtko)
- lots of glk fixes all around (Ander)
- ctx switch improvements (Chris)
- glk dsi support&fixes (Deepak M)
- dsi fixes for vlv and clanups, lots of them (Hans de Goede)
- switch to i915.ko types in lots of our internal modeset code (Ander)
- byt/bsw atomic wm update code, yay (Ville)

* tag 'drm-intel-next-2017-03-06' of git://anongit.freedesktop.org/git/drm-intel: (432 commits)
  drm/i915: Update DRIVER_DATE to 20170306
  drm/i915: Don't use enums for hardware engine id
  drm/i915: Split breadcrumbs spinlock into two
  drm/i915: Refactor wakeup of the next breadcrumb waiter
  drm/i915: Take reference for signaling the request from hardirq
  drm/i915: Add FIFO underrun tracepoints
  drm/i915: Add cxsr toggle tracepoint
  drm/i915: Add VLV/CHV watermark/FIFO programming tracepoints
  drm/i915: Add plane update/disable tracepoints
  drm/i915: Kill level 0 wm hack for VLV/CHV
  drm/i915: Workaround VLV/CHV sprite1->sprite0 enable underrun
  drm/i915: Sanitize VLV/CHV watermarks properly
  drm/i915: Only use update_wm_{pre,post} for pre-ilk platforms
  drm/i915: Nuke crtc->wm.cxsr_allowed
  drm/i915: Compute proper intermediate wms for vlv/cvh
  drm/i915: Skip useless watermark/FIFO related work on VLV/CHV when not needed
  drm/i915: Compute vlv/chv wms the atomic way
  drm/i915: Compute VLV/CHV FIFO sizes based on the PM2 watermarks
  drm/i915: Plop vlv/chv fifo sizes into crtc state
  drm/i915: Plop vlv wm state into crtc_state
  ...

18 files changed:
1  2 
Documentation/gpu/i915.rst
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_dmabuf.c
drivers/gpu/drm/i915/i915_gem_object.h
drivers/gpu/drm/i915/i915_gem_request.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_audio.c
drivers/gpu/drm/i915/intel_breadcrumbs.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_fbdev.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_pipe_crc.c

Simple merge
Simple merge
index 7d7244798507de0ac773927cba3e1676baa98696,478f19d2f3d8c67de2f7ae529de1c6b1466c82be..aa2d726b43491eff78511b86d985cb14338669ea
@@@ -35,6 -35,49 +35,23 @@@ static inline struct drm_i915_private *
        return to_i915(node->minor->dev);
  }
  
 -/* As the drm_debugfs_init() routines are called before dev->dev_private is
 - * allocated we need to hook into the minor for release. */
 -static int
 -drm_add_fake_info_node(struct drm_minor *minor,
 -                     struct dentry *ent,
 -                     const void *key)
 -{
 -      struct drm_info_node *node;
 -
 -      node = kmalloc(sizeof(*node), GFP_KERNEL);
 -      if (node == NULL) {
 -              debugfs_remove(ent);
 -              return -ENOMEM;
 -      }
 -
 -      node->minor = minor;
 -      node->dent = ent;
 -      node->info_ent = (void *)key;
 -
 -      mutex_lock(&minor->debugfs_lock);
 -      list_add(&node->list, &minor->debugfs_list);
 -      mutex_unlock(&minor->debugfs_lock);
 -
 -      return 0;
 -}
 -
+ static __always_inline void seq_print_param(struct seq_file *m,
+                                           const char *name,
+                                           const char *type,
+                                           const void *x)
+ {
+       if (!__builtin_strcmp(type, "bool"))
+               seq_printf(m, "i915.%s=%s\n", name, yesno(*(const bool *)x));
+       else if (!__builtin_strcmp(type, "int"))
+               seq_printf(m, "i915.%s=%d\n", name, *(const int *)x);
+       else if (!__builtin_strcmp(type, "unsigned int"))
+               seq_printf(m, "i915.%s=%u\n", name, *(const unsigned int *)x);
+       else if (!__builtin_strcmp(type, "char *"))
+               seq_printf(m, "i915.%s=%s\n", name, *(const char **)x);
+       else
+               BUILD_BUG();
+ }
  static int i915_capabilities(struct seq_file *m, void *data)
  {
        struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@@ -4567,6 -4646,112 +4620,81 @@@ static const struct file_operations i91
        .release = i915_forcewake_release,
  };
  
 -static int i915_forcewake_create(struct dentry *root, struct drm_minor *minor)
 -{
 -      struct dentry *ent;
 -
 -      ent = debugfs_create_file("i915_forcewake_user",
 -                                S_IRUSR,
 -                                root, to_i915(minor->dev),
 -                                &i915_forcewake_fops);
 -      if (!ent)
 -              return -ENOMEM;
 -
 -      return drm_add_fake_info_node(minor, ent, &i915_forcewake_fops);
 -}
 -
+ static int i915_hpd_storm_ctl_show(struct seq_file *m, void *data)
+ {
+       struct drm_i915_private *dev_priv = m->private;
+       struct i915_hotplug *hotplug = &dev_priv->hotplug;
+       seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold);
+       seq_printf(m, "Detected: %s\n",
+                  yesno(delayed_work_pending(&hotplug->reenable_work)));
+       return 0;
+ }
+ static ssize_t i915_hpd_storm_ctl_write(struct file *file,
+                                       const char __user *ubuf, size_t len,
+                                       loff_t *offp)
+ {
+       struct seq_file *m = file->private_data;
+       struct drm_i915_private *dev_priv = m->private;
+       struct i915_hotplug *hotplug = &dev_priv->hotplug;
+       unsigned int new_threshold;
+       int i;
+       char *newline;
+       char tmp[16];
+       if (len >= sizeof(tmp))
+               return -EINVAL;
+       if (copy_from_user(tmp, ubuf, len))
+               return -EFAULT;
+       tmp[len] = '\0';
+       /* Strip newline, if any */
+       newline = strchr(tmp, '\n');
+       if (newline)
+               *newline = '\0';
+       if (strcmp(tmp, "reset") == 0)
+               new_threshold = HPD_STORM_DEFAULT_THRESHOLD;
+       else if (kstrtouint(tmp, 10, &new_threshold) != 0)
+               return -EINVAL;
+       if (new_threshold > 0)
+               DRM_DEBUG_KMS("Setting HPD storm detection threshold to %d\n",
+                             new_threshold);
+       else
+               DRM_DEBUG_KMS("Disabling HPD storm detection\n");
+       spin_lock_irq(&dev_priv->irq_lock);
+       hotplug->hpd_storm_threshold = new_threshold;
+       /* Reset the HPD storm stats so we don't accidentally trigger a storm */
+       for_each_hpd_pin(i)
+               hotplug->stats[i].count = 0;
+       spin_unlock_irq(&dev_priv->irq_lock);
+       /* Re-enable hpd immediately if we were in an irq storm */
+       flush_delayed_work(&dev_priv->hotplug.reenable_work);
+       return len;
+ }
+ static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file)
+ {
+       return single_open(file, i915_hpd_storm_ctl_show, inode->i_private);
+ }
+ static const struct file_operations i915_hpd_storm_ctl_fops = {
+       .owner = THIS_MODULE,
+       .open = i915_hpd_storm_ctl_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+       .write = i915_hpd_storm_ctl_write
+ };
 -static int i915_debugfs_create(struct dentry *root,
 -                             struct drm_minor *minor,
 -                             const char *name,
 -                             const struct file_operations *fops)
 -{
 -      struct dentry *ent;
 -
 -      ent = debugfs_create_file(name,
 -                                S_IRUGO | S_IWUSR,
 -                                root, to_i915(minor->dev),
 -                                fops);
 -      if (!ent)
 -              return -ENOMEM;
 -
 -      return drm_add_fake_info_node(minor, ent, fops);
 -}
 -
  static const struct drm_info_list i915_debugfs_list[] = {
        {"i915_capabilities", i915_capabilities, 0},
        {"i915_gem_objects", i915_gem_object_info, 0},
Simple merge
index 8df73751c367a1c9177bb68abc117e41086de36b,56e569f536ec9dc0d206824e532cf273d22fc5c8..9ae1e520f48c36ed3eeb8455efaf732e4a1c8fad
@@@ -3348,11 -3412,11 +3418,11 @@@ int __must_check i915_gem_init(struct d
  int __must_check i915_gem_init_hw(struct drm_i915_private *dev_priv);
  void i915_gem_init_swizzling(struct drm_i915_private *dev_priv);
  void i915_gem_cleanup_engines(struct drm_i915_private *dev_priv);
- int __must_check i915_gem_wait_for_idle(struct drm_i915_private *dev_priv,
-                                       unsigned int flags);
+ int i915_gem_wait_for_idle(struct drm_i915_private *dev_priv,
+                          unsigned int flags);
  int __must_check i915_gem_suspend(struct drm_i915_private *dev_priv);
  void i915_gem_resume(struct drm_i915_private *dev_priv);
 -int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
 +int i915_gem_fault(struct vm_fault *vmf);
  int i915_gem_object_wait(struct drm_i915_gem_object *obj,
                         unsigned int flags,
                         long timeout,
Simple merge
Simple merge
Simple merge
Simple merge
index a2fece5e9fb38c80051ba6cea8be8af790c9e94b,72e2c91707d48373d1c931ffdf76c4bcb49ca4d2..7369ee31ad914ac8726413bc3d1cec755ae08c2b
@@@ -3505,9 -3483,10 +3484,10 @@@ __intel_display_resume(struct drm_devic
        }
  
        /* ignore any reset values/BIOS leftovers in the WM registers */
-       to_intel_atomic_state(state)->skip_intermediate_wm = true;
+       if (!HAS_GMCH_DISPLAY(to_i915(dev)))
+               to_intel_atomic_state(state)->skip_intermediate_wm = true;
  
 -      ret = drm_atomic_commit(state);
 +      ret = drm_atomic_helper_commit_duplicated_state(state, ctx);
  
        WARN_ON(ret == -EDEADLK);
        return ret;
index 064582963ff61345e61f50f7ed40932fc083e514,3ef044efe98c15548d2144c34b87d080c3993721..0f766f83a31b1c522860254e11d439474794189b
@@@ -1228,15 -1264,25 +1265,27 @@@ void intel_audio_codec_enable(struct in
  void intel_audio_codec_disable(struct intel_encoder *encoder);
  void i915_audio_component_init(struct drm_i915_private *dev_priv);
  void i915_audio_component_cleanup(struct drm_i915_private *dev_priv);
 +void intel_audio_init(struct drm_i915_private *dev_priv);
 +void intel_audio_deinit(struct drm_i915_private *dev_priv);
  
+ /* intel_cdclk.c */
+ void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv);
+ void intel_update_max_cdclk(struct drm_i915_private *dev_priv);
+ void intel_update_cdclk(struct drm_i915_private *dev_priv);
+ void intel_update_rawclk(struct drm_i915_private *dev_priv);
+ bool intel_cdclk_state_compare(const struct intel_cdclk_state *a,
+                              const struct intel_cdclk_state *b);
+ void intel_set_cdclk(struct drm_i915_private *dev_priv,
+                    const struct intel_cdclk_state *cdclk_state);
  /* intel_display.c */
  enum transcoder intel_crtc_pch_transcoder(struct intel_crtc *crtc);
- void skl_set_preferred_cdclk_vco(struct drm_i915_private *dev_priv, int vco);
  void intel_update_rawclk(struct drm_i915_private *dev_priv);
+ int vlv_get_hpll_vco(struct drm_i915_private *dev_priv);
  int vlv_get_cck_clock(struct drm_i915_private *dev_priv,
                      const char *name, u32 reg, int ref_freq);
+ int vlv_get_cck_clock_hpll(struct drm_i915_private *dev_priv,
+                          const char *name, u32 reg);
  void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv);
  void lpt_disable_iclkip(struct drm_i915_private *dev_priv);
  extern const struct drm_plane_funcs intel_plane_funcs;
Simple merge
Simple merge
Simple merge