[xorg-x11-drv-geode] Fix Xv packed video corruption
Daniel Drake
dsd at fedoraproject.org
Mon Feb 7 13:35:02 UTC 2011
commit 5168712dec80b3aea2c887bee480ed97fcd8bce0
Author: Daniel Drake <dsd at laptop.org>
Date: Mon Feb 7 13:38:05 2011 +0000
Fix Xv packed video corruption
geode-2.11.4.1-d8baf45eb.patch | 781 ----------------------------------------
xorg-x11-drv-geode.spec | 9 +-
xv-packed-corruption.patch | 53 +++
3 files changed, 60 insertions(+), 783 deletions(-)
---
diff --git a/xorg-x11-drv-geode.spec b/xorg-x11-drv-geode.spec
index 4eb95d0..00f27f2 100644
--- a/xorg-x11-drv-geode.spec
+++ b/xorg-x11-drv-geode.spec
@@ -5,9 +5,10 @@
Summary: Xorg X11 AMD Geode video driver
Name: xorg-x11-drv-geode
Version: 2.11.11
-Release: 2%{?dist}
+Release: 3%{?dist}
URL: http://www.x.org/wiki/AMDGeodeDriver
Source0: http://xorg.freedesktop.org/releases/individual/driver/xf86-video-geode-%{version}.tar.bz2
+Patch0: xv-packed-corruption.patch
License: MIT
Group: User Interface/X Hardware Support
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -32,6 +33,7 @@ X.Org X11 AMD Geode video driver.
%prep
%setup -q -n %{tarball}-%{version}
+%patch0 -p1
%build
%configure --disable-static --libdir=%{_libdir} --mandir=%{_mandir} \
@@ -60,7 +62,10 @@ rm -rf $RPM_BUILD_ROOT
%{driverdir}/ztv_drv.so
%changelog
-* Thu Jan 13 2011 Daniel Drake <dsd at laptop.org> - 2.11.11-1
+* Mon Feb 7 2011 Daniel Drake <dsd at laptop.org> - 2.11.11-3
+- add upstream patch to fix Xv video corruption (fd.o #33004)
+
+* Thu Jan 13 2011 Daniel Drake <dsd at laptop.org> - 2.11.11-2
- update to 2.11.11
* Sun Dec 12 2010 Daniel Drake <dsd at laptop.org> - 2.11.10-2
diff --git a/xv-packed-corruption.patch b/xv-packed-corruption.patch
new file mode 100644
index 0000000..6410524
--- /dev/null
+++ b/xv-packed-corruption.patch
@@ -0,0 +1,53 @@
+From 509f6085ce7747d76f638a7a30170c437b296a40 Mon Sep 17 00:00:00 2001
+From: Daniel Drake <dsd at laptop.org>
+Date: Sun, 6 Feb 2011 20:22:01 +0000
+Subject: [PATCH] Fix packed overlay offscreen allocations
+
+Commit 5e72a00ad2 caused packed video data to corrupt glyphs and other
+parts of the screen, but it turns out that the commit actually at fault
+was d681a844e, incorrectly changing the size of the allocated destination
+memory from the number of bytes needed to the number of lines needed.
+
+While fixing this, I noticed that LXAllocateSurface is probably making the
+same mistake, and that the height is probably not calculated correctly for
+some corner cases when calling LXCopyFromSys in the packed
+video path (but I'm not sure about either).
+
+Fixes https://bugs.freedesktop.org/show_bug.cgi?id=33004
+---
+ src/lx_video.c | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/src/lx_video.c b/src/lx_video.c
+index 7b51c5b..35e3ffa 100644
+--- a/src/lx_video.c
++++ b/src/lx_video.c
+@@ -302,7 +302,7 @@ LXCopyPacked(ScrnInfoPtr pScrni, int id, unsigned char *buf,
+
+ lines = ((dstPitch * height) + pGeode->Pitch - 1) / pGeode->Pitch;
+
+- if (LXAllocateVidMem(pScrni, pPriv, lines) == FALSE) {
++ if (LXAllocateVidMem(pScrni, pPriv, dstPitch * height) == FALSE) {
+ ErrorF("Error allocating an offscreen Packed region.\n");
+ return FALSE;
+ }
+@@ -334,6 +334,7 @@ LXCopyPacked(ScrnInfoPtr pScrni, int id, unsigned char *buf,
+ GeodeCopyGreyscale(buf + srcOffset, pGeode->FBBase + dstOffset,
+ srcPitch, dstPitch, height, pixels >> 1);
+ } else
++ /* FIXME: should lines be used here instead of height? */
+ LXCopyFromSys(pGeode, buf + srcOffset, dstOffset, dstPitch, srcPitch,
+ height, pixels);
+
+@@ -818,6 +819,8 @@ LXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w,
+ pitch = ((w << 1) + 15) & ~15;
+ lines = ((pitch * h) + (pGeode->Pitch - 1)) / pGeode->Pitch;
+
++ /* FIXME: is lines the right parameter to use here,
++ * or should it be height * pitch? */
+ vidmem = exaOffscreenAlloc(pScrni->pScreen, lines, 4, TRUE,
+ NULL, NULL);
+
+--
+1.7.4
+
More information about the scm-commits
mailing list