]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Dec 2013 01:12:54 +0000 (17:12 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Dec 2013 01:12:54 +0000 (17:12 -0800)
added patches:
drm-i915-flush-cursors-harder.patch
drm-nouveau-when-bailing-out-of-a-pushbuf-ioctl-do-not-remove-previous-fence.patch
drm-ttm-fix-memory-type-compatibility-check.patch
drm-ttm-fix-ttm_bo_move_memcpy.patch
drm-ttm-handle-in-memory-region-copies.patch

queue-3.10/drm-i915-flush-cursors-harder.patch [new file with mode: 0644]
queue-3.10/drm-nouveau-when-bailing-out-of-a-pushbuf-ioctl-do-not-remove-previous-fence.patch [new file with mode: 0644]
queue-3.10/drm-ttm-fix-memory-type-compatibility-check.patch [new file with mode: 0644]
queue-3.10/drm-ttm-fix-ttm_bo_move_memcpy.patch [new file with mode: 0644]
queue-3.10/drm-ttm-handle-in-memory-region-copies.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/drm-i915-flush-cursors-harder.patch b/queue-3.10/drm-i915-flush-cursors-harder.patch
new file mode 100644 (file)
index 0000000..35c3e05
--- /dev/null
@@ -0,0 +1,50 @@
+From b2ea8ef559b4d94190009f3651b5b3ab7c05afd3 Mon Sep 17 00:00:00 2001
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+Date: Mon, 4 Nov 2013 08:13:45 +0100
+Subject: drm/i915: flush cursors harder
+
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+
+commit b2ea8ef559b4d94190009f3651b5b3ab7c05afd3 upstream.
+
+Apparently they need the same treatment as primary planes. This fixes
+modesetting failures because of stuck cursors (!) on Thomas' i830M
+machine.
+
+I've figured while at it I'll also roll it out for the ivb 3 pipe
+version of this function. I didn't do this for i845/i865 since Bspec
+says the update mechanism works differently, and there's some
+additional rules about what can be updated in which order.
+
+Tested-by: Thomas Richter <thor@math.tu-berlin.de>
+Cc:  Thomas Richter <thor@math.tu-berlin.de>
+Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/intel_display.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/gpu/drm/i915/intel_display.c
++++ b/drivers/gpu/drm/i915/intel_display.c
+@@ -6262,7 +6262,9 @@ static void i9xx_update_cursor(struct dr
+               intel_crtc->cursor_visible = visible;
+       }
+       /* and commit changes on next vblank */
++      POSTING_READ(CURCNTR(pipe));
+       I915_WRITE(CURBASE(pipe), base);
++      POSTING_READ(CURBASE(pipe));
+ }
+ static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
+@@ -6289,7 +6291,9 @@ static void ivb_update_cursor(struct drm
+               intel_crtc->cursor_visible = visible;
+       }
+       /* and commit changes on next vblank */
++      POSTING_READ(CURCNTR_IVB(pipe));
+       I915_WRITE(CURBASE_IVB(pipe), base);
++      POSTING_READ(CURBASE_IVB(pipe));
+ }
+ /* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
diff --git a/queue-3.10/drm-nouveau-when-bailing-out-of-a-pushbuf-ioctl-do-not-remove-previous-fence.patch b/queue-3.10/drm-nouveau-when-bailing-out-of-a-pushbuf-ioctl-do-not-remove-previous-fence.patch
new file mode 100644 (file)
index 0000000..a68ca2d
--- /dev/null
@@ -0,0 +1,28 @@
+From 9360bd1112d8874d21942e2ae74f5416b00a8db6 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Wed, 13 Nov 2013 15:18:32 +1000
+Subject: drm/nouveau: when bailing out of a pushbuf ioctl, do not remove previous fence
+
+From: Ben Skeggs <bskeggs@redhat.com>
+
+commit 9360bd1112d8874d21942e2ae74f5416b00a8db6 upstream.
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/nouveau/nouveau_gem.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
++++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
+@@ -287,7 +287,8 @@ validate_fini_list(struct list_head *lis
+       list_for_each_safe(entry, tmp, list) {
+               nvbo = list_entry(entry, struct nouveau_bo, entry);
+-              nouveau_bo_fence(nvbo, fence);
++              if (likely(fence))
++                      nouveau_bo_fence(nvbo, fence);
+               if (unlikely(nvbo->validate_mapped)) {
+                       ttm_bo_kunmap(&nvbo->kmap);
diff --git a/queue-3.10/drm-ttm-fix-memory-type-compatibility-check.patch b/queue-3.10/drm-ttm-fix-memory-type-compatibility-check.patch
new file mode 100644 (file)
index 0000000..4af8bc7
--- /dev/null
@@ -0,0 +1,92 @@
+From 59c8e66378fb78adbcd05f0d09783dde6fef282b Mon Sep 17 00:00:00 2001
+From: Thomas Hellstrom <thellstrom@vmware.com>
+Date: Mon, 28 Oct 2013 02:02:19 -0700
+Subject: drm/ttm: Fix memory type compatibility check
+
+From: Thomas Hellstrom <thellstrom@vmware.com>
+
+commit 59c8e66378fb78adbcd05f0d09783dde6fef282b upstream.
+
+Also check the busy placements before deciding to move a buffer object.
+Failing to do this may result in a completely unneccessary move within a
+single memory type.
+
+Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
+Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/ttm/ttm_bo.c |   32 ++++++++++++++++++++------------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+--- a/drivers/gpu/drm/ttm/ttm_bo.c
++++ b/drivers/gpu/drm/ttm/ttm_bo.c
+@@ -1153,24 +1153,32 @@ out_unlock:
+       return ret;
+ }
+-static int ttm_bo_mem_compat(struct ttm_placement *placement,
+-                           struct ttm_mem_reg *mem)
++static bool ttm_bo_mem_compat(struct ttm_placement *placement,
++                            struct ttm_mem_reg *mem,
++                            uint32_t *new_flags)
+ {
+       int i;
+       if (mem->mm_node && placement->lpfn != 0 &&
+           (mem->start < placement->fpfn ||
+            mem->start + mem->num_pages > placement->lpfn))
+-              return -1;
++              return false;
+       for (i = 0; i < placement->num_placement; i++) {
+-              if ((placement->placement[i] & mem->placement &
+-                      TTM_PL_MASK_CACHING) &&
+-                      (placement->placement[i] & mem->placement &
+-                      TTM_PL_MASK_MEM))
+-                      return i;
++              *new_flags = placement->placement[i];
++              if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) &&
++                  (*new_flags & mem->placement & TTM_PL_MASK_MEM))
++                      return true;
+       }
+-      return -1;
++
++      for (i = 0; i < placement->num_busy_placement; i++) {
++              *new_flags = placement->busy_placement[i];
++              if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) &&
++                  (*new_flags & mem->placement & TTM_PL_MASK_MEM))
++                      return true;
++      }
++
++      return false;
+ }
+ int ttm_bo_validate(struct ttm_buffer_object *bo,
+@@ -1179,6 +1187,7 @@ int ttm_bo_validate(struct ttm_buffer_ob
+                       bool no_wait_gpu)
+ {
+       int ret;
++      uint32_t new_flags;
+       BUG_ON(!ttm_bo_is_reserved(bo));
+       /* Check that range is valid */
+@@ -1189,8 +1198,7 @@ int ttm_bo_validate(struct ttm_buffer_ob
+       /*
+        * Check whether we need to move buffer.
+        */
+-      ret = ttm_bo_mem_compat(placement, &bo->mem);
+-      if (ret < 0) {
++      if (!ttm_bo_mem_compat(placement, &bo->mem, &new_flags)) {
+               ret = ttm_bo_move_buffer(bo, placement, interruptible,
+                                        no_wait_gpu);
+               if (ret)
+@@ -1200,7 +1208,7 @@ int ttm_bo_validate(struct ttm_buffer_ob
+                * Use the access and other non-mapping-related flag bits from
+                * the compatible memory placement flags to the active flags
+                */
+-              ttm_flag_masked(&bo->mem.placement, placement->placement[ret],
++              ttm_flag_masked(&bo->mem.placement, new_flags,
+                               ~TTM_PL_MASK_MEMTYPE);
+       }
+       /*
diff --git a/queue-3.10/drm-ttm-fix-ttm_bo_move_memcpy.patch b/queue-3.10/drm-ttm-fix-ttm_bo_move_memcpy.patch
new file mode 100644 (file)
index 0000000..ab869d7
--- /dev/null
@@ -0,0 +1,82 @@
+From da95c788ef0c645378ffccb7060a0df1a33aee38 Mon Sep 17 00:00:00 2001
+From: Thomas Hellstrom <thellstrom@vmware.com>
+Date: Wed, 30 Oct 2013 03:29:50 -0700
+Subject: drm/ttm: Fix ttm_bo_move_memcpy
+
+From: Thomas Hellstrom <thellstrom@vmware.com>
+
+commit da95c788ef0c645378ffccb7060a0df1a33aee38 upstream.
+
+All error paths will want to keep the mm node, so handle this at the
+function exit. This fixes an ioremap failure error path.
+Also add some comments to make the function a bit easier to understand.
+
+Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
+Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/ttm/ttm_bo_util.c |   28 +++++++++++++++++-----------
+ 1 file changed, 17 insertions(+), 11 deletions(-)
+
+--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
++++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
+@@ -342,21 +342,25 @@ int ttm_bo_move_memcpy(struct ttm_buffer
+       if (ret)
+               goto out;
++      /*
++       * Single TTM move. NOP.
++       */
+       if (old_iomap == NULL && new_iomap == NULL)
+               goto out2;
++
++      /*
++       * Move nonexistent data. NOP.
++       */
+       if (old_iomap == NULL && ttm == NULL)
+               goto out2;
+-      /* TTM might be null for moves within the same region.
++      /*
++       * TTM might be null for moves within the same region.
+        */
+       if (ttm && ttm->state == tt_unpopulated) {
+               ret = ttm->bdev->driver->ttm_tt_populate(ttm);
+-              if (ret) {
+-                      /* if we fail here don't nuke the mm node
+-                       * as the bo still owns it */
+-                      old_copy.mm_node = NULL;
++              if (ret)
+                       goto out1;
+-              }
+       }
+       add = 0;
+@@ -382,11 +386,8 @@ int ttm_bo_move_memcpy(struct ttm_buffer
+                                                  prot);
+               } else
+                       ret = ttm_copy_io_page(new_iomap, old_iomap, page);
+-              if (ret) {
+-                      /* failing here, means keep old copy as-is */
+-                      old_copy.mm_node = NULL;
++              if (ret)
+                       goto out1;
+-              }
+       }
+       mb();
+ out2:
+@@ -404,7 +405,12 @@ out1:
+       ttm_mem_reg_iounmap(bdev, old_mem, new_iomap);
+ out:
+       ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap);
+-      ttm_bo_mem_put(bo, &old_copy);
++
++      /*
++       * On error, keep the mm node!
++       */
++      if (!ret)
++              ttm_bo_mem_put(bo, &old_copy);
+       return ret;
+ }
+ EXPORT_SYMBOL(ttm_bo_move_memcpy);
diff --git a/queue-3.10/drm-ttm-handle-in-memory-region-copies.patch b/queue-3.10/drm-ttm-handle-in-memory-region-copies.patch
new file mode 100644 (file)
index 0000000..c0a7bf4
--- /dev/null
@@ -0,0 +1,33 @@
+From 9a0599ddeae012a771bba5e23393fc52d8a59d89 Mon Sep 17 00:00:00 2001
+From: Jakob Bornecrantz <jakob@vmware.com>
+Date: Wed, 30 Oct 2013 02:46:56 -0700
+Subject: drm/ttm: Handle in-memory region copies
+
+From: Jakob Bornecrantz <jakob@vmware.com>
+
+commit 9a0599ddeae012a771bba5e23393fc52d8a59d89 upstream.
+
+Fix the case where the ttm pointer may be NULL causing
+a NULL pointer dereference.
+
+Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
+Signed-off-by: Thomas Hellström <thellstrom@vmware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/ttm/ttm_bo_util.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
++++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
+@@ -347,7 +347,9 @@ int ttm_bo_move_memcpy(struct ttm_buffer
+       if (old_iomap == NULL && ttm == NULL)
+               goto out2;
+-      if (ttm->state == tt_unpopulated) {
++      /* TTM might be null for moves within the same region.
++       */
++      if (ttm && ttm->state == tt_unpopulated) {
+               ret = ttm->bdev->driver->ttm_tt_populate(ttm);
+               if (ret) {
+                       /* if we fail here don't nuke the mm node
index f1cad298ced057f3f80d0d8e02fcbc1a51dd109b..74adad1f212e2602323a089d75610d1de1a21fe5 100644 (file)
@@ -91,3 +91,8 @@ avr32-setup-crt-for-early-panic.patch
 avr32-fix-out-of-range-jump-in-large-kernels.patch
 prism54-set-netdev-type-to-wlan.patch
 ftrace-fix-function-graph-with-loading-of-modules.patch
+drm-ttm-fix-memory-type-compatibility-check.patch
+drm-ttm-handle-in-memory-region-copies.patch
+drm-ttm-fix-ttm_bo_move_memcpy.patch
+drm-i915-flush-cursors-harder.patch
+drm-nouveau-when-bailing-out-of-a-pushbuf-ioctl-do-not-remove-previous-fence.patch