Merge commit 'Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux'
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 25 Jul 2013 07:41:59 +0000 (09:41 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 25 Jul 2013 13:18:41 +0000 (15:18 +0200)
This backmerges Linus' merge commit of the latest drm-fixes pull:

commit 549f3a1218ba18fcde11ef0e22b07e6365645788
Merge: 42577ca 058ca4a
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Tue Jul 23 15:47:08 2013 -0700

    Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

We've accrued a few too many conflicts, but the real reason is that I
want to merge the 100% solution for Haswell concurrent registers
writes into drm-intel-next. But that depends upon the 90% bandaid
merged into -fixes:

commit a7cd1b8fea2f341b626b255d9898a5ca5fabbf0a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jul 19 20:36:51 2013 +0100

    drm/i915: Serialize almost all register access

Also, we can roll up on accrued conflicts.

Usually I'd backmerge a tagged -rc, but I want to get this done before
heading off to vacations next week ;-)

Conflicts:
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_gem.c

v2: For added hilarity we have a init sequence conflict around the
gt_lock, so need to move that one, too. Spotted by Jani Nikula.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
14 files changed:
1  2 
drivers/gpu/drm/drm_mm.c
drivers/gpu/drm/i915/i915_dma.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_stolen.c
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/i915/intel_ringbuffer.c
include/drm/drm_mm.h

Simple merge
index fd52de77a33ff0ddcb25f6cc4a3cef35fdb98483,67ec54f67afe2d7a56cbabda7800819bfee753ac..1c5b397385080c27f53691d932418d6b884cd035
@@@ -1490,12 -1495,16 +1490,20 @@@ int i915_driver_load(struct drm_device 
        dev_priv->dev = dev;
        dev_priv->info = info;
  
 -      spin_lock_init(&dev_priv->rps.lock);
+       spin_lock_init(&dev_priv->irq_lock);
+       spin_lock_init(&dev_priv->gpu_error.lock);
+       spin_lock_init(&dev_priv->backlight.lock);
++      spin_lock_init(&dev_priv->gt_lock);
+       mutex_init(&dev_priv->dpio_lock);
+       mutex_init(&dev_priv->rps.hw_lock);
+       mutex_init(&dev_priv->modeset_restore_lock);
        i915_dump_device_info(dev_priv);
  
 +      INIT_LIST_HEAD(&dev_priv->vm_list);
 +      INIT_LIST_HEAD(&dev_priv->gtt.base.global_link);
 +      list_add(&dev_priv->gtt.base.global_link, &dev_priv->vm_list);
 +
        if (i915_get_bridge_dev(dev)) {
                ret = -EIO;
                goto free_priv;
Simple merge
index fc32d2034f38ac2821cee4e21ab34923820b79c3,d2ee3343c9439cbcf306ce443b9fbe57e53e534a..331c00b69f151b5e13adec8f79d4e21212c4b50b
@@@ -1670,8 -1584,10 +1671,8 @@@ void i915_handle_error(struct drm_devic
  extern void intel_irq_init(struct drm_device *dev);
  extern void intel_hpd_init(struct drm_device *dev);
  extern void intel_gt_init(struct drm_device *dev);
- extern void intel_gt_reset(struct drm_device *dev);
+ extern void intel_gt_sanitize(struct drm_device *dev);
  
 -void i915_error_state_free(struct kref *error_ref);
 -
  void
  i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
  
index 0a1ddb8a28a78006b2c8e1a400cf959facc053a6,d9e2208cfe98f2fdcb3957bf4ee13f0497e06dfb..eceab96d76f52cb1433aeb6c69dc06d9970b703a
@@@ -2278,11 -2285,14 +2282,10 @@@ void i915_gem_reset(struct drm_device *
        /* Move everything out of the GPU domains to ensure we do any
         * necessary invalidation upon reuse.
         */
 -      list_for_each_entry(obj,
 -                          &dev_priv->mm.inactive_list,
 -                          mm_list)
 -      {
 +      list_for_each_entry(obj, &vm->inactive_list, mm_list)
                obj->base.read_domains &= ~I915_GEM_GPU_DOMAINS;
 -      }
  
-       /* The fence registers are invalidated so clear them out */
-       i915_gem_reset_fences(dev);
+       i915_gem_restore_fences(dev);
  }
  
  /**
@@@ -2675,12 -2676,27 +2677,27 @@@ static void i965_write_fence_reg(struc
                fence_pitch_shift = I965_FENCE_PITCH_SHIFT;
        }
  
+       fence_reg += reg * 8;
+       /* To w/a incoherency with non-atomic 64-bit register updates,
+        * we split the 64-bit update into two 32-bit writes. In order
+        * for a partial fence not to be evaluated between writes, we
+        * precede the update with write to turn off the fence register,
+        * and only enable the fence as the last step.
+        *
+        * For extra levels of paranoia, we make sure each step lands
+        * before applying the next step.
+        */
+       I915_WRITE(fence_reg, 0);
+       POSTING_READ(fence_reg);
        if (obj) {
 -              u32 size = obj->gtt_space->size;
 +              u32 size = i915_gem_obj_ggtt_size(obj);
+               uint64_t val;
  
 -              val = (uint64_t)((obj->gtt_offset + size - 4096) &
 +              val = (uint64_t)((i915_gem_obj_ggtt_offset(obj) + size - 4096) &
                                 0xfffff000) << 32;
 -              val |= obj->gtt_offset & 0xfffff000;
 +              val |= i915_gem_obj_ggtt_offset(obj) & 0xfffff000;
                val |= (uint64_t)((obj->stride / 128) - 1) << fence_pitch_shift;
                if (obj->tiling_mode == I915_TILING_Y)
                        val |= 1 << I965_FENCE_TILING_Y_SHIFT;
@@@ -4050,8 -4006,11 +4036,6 @@@ i915_gem_idle(struct drm_device *dev
        if (!drm_core_check_feature(dev, DRIVER_MODESET))
                i915_gem_evict_everything(dev);
  
-       i915_gem_reset_fences(dev);
 -      /* Hack!  Don't let anybody do execbuf while we don't control the chip.
 -       * We need to replace this with a semaphore, or something.
 -       * And not confound mm.suspended!
 -       */
 -      dev_priv->mm.suspended = 1;
        del_timer_sync(&dev_priv->gpu_error.hangcheck_timer);
  
        i915_kernel_lost_context(dev);
@@@ -4664,7 -4608,7 +4649,7 @@@ i915_gem_inactive_shrink(struct shrinke
        list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list)
                if (obj->pages_pin_count == 0)
                        cnt += obj->base.size >> PAGE_SHIFT;
-       list_for_each_entry(obj, &vm->inactive_list, global_list)
 -      list_for_each_entry(obj, &dev_priv->mm.inactive_list, mm_list)
++      list_for_each_entry(obj, &vm->inactive_list, mm_list)
                if (obj->pin_count == 0 && obj->pages_pin_count == 0)
                        cnt += obj->base.size >> PAGE_SHIFT;
  
index 837cf534f47a94be1560ec3825388d7e8f641416,982d4732cecff93e45370f30dfab03cc1bfdb32a..4bbde2ae1819c0025926aa0e158c646099f55e13
@@@ -146,10 -147,10 +146,10 @@@ int i915_gem_stolen_setup_compression(s
  {
        struct drm_i915_private *dev_priv = dev->dev_private;
  
-       if (dev_priv->mm.stolen_base == 0)
+       if (!drm_mm_initialized(&dev_priv->mm.stolen))
                return -ENODEV;
  
 -      if (size < dev_priv->cfb_size)
 +      if (size < dev_priv->fbc.size)
                return 0;
  
        /* Release any current block */
@@@ -330,13 -331,10 +333,13 @@@ i915_gem_object_create_stolen_for_preal
                                               u32 size)
  {
        struct drm_i915_private *dev_priv = dev->dev_private;
 +      struct i915_address_space *vm = &dev_priv->gtt.base;
        struct drm_i915_gem_object *obj;
        struct drm_mm_node *stolen;
 +      struct i915_vma *vma;
 +      int ret;
  
-       if (dev_priv->mm.stolen_base == 0)
+       if (!drm_mm_initialized(&dev_priv->mm.stolen))
                return NULL;
  
        DRM_DEBUG_KMS("creating preallocated stolen object: stolen_offset=%x, gtt_offset=%x, size=%x\n",
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index e81d37667bc9f15afe8a086b64e1dbf8b29e1180,6a347f54d39fd9724ac368b710abafb259ee8180..74d6c4d78360adba17dfd38aee662f4a75277cf5
@@@ -5490,10 -5497,8 +5494,6 @@@ void intel_gt_init(struct drm_device *d
  {
        struct drm_i915_private *dev_priv = dev->dev_private;
  
--      spin_lock_init(&dev_priv->gt_lock);
-       intel_gt_reset(dev);
--
        if (IS_VALLEYVIEW(dev)) {
                dev_priv->gt.force_wake_get = vlv_force_wake_get;
                dev_priv->gt.force_wake_put = vlv_force_wake_put;
Simple merge