debian/changelog                                     |    5 +
 debian/patches/series                                |    3 
 debian/patches/sna-fall-back-to-proc-cpuinfo.patch   |   85 +++++++++++++++++
 debian/patches/sna-fix-typo-in-computing-box.patch   |   77 ++++++++++++++++
 debian/patches/sna-note-that-borderClip-region.patch |   90 +++++++++++++++++++
 5 files changed, 260 insertions(+)

New commits:
commit 0f0f30ba9741cc6ba0d3f0d614fd759eb831961c
Author: Robert Hooker <sarv...@ubuntu.com>
Date:   Fri Jul 19 13:38:13 2013 -0400

    Cherry-pick 3 SNA fixes needed for 2.21.12.

diff --git a/debian/changelog b/debian/changelog
index 25a3735..b25ec80 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,14 @@
 xserver-xorg-video-intel (2:2.21.12-1ubuntu1) UNRELEASED; urgency=low
 
+  [ Maarten Lankhorst ]
   * Merge from unreleased debian git (LP: #1198409, #1173557, #1199746, 
#1200766)
     Remaining changes:
     - Use SNA by default.
 
+  [ Robert Hooker ]
+  * Cherry-pick 3 commits from upstream git to fix SNA regressions in 2.21.12
+    (34c9b759f, 7f76a2bf3, a764a6e69b)
+
  -- Maarten Lankhorst <maarten.lankho...@ubuntu.com>  Thu, 18 Jul 2013 
13:51:58 +0200
 
 xserver-xorg-video-intel (2:2.21.12-1) UNRELEASED; urgency=low
diff --git a/debian/patches/series b/debian/patches/series
index 9ed72bb..2c1177d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,4 @@
 # empty for now
+sna-note-that-borderClip-region.patch
+sna-fix-typo-in-computing-box.patch
+sna-fall-back-to-proc-cpuinfo.patch
diff --git a/debian/patches/sna-fall-back-to-proc-cpuinfo.patch 
b/debian/patches/sna-fall-back-to-proc-cpuinfo.patch
new file mode 100644
index 0000000..0af1a3b
--- /dev/null
+++ b/debian/patches/sna-fall-back-to-proc-cpuinfo.patch
@@ -0,0 +1,85 @@
+From 7f76a2bf319f59d463a1f96974b03d7c651847dd Mon Sep 17 00:00:00 2001
+From: Chris Wilson <ch...@chris-wilson.co.uk>
+Date: Wed, 17 Jul 2013 09:22:17 +0000
+Subject: sna: Fall back to /proc/cpuinfo parsing if cpuid cache size probe 
fails
+
+Older hardware does not support cache size probing via cpuid4, so we
+need to implement the older algorithm which requires a table based
+lookup. (And in hindsight, why I thought cache probing via cpuid to be
+quite hairy.) For the moment, just use the value found in /proc/cpuinfo.
+
+Reported-by: Oscar Dario Trujillo Tejada <oscard...@gmail.com>
+Reported-by: Ferry Toth <ft...@telfort.nl>
+Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
+---
+diff --git a/src/sna/kgem.c b/src/sna/kgem.c
+index 605e049..0054cdf 100644
+--- a/src/sna/kgem.c
++++ b/src/sna/kgem.c
+@@ -698,7 +698,7 @@ total_ram_size(void)
+ }
+ 
+ static unsigned
+-cpu_cache_size(void)
++cpu_cache_size__cpuid4(void)
+ {
+       /* Deterministic Cache Parmaeters (Function 04h)":
+        *    When EAX is initialized to a value of 4, the CPUID instruction
+@@ -740,6 +740,39 @@ cpu_cache_size(void)
+        return llc_size;
+ }
+ 
++static unsigned
++cpu_cache_size(void)
++{
++      unsigned size;
++      FILE *file;
++
++      size = cpu_cache_size__cpuid4();
++      if (size)
++              return size;
++
++      file = fopen("/proc/cpuinfo", "r");
++      if (file) {
++              size_t len = 0;
++              char *line = NULL;
++              while (getline(&line, &len, file) != -1) {
++                      int kb;
++                      if (sscanf(line, "cache size : %d KB", &kb) == 1) {
++                              /* Paranoid check against gargantuan caches */
++                              if (kb <= 1<<20)
++                                      size = kb * 1024;
++                              break;
++                      }
++              }
++              free(line);
++              fclose(file);
++      }
++
++      if (size == 0)
++              size = 64 * 1024;
++
++      return size;
++}
++
+ static int gem_param(struct kgem *kgem, int name)
+ {
+       drm_i915_getparam_t gp;
+@@ -1242,6 +1275,7 @@ void kgem_init(struct kgem *kgem, int fd, struct 
pci_device *dev, unsigned gen)
+               kgem->buffer_size = kgem->half_cpu_cache_pages << 12;
+       DBG(("%s: buffer size=%d [%d KiB]\n", __FUNCTION__,
+            kgem->buffer_size, kgem->buffer_size / 1024));
++      assert(kgem->buffer_size);
+ 
+       kgem->max_object_size = 3 * (kgem->aperture_high >> 12) << 10;
+       kgem->max_gpu_size = kgem->max_object_size;
+@@ -5616,6 +5650,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
+               alloc = ALIGN(size, kgem->buffer_size);
+       if (alloc > MAX_CACHE_SIZE)
+               alloc = PAGE_ALIGN(size);
++      assert(alloc);
+ 
+       if (alloc > kgem->aperture_mappable / 4)
+               flags &= ~KGEM_BUFFER_INPLACE;
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/debian/patches/sna-fix-typo-in-computing-box.patch 
b/debian/patches/sna-fix-typo-in-computing-box.patch
new file mode 100644
index 0000000..f5214f8
--- /dev/null
+++ b/debian/patches/sna-fix-typo-in-computing-box.patch
@@ -0,0 +1,77 @@
+From a764a6e69b23f644957cf3e4e98868464f458758 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <ch...@chris-wilson.co.uk>
+Date: Wed, 17 Jul 2013 09:51:56 +0000
+Subject: sna: Fix typo in computing box intersection
+
+Comparing y2 against y1 for the intersection was a silly typo,
+especially as the routine for computing the intersection already
+existed.
+
+Fixes regression in commit 34c9b759fbab8d548108e954d55de38c6f5bec31
+Author: Chris Wilson <ch...@chris-wilson.co.uk>
+Date:   Tue Jul 16 19:39:37 2013 +0100
+
+    sna: Note that borderClip region may be more than a singular box
+
+Reported-by: Clemens Eisserer <linuxhi...@gmail.com>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66991
+Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
+---
+diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
+index 994e993..77233cd 100644
+--- a/src/sna/sna_accel.c
++++ b/src/sna/sna_accel.c
+@@ -5524,44 +5524,18 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
+                * VT is inactive, make sure the region isn't empty
+                */
+               assert(!w->winSize.data);
+-
+-              if (region.extents.x1 < w->winSize.extents.x1)
+-                      region.extents.x1 = w->winSize.extents.x1;
+-              if (region.extents.y1 < w->winSize.extents.y1)
+-                      region.extents.y1 = w->winSize.extents.y1;
+-
+-              if (region.extents.x2 > w->winSize.extents.x2)
+-                      region.extents.x2 = w->winSize.extents.x2;
+-              if (region.extents.y2 > w->winSize.extents.y1)
+-                      region.extents.y2 = w->winSize.extents.y2;
+-
+-              if (w->borderClip.data == NULL) {
+-                      if (region.extents.x1 < w->borderClip.extents.x1)
+-                              region.extents.x1 = w->borderClip.extents.x1;
+-                      if (region.extents.y1 < w->borderClip.extents.y1)
+-                              region.extents.y1 = w->borderClip.extents.y1;
+-
+-                      if (region.extents.x2 > w->borderClip.extents.x2)
+-                              region.extents.x2 = w->borderClip.extents.x2;
+-                      if (region.extents.y2 > w->borderClip.extents.y1)
+-                              region.extents.y2 = w->borderClip.extents.y2;
+-              } else
++              box_intersect(&region.extents, &w->winSize.extents);
++              if (w->borderClip.data == NULL)
++                      box_intersect(&region.extents, &w->borderClip.extents);
++              else
+                       clip = &w->borderClip;
+       } else {
+               WindowPtr w = (WindowPtr)src;
+ 
+               DBG(("%s: window clip\n", __FUNCTION__));
+-              if (w->clipList.data == NULL) {
+-                      if (region.extents.x1 < w->clipList.extents.x1)
+-                              region.extents.x1 = w->clipList.extents.x1;
+-                      if (region.extents.y1 < w->clipList.extents.y1)
+-                              region.extents.y1 = w->clipList.extents.y1;
+-
+-                      if (region.extents.x2 > w->clipList.extents.x2)
+-                              region.extents.x2 = w->clipList.extents.x2;
+-                      if (region.extents.y2 > w->clipList.extents.y1)
+-                              region.extents.y2 = w->clipList.extents.y2;
+-              } else
++              if (w->clipList.data == NULL)
++                      box_intersect(&region.extents, &w->clipList.extents);
++              else
+                       clip = &w->clipList;
+       }
+       if (clip == NULL) {
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/debian/patches/sna-note-that-borderClip-region.patch 
b/debian/patches/sna-note-that-borderClip-region.patch
new file mode 100644
index 0000000..3bf3f35
--- /dev/null
+++ b/debian/patches/sna-note-that-borderClip-region.patch
@@ -0,0 +1,90 @@
+From 34c9b759fbab8d548108e954d55de38c6f5bec31 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <ch...@chris-wilson.co.uk>
+Date: Tue, 16 Jul 2013 18:39:37 +0000
+Subject: sna: Note that borderClip region may be more than a singular box
+
+If the child is obscured, then borderClip will contain a list of valid
+boxes rather a singular extents. I thought this was covered by the
+clipList, but I was wrong.
+
+Reported-by: Jesse Barnes <jbar...@virtuousgeek.org>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66970
+Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
+---
+diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
+index fa28b6d..994e993 100644
+--- a/src/sna/sna_accel.c
++++ b/src/sna/sna_accel.c
+@@ -5523,32 +5523,46 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
+                * XFree86 DDX empties the border clip when the
+                * VT is inactive, make sure the region isn't empty
+                */
+-              if (w->parent || RegionNil(&w->borderClip)) {
+-                      int16_t v;
+-
+-                      v = max(w->borderClip.extents.x1,
+-                              w->winSize.extents.x1);
+-                      if (region.extents.x1 < v)
+-                              region.extents.x1 = v;
+-
+-                      v = max(w->borderClip.extents.y1,
+-                              w->winSize.extents.y1);
+-                      if (region.extents.y1 < v)
+-                              region.extents.y1 = v;
+-
+-                      v = min(w->borderClip.extents.x2,
+-                              w->winSize.extents.x2);
+-                      if (region.extents.x2 > v)
+-                              region.extents.x2 = v;
+-
+-                      v = min(w->borderClip.extents.y2,
+-                              w->winSize.extents.y2);
+-                      if (region.extents.y2 > v)
+-                              region.extents.y2 = v;
+-              }
++              assert(!w->winSize.data);
++
++              if (region.extents.x1 < w->winSize.extents.x1)
++                      region.extents.x1 = w->winSize.extents.x1;
++              if (region.extents.y1 < w->winSize.extents.y1)
++                      region.extents.y1 = w->winSize.extents.y1;
++
++              if (region.extents.x2 > w->winSize.extents.x2)
++                      region.extents.x2 = w->winSize.extents.x2;
++              if (region.extents.y2 > w->winSize.extents.y1)
++                      region.extents.y2 = w->winSize.extents.y2;
++
++              if (w->borderClip.data == NULL) {
++                      if (region.extents.x1 < w->borderClip.extents.x1)
++                              region.extents.x1 = w->borderClip.extents.x1;
++                      if (region.extents.y1 < w->borderClip.extents.y1)
++                              region.extents.y1 = w->borderClip.extents.y1;
++
++                      if (region.extents.x2 > w->borderClip.extents.x2)
++                              region.extents.x2 = w->borderClip.extents.x2;
++                      if (region.extents.y2 > w->borderClip.extents.y1)
++                              region.extents.y2 = w->borderClip.extents.y2;
++              } else
++                      clip = &w->borderClip;
+       } else {
++              WindowPtr w = (WindowPtr)src;
++
+               DBG(("%s: window clip\n", __FUNCTION__));
+-              clip = &((WindowPtr)src)->clipList;
++              if (w->clipList.data == NULL) {
++                      if (region.extents.x1 < w->clipList.extents.x1)
++                              region.extents.x1 = w->clipList.extents.x1;
++                      if (region.extents.y1 < w->clipList.extents.y1)
++                              region.extents.y1 = w->clipList.extents.y1;
++
++                      if (region.extents.x2 > w->clipList.extents.x2)
++                              region.extents.x2 = w->clipList.extents.x2;
++                      if (region.extents.y2 > w->clipList.extents.y1)
++                              region.extents.y2 = w->clipList.extents.y2;
++              } else
++                      clip = &w->clipList;
+       }
+       if (clip == NULL) {
+               DBG(("%s: fast source clip against extents\n", __FUNCTION__));
+--
+cgit v0.9.0.2-2-gbebe


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1v0edl-0002t2...@vasks.debian.org

Reply via email to