[xorg-x11-server/f15/master] backport upstream DRI2 fixes that are being screwed around with upstream
Dave Airlie
airlied at fedoraproject.org
Thu Apr 28 03:40:46 UTC 2011
commit 37754a8990d7c1d06629b3773cc597ff49a5c6c6
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Apr 28 13:45:09 2011 +1000
backport upstream DRI2 fixes that are being screwed around with upstream
xorg-x11-server.spec | 8 +++-
xserver-1.10.1-dri2-fixes.patch | 79 +++++++++++++++++++++++++++++++++++++++
2 files changed, 86 insertions(+), 1 deletions(-)
---
diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec
index 03d9999..24f4128 100644
--- a/xorg-x11-server.spec
+++ b/xorg-x11-server.spec
@@ -30,7 +30,7 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.10.1
-Release: 13%{?gitdate:.%{gitdate}}%{dist}
+Release: 14%{?gitdate:.%{gitdate}}%{dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X
@@ -99,6 +99,9 @@ Patch7012: xserver-1.10-dix-only-transform-valuators-when-we-need-them.patch
# ditto
Patch7013: xserver-1.10.1-memcpy-abuse.patch
+# upstream backports
+Patch7015: xserver-1.10.1-dri2-fixes.patch
+
%define moduledir %{_libdir}/xorg/modules
%define drimoduledir %{_libdir}/dri
%define sdkdir %{_includedir}/xorg
@@ -563,6 +566,9 @@ rm -rf $RPM_BUILD_ROOT
%{xserver_source_dir}
%changelog
+* Thu Apr 28 2011 Dave Airlie <airlied at redhat.com> 1.10.1-14
+- backport upstream DRI2 fixes that are being screwed around with upstream
+
* Thu Apr 21 2011 Adam Jackson <ajax at redhat.com> 1.10.1-13
- xserver-1.10.1-memcpy-abuse.patch: Fix memcpy abuse
diff --git a/xserver-1.10.1-dri2-fixes.patch b/xserver-1.10.1-dri2-fixes.patch
new file mode 100644
index 0000000..b27815a
--- /dev/null
+++ b/xserver-1.10.1-dri2-fixes.patch
@@ -0,0 +1,79 @@
+From 17fb37f3b81aa3575a1549ced11da9022e439246 Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp at keithp.com>
+Date: Thu, 28 Apr 2011 13:34:28 +1000
+Subject: [PATCH] dri2: Invalidate DRI2 buffers for all windows with the same
+ pixmap on swap
+
+Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35452 .
+
+JFDI already.
+
+Tested-by: Ian Pilcher <arequipeno at gmail.com>
+Reviewed-by: Dave Airlie <airlied at redhat.com>
+
+fix 2
+---
+ hw/xfree86/dri2/dri2.c | 33 ++++++++++++++++++++++++++++++++-
+ 1 files changed, 32 insertions(+), 1 deletions(-)
+
+diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
+index 5c42a51..85c9764 100644
+--- a/hw/xfree86/dri2/dri2.c
++++ b/hw/xfree86/dri2/dri2.c
+@@ -343,6 +343,7 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
+ int old_buf = find_attachment(pPriv, attachment);
+
+ if ((old_buf < 0)
++ || attachment == DRI2BufferFrontLeft
+ || !dimensions_match
+ || (pPriv->buffers[old_buf]->format != format)) {
+ *buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
+@@ -786,6 +787,20 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
+ return FALSE;
+ }
+
++/*
++ * A TraverseTree callback to invalidate all windows using the same
++ * pixmap
++ */
++
++static int
++DRI2InvalidateWalk(WindowPtr pWin, pointer data)
++{
++ if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data)
++ return WT_DONTWALKCHILDREN;
++ DRI2InvalidateDrawable(&pWin->drawable);
++ return WT_WALKCHILDREN;
++}
++
+ int
+ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
+ CARD64 divisor, CARD64 remainder, CARD64 *swap_target,
+@@ -886,7 +901,23 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
+ */
+ *swap_target = pPriv->swap_count + pPriv->swapsPending;
+
+- DRI2InvalidateDrawable(pDraw);
++ if (pDraw->type == DRAWABLE_WINDOW) {
++ WindowPtr pWin = (WindowPtr) pDraw;
++ PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin);
++
++ /*
++ * Find the top-most window using this pixmap
++ */
++ while (pWin->parent && pScreen->GetWindowPixmap(pWin->parent) == pPixmap)
++ pWin = pWin->parent;
++
++ /*
++ * Walk the sub-tree to invalidate all of the
++ * windows using the same pixmap
++ */
++ TraverseTree(pWin, DRI2InvalidateWalk, pPixmap);
++ } else
++ DRI2InvalidateDrawable(pDraw);
+
+ return Success;
+ }
+--
+1.7.4.4
+
More information about the scm-commits
mailing list