rpms/xorg-x11-drv-ark/devel ark-pciaccess.patch, NONE, 1.1 xorg-x11-drv-ark.spec, 1.17, 1.18

Dave Airlie (airlied) fedora-extras-commits at redhat.com
Mon Mar 10 01:21:53 UTC 2008


Author: airlied

Update of /cvs/pkgs/rpms/xorg-x11-drv-ark/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32271

Modified Files:
	xorg-x11-drv-ark.spec 
Added Files:
	ark-pciaccess.patch 
Log Message:
* Mon Mar 10 2008 Dave Airlie <airlied at redhat.com> - 0.6.0-8
- Rebuild with pciaccess fixes.


ark-pciaccess.patch:

--- NEW FILE ark-pciaccess.patch ---
commit c87ab37ba6b06d81f024800f776cd20ff5a3a5b1
Author: Dave Airlie <airlied at clockmaker.usersys.redhat.com>
Date:   Mon Mar 10 10:13:42 2008 +1000

    ark: add basic pciaccess support

diff --git a/configure.ac b/configure.ac
index 87a7472..71a35cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,10 +62,23 @@ AC_SUBST([CFLAGS])
 AC_SUBST([INCLUDES])
 
 # Checks for libraries.
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
+AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
+              [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
+              [#include "xorg-server.h"])
+CPPFLAGS="$SAVE_CPPFLAGS"
 
 # Checks for header files.
 AC_HEADER_STDC
 
+if test "x$XSERVER_LIBPCIACCESS" = xyes; then
+    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
+fi
+AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+
+
 DRIVER_NAME=ark
 AC_SUBST([DRIVER_NAME])
 
diff --git a/src/ark.h b/src/ark.h
index eed1553..fbbef48 100644
--- a/src/ark.h
+++ b/src/ark.h
@@ -27,8 +27,12 @@ typedef struct _ARKRegRec {
 
 
 typedef struct _ARKRec {
+#ifndef XSERVER_LIBPCIACCESS	
 	pciVideoPtr		PciInfo;
 	PCITAG			PciTag;
+#else
+	struct pci_device       *PciInfo;
+#endif
 	EntityInfoPtr		pEnt;
 	CARD32			IOAddress;
 	CARD32			FBAddress;
diff --git a/src/ark_driver.c b/src/ark_driver.c
index e5ee7e5..24418ff 100644
--- a/src/ark_driver.c
+++ b/src/ark_driver.c
@@ -366,7 +366,11 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags)
 		xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
 			   pARK->Chipset);
 	} else {
+#ifndef XSERVER_LIBPCIACCESS
 		pARK->Chipset = pARK->PciInfo->chipType;
+#else
+		pARK->Chipset = pARK->PciInfo->device_id;
+#endif
 		pScrn->chipset = (char *)xf86TokenToString(ARKChipsets,
 							   pARK->Chipset);
 	}
@@ -375,15 +379,21 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags)
 		pARK->ChipRev = pEnt->device->chipRev;
 		xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
 			   pARK->ChipRev);
-	} else
+	} else {
+#ifndef XSERVER_LIBPCIACCESS
 		pARK->ChipRev = pARK->PciInfo->chipRev;
-
+#else
+		pARK->ChipRev = pARK->PciInfo->revision;
+#endif
+	}
 	xfree(pEnt);
 
 	xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset);
 
+#ifndef XSERVER_LIBPCIACCESS
 	pARK->PciTag = pciTag(pARK->PciInfo->bus, pARK->PciInfo->device,
 			      pARK->PciInfo->func);
+#endif
 
 	/* unlock CRTC[0-7] */
 	outb(hwp->PIOOffset + hwp->IOBase + 4, 0x11);
@@ -1048,12 +1058,32 @@ static Bool ARKMapMem(ScrnInfoPtr pScrn)
 	/* extended to cover MMIO space at 0xB8000 */
 	hwp->MapSize = 0x20000;
 
+#ifndef XSERVER_LIBPCIACCESS
 	pARK->MMIOBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO,
 					     pARK->PciTag, 0xb8000, 0x8000);
 
 	pARK->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
 				     pARK->PciTag, pARK->FBAddress,
 				     pScrn->videoRam * 1024);
+#else
+
+	pARK->MMIOBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO,
+					     pARK->PciInfo, 0xb8000, 0x8000);
+
+	{
+		void** result = (void**)&pARK->FBBase;
+		int err = pci_device_map_range(pARK->PciInfo,
+					       pARK->FBAddress,
+					       pScrn->videoRam * 1024,
+					       PCI_DEV_MAP_FLAG_WRITABLE |
+					       PCI_DEV_MAP_FLAG_WRITE_COMBINE,
+					       result);
+		
+		if (err) 
+			return FALSE;
+	}
+#endif
+
 	if (!pARK->FBBase) {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			   "Cound not map framebuffer\n");
@@ -1071,8 +1101,12 @@ static void ARKUnmapMem(ScrnInfoPtr pScrn)
 	/* XXX vgaHWMapMem() isn't called explicitly, so is this correct? */
 	vgaHWUnmapMem(pScrn);
 
+#ifndef XSERVER_LIBPCIACCESS
 	xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pARK->FBBase,
 			pScrn->videoRam * 1024);
+#else
+	pci_device_unmap_range(pARK->PciInfo, pARK->FBBase, pScrn->videoRam * 1024);
+#endif
 }
 
 


Index: xorg-x11-drv-ark.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-ark/devel/xorg-x11-drv-ark.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- xorg-x11-drv-ark.spec	20 Feb 2008 07:08:14 -0000	1.17
+++ xorg-x11-drv-ark.spec	10 Mar 2008 01:21:18 -0000	1.18
@@ -5,7 +5,7 @@
 Summary:   Xorg X11 ark video driver
 Name:      xorg-x11-drv-ark
 Version:   0.6.0
-Release:   7%{?dist}
+Release:   8%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -14,8 +14,11 @@
 Source0:   ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2
 Source1:   ark.xinf
 
+Patch0: ark-pciaccess.patch
+
 ExcludeArch: s390 s390x
 
+BuildRequires: automake autoconf libtool
 BuildRequires: xorg-x11-server-sdk >= 1.3.0.0-6
 
 Requires:  hwdata
@@ -27,7 +30,10 @@
 %prep
 %setup -q -n %{tarball}-%{version}
 
+%patch0 -p1 -b .pciaccess
+
 %build
+autoreconf -v --install
 %configure --disable-static
 make
 
@@ -51,6 +57,9 @@
 %{_datadir}/hwdata/videoaliases/ark.xinf
 
 %changelog
+* Mon Mar 10 2008 Dave Airlie <airlied at redhat.com> - 0.6.0-8
+- Rebuild with pciaccess fixes.
+
 * Wed Feb 20 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 0.6.0-7
 - Autorebuild for GCC 4.3
 




More information about the fedora-extras-commits mailing list