[xorg-x11-server] vbe memcpy fix

Adam Jackson ajax at fedoraproject.org
Mon Oct 4 16:10:41 UTC 2010


commit 755a6a3fed7bf65b002bbed6a319aa6d9821bace
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 4 12:10:47 2010 -0400

    vbe memcpy fix

 xorg-x11-server.spec             |    7 +++-
 xserver-1.9.0-vbe-insanity.patch |   86 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+), 1 deletions(-)
---
diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec
index aa5521d..873f05f 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.9.0
-Release:   11%{?gitdate:.%{gitdate}}%{dist}
+Release:   12%{?gitdate:.%{gitdate}}%{dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X
@@ -101,6 +101,8 @@ Patch7000: xserver-1.8.0-no-xorg.patch
 Patch7001: xserver-1.9.0-tcflush-fix.patch
 # 632805
 Patch7002: xserver-1.9.0-vbe-panelid-sanity.patch
+# misc
+Patch7003: xserver-1.9.0-vbe-insanity.patch
 
 %define moduledir	%{_libdir}/xorg/modules
 %define drimoduledir	%{_libdir}/dri
@@ -558,6 +560,9 @@ rm -rf $RPM_BUILD_ROOT
 %{xserver_source_dir}
 
 %changelog
+* Mon Oct 04 2010 Adam Jackson <ajax at redhat.com> 1.9.0-12
+- xserver-1.9.0-vbe-insanity.patch: Fix VBE < 3.0 support.
+
 * Wed Sep 29 2010 jkeating - 1.9.0-11
 - Rebuilt for gcc bug 634757
 
diff --git a/xserver-1.9.0-vbe-insanity.patch b/xserver-1.9.0-vbe-insanity.patch
new file mode 100644
index 0000000..e01c707
--- /dev/null
+++ b/xserver-1.9.0-vbe-insanity.patch
@@ -0,0 +1,86 @@
+From f387f31ec3fe796610c2d615b4417ead87361fcd Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax at redhat.com>
+Date: Mon, 4 Oct 2010 12:09:15 -0400
+Subject: [PATCH] vbe: Fix VBE < 3.0 support
+
+Signed-off-by: Adam Jackson <ajax at redhat.com>
+---
+ hw/xfree86/vbe/vbe.c |   62 +-------------------------------------------------
+ 1 files changed, 1 insertions(+), 61 deletions(-)
+
+diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
+index 1defd9a..8c738e7 100644
+--- a/hw/xfree86/vbe/vbe.c
++++ b/hw/xfree86/vbe/vbe.c
+@@ -529,67 +529,7 @@ VBEGetModeInfo(vbeInfoPtr pVbe, int mode)
+ 
+     block = calloc(sizeof(VbeModeInfoBlock), 1);
+ 
+-    block->ModeAttributes = *(CARD16*)pVbe->memory;
+-    block->WinAAttributes = ((char*)pVbe->memory)[2];
+-    block->WinBAttributes = ((char*)pVbe->memory)[3];
+-    block->WinGranularity = *(CARD16*)(((char*)pVbe->memory) + 4);
+-    block->WinSize = *(CARD16*)(((char*)pVbe->memory) + 6);
+-    block->WinASegment = *(CARD16*)(((char*)pVbe->memory) + 8);
+-    block->WinBSegment = *(CARD16*)(((char*)pVbe->memory) + 10);
+-    block->WinFuncPtr = *(CARD32*)(((char*)pVbe->memory) + 12);
+-    block->BytesPerScanline = *(CARD16*)(((char*)pVbe->memory) + 16);
+-
+-    /* mandatory information for VBE 1.2 and above */
+-    block->XResolution = *(CARD16*)(((char*)pVbe->memory) + 18);
+-    block->YResolution = *(CARD16*)(((char*)pVbe->memory) + 20);
+-    block->XCharSize = ((char*)pVbe->memory)[22];
+-    block->YCharSize = ((char*)pVbe->memory)[23];
+-    block->NumberOfPlanes = ((char*)pVbe->memory)[24];
+-    block->BitsPerPixel = ((char*)pVbe->memory)[25];
+-    block->NumberOfBanks = ((char*)pVbe->memory)[26];
+-    block->MemoryModel = ((char*)pVbe->memory)[27];
+-    block->BankSize = ((char*)pVbe->memory)[28];
+-    block->NumberOfImages = ((char*)pVbe->memory)[29];
+-    block->Reserved = ((char*)pVbe->memory)[30];
+-
+-    /* Direct color fields (required for direct/6 and YUV/7 memory models) */
+-    block->RedMaskSize = ((char*)pVbe->memory)[31];
+-    block->RedFieldPosition = ((char*)pVbe->memory)[32];
+-    block->GreenMaskSize = ((char*)pVbe->memory)[33];
+-    block->GreenFieldPosition = ((char*)pVbe->memory)[34];
+-    block->BlueMaskSize = ((char*)pVbe->memory)[35];
+-    block->BlueFieldPosition = ((char*)pVbe->memory)[36];
+-    block->RsvdMaskSize = ((char*)pVbe->memory)[37];
+-    block->RsvdFieldPosition = ((char*)pVbe->memory)[38];
+-    block->DirectColorModeInfo = ((char*)pVbe->memory)[39];
+-
+-    /* Mandatory information for VBE 2.0 and above */
+-    if (pVbe->version >= 0x200) {
+-	block->PhysBasePtr = *(CARD32*)(((char*)pVbe->memory) + 40);
+-	block->Reserved32 = *(CARD32*)(((char*)pVbe->memory) + 44);
+-	block->Reserved16 = *(CARD16*)(((char*)pVbe->memory) + 48);
+-
+-	/* Mandatory information for VBE 3.0 and above */
+-	if (pVbe->version >= 0x300) {
+-	    block->LinBytesPerScanLine = *(CARD16*)(((char*)pVbe->memory) + 50);
+-	    block->BnkNumberOfImagePages = ((char*)pVbe->memory)[52];
+-	    block->LinNumberOfImagePages = ((char*)pVbe->memory)[53];
+-	    block->LinRedMaskSize = ((char*)pVbe->memory)[54];
+-	    block->LinRedFieldPosition = ((char*)pVbe->memory)[55];
+-	    block->LinGreenMaskSize = ((char*)pVbe->memory)[56];
+-	    block->LinGreenFieldPosition = ((char*)pVbe->memory)[57];
+-	    block->LinBlueMaskSize = ((char*)pVbe->memory)[58];
+-	    block->LinBlueFieldPosition = ((char*)pVbe->memory)[59];
+-	    block->LinRsvdMaskSize = ((char*)pVbe->memory)[60];
+-	    block->LinRsvdFieldPosition = ((char*)pVbe->memory)[61];
+-	    block->MaxPixelClock = *(CARD32*)(((char*)pVbe->memory) + 62);
+-	    memcpy(&block->Reserved2, ((char*)pVbe->memory) + 66, 188);
+-	}
+-	else
+-	memcpy(&block->LinBytesPerScanLine, ((char*)pVbe->memory) + 50, 206);
+-    }
+-    else
+-	memcpy(&block->PhysBasePtr, ((char*)pVbe->memory) + 40, 216);
++    memcpy(block, pVbe->memory, 256);
+ 
+     return block;
+ }
+-- 
+1.7.2.3
+


More information about the scm-commits mailing list