From 789ffa639b6706876409495ccb2c353aa68b0d45 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Sep 02 2014 19:39:52 +0000 Subject: Backport fix for sna to fix broken shadow rendering in gtk --- diff --git a/0001-sna-trapezoids-Use-the-corrected-trapezoid-origin-fo.patch b/0001-sna-trapezoids-Use-the-corrected-trapezoid-origin-fo.patch new file mode 100644 index 0000000..ecce2ed --- /dev/null +++ b/0001-sna-trapezoids-Use-the-corrected-trapezoid-origin-fo.patch @@ -0,0 +1,126 @@ +From 48a33fc379b17eed195875222ad773c911d9dff1 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Tue, 2 Sep 2014 19:08:36 +0100 +Subject: [PATCH] sna/trapezoids: Use the corrected trapezoid origin for + aligned boxes + +The rule for the origin of the CompositeTrapezoids routine is the +upper-left corner of the first trapezoid. Care must be taken in case the +trapezoid edge is upside down to consider the upper vertex. + +Reported-by: "Jasper St. Pierre" +Signed-off-by: Chris Wilson +--- + src/sna/sna_trapezoids_boxes.c | 42 +++++++++++++++++++++++++++++------------- + 1 file changed, 29 insertions(+), 13 deletions(-) + +diff --git a/src/sna/sna_trapezoids_boxes.c b/src/sna/sna_trapezoids_boxes.c +index 2f7028f..a2045dc 100644 +--- a/src/sna/sna_trapezoids_boxes.c ++++ b/src/sna/sna_trapezoids_boxes.c +@@ -120,13 +120,16 @@ composite_aligned_boxes(struct sna *sna, + BoxRec stack_boxes[64], *boxes; + pixman_region16_t region, clip; + struct sna_composite_op tmp; ++ int16_t dst_x, dst_y; + bool ret = true; + int dx, dy, n, num_boxes; + + if (NO_ALIGNED_BOXES) + return false; + +- DBG(("%s\n", __FUNCTION__)); ++ DBG(("%s: pixmap=%ld, nboxes=%d, dx=(%d, %d)\n", __FUNCTION__, ++ get_drawable_pixmap(dst->pDrawable)->drawable.serialNumber, ++ ntrap, dst->pDrawable->x, dst->pDrawable->y)); + + boxes = stack_boxes; + if (ntrap > (int)ARRAY_SIZE(stack_boxes)) { +@@ -168,19 +171,20 @@ composite_aligned_boxes(struct sna *sna, + if (num_boxes == 0) + goto free_boxes; + +- DBG(("%s: extents (%d, %d), (%d, %d) offset of (%d, %d)\n", ++ trapezoid_origin(&traps[0].left, &dst_x, &dst_y); ++ ++ DBG(("%s: extents (%d, %d), (%d, %d) offset of (%d, %d), origin (%d, %d)\n", + __FUNCTION__, + region.extents.x1, region.extents.y1, + region.extents.x2, region.extents.y2, + region.extents.x1 - boxes[0].x1, +- region.extents.y1 - boxes[0].y1)); +- +- src_x += region.extents.x1 - boxes[0].x1; +- src_y += region.extents.y1 - boxes[0].y1; ++ region.extents.y1 - boxes[0].y1, ++ dst_x, dst_y)); + + if (!sna_compute_composite_region(&clip, + src, NULL, dst, +- src_x, src_y, ++ src_x + region.extents.x1 - dst_x - dx, ++ src_y + region.extents.y1 - dst_y - dy, + 0, 0, + region.extents.x1 - dx, region.extents.y1 - dy, + region.extents.x2 - region.extents.x1, +@@ -193,14 +197,24 @@ composite_aligned_boxes(struct sna *sna, + if (op == PictOpClear && sna->clear) + src = sna->clear; + ++ DBG(("%s: clipped extents (%d, %d), (%d, %d); now offset by (%d, %d), orgin (%d, %d)\n", ++ __FUNCTION__, ++ clip.extents.x1, clip.extents.y1, ++ clip.extents.x2, clip.extents.y2, ++ clip.extents.x1 - boxes[0].x1, ++ clip.extents.y1 - boxes[0].y1, ++ dst_x, dst_y)); ++ + if (force_fallback || + !sna->render.composite(sna, op, src, NULL, dst, +- src_x, src_y, ++ src_x + clip.extents.x1 - dst_x, ++ src_y + clip.extents.y1 - dst_y, + 0, 0, + clip.extents.x1, clip.extents.y1, + clip.extents.x2 - clip.extents.x1, + clip.extents.y2 - clip.extents.y1, +- COMPOSITE_PARTIAL, memset(&tmp, 0, sizeof(tmp)))) { ++ (clip.data || num_boxes > 1) ? COMPOSITE_PARTIAL : 0, ++ memset(&tmp, 0, sizeof(tmp)))) { + unsigned int flags; + const pixman_box16_t *b; + int i, count; +@@ -232,6 +246,8 @@ composite_aligned_boxes(struct sna *sna, + } + + DBG(("%s: fbComposite()\n", __FUNCTION__)); ++ src_x -= dst_x - dx; ++ src_y -= dst_y - dy; + if (maskFormat) { + pixman_region_init_rects(®ion, boxes, num_boxes); + RegionIntersect(®ion, ®ion, &clip); +@@ -241,8 +257,8 @@ composite_aligned_boxes(struct sna *sna, + count = region_num_rects(®ion); + for (i = 0; i < count; i++) { + fbComposite(op, src, NULL, dst, +- src_x + b[i].x1 - boxes[0].x1, +- src_y + b[i].y1 - boxes[0].y1, ++ src_x + b[i].x1, ++ src_y + b[i].y1, + 0, 0, + b[i].x1, b[i].y1, + b[i].x2 - b[i].x1, b[i].y2 - b[i].y1); +@@ -259,8 +275,8 @@ composite_aligned_boxes(struct sna *sna, + if (sigtrap_get() == 0) { + for (i = 0; i < count; i++) { + fbComposite(op, src, NULL, dst, +- src_x + b[i].x1 - boxes[0].x1, +- src_y + b[i].y1 - boxes[0].y1, ++ src_x + b[i].x1, ++ src_y + b[i].y1, + 0, 0, + b[i].x1, b[i].y1, + b[i].x2 - b[i].x1, b[i].y2 - b[i].y1); +-- +1.9.3 + diff --git a/xorg-x11-drv-intel.spec b/xorg-x11-drv-intel.spec index 7d01f0b..b0b2b00 100644 --- a/xorg-x11-drv-intel.spec +++ b/xorg-x11-drv-intel.spec @@ -26,7 +26,7 @@ Summary: Xorg X11 Intel video driver Name: xorg-x11-drv-intel Version: 2.99.914 -Release: 2%{?gitrev}%{?dist} +Release: 3%{?gitrev}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X Hardware Support @@ -40,6 +40,7 @@ Source1: make-intel-gpu-tools-snapshot.sh Source3: http://xorg.freedesktop.org/archive/individual/app/intel-gpu-tools-%{gputoolsver}.tar.bz2 Source4: make-git-snapshot.sh Patch1: 0001-sna-dri3-Mesa-relies-upon-implicit-fences.patch +Patch2: 0001-sna-trapezoids-Use-the-corrected-trapezoid-origin-fo.patch ExclusiveArch: %{ix86} x86_64 ia64 @@ -88,6 +89,7 @@ Debugging tools for Intel graphics chips %prep %setup -q -n xf86-video-intel-%{?gitdate:%{gitdate}}%{!?gitdate:%{dirsuffix}} -b3 %patch1 -p1 +%patch2 -p1 %build %configure %{?kmsonly:--enable-kms-only} @@ -147,6 +149,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libI*XvMC.so %{_mandir}/man1/intel_*.1* %changelog +* Tue Sep 02 2014 Adel Gadllah - 2.99.914-3 +- Backport fix for sna to fix broken shadow rendering in gtk + * Mon Aug 18 2014 Fedora Release Engineering - 2.99.914-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild