diff --git a/openchrome-0.2.901-libpciaccess.patch b/openchrome-0.2.901-libpciaccess.patch index ad4e4ec..a60bc4b 100644 --- a/openchrome-0.2.901-libpciaccess.patch +++ b/openchrome-0.2.901-libpciaccess.patch @@ -61,10 +61,11 @@ Index: configure.ac AM_CONDITIONAL(DEBUG, test x$DEBUG = xyes) if test "$DEBUG" = yes; then AC_DEFINE(HAVE_DEBUG,1,[Enable debug support]) + Index: src/via_driver.c =================================================================== ---- src/via_driver.c (revision 489) -+++ src/via_driver.c (working copy) +--- src/via_driver.c (revision 489) ++++ src/via_driver.c (working copy) @@ -50,7 +50,30 @@ /* Prototypes. */ @@ -167,7 +168,7 @@ Index: src/via_driver.c LoaderRefSymLists(vgaHWSymbols, #ifdef USE_FB fbSymbols, -@@ -500,6 +559,47 @@ +@@ -500,6 +559,46 @@ VIAChipsets); } /* VIAIdentify */ @@ -211,19 +212,10 @@ Index: src/via_driver.c +} +#else /* XSERVER_LIBPCIACCESS */ + -+ static Bool VIAProbe(DriverPtr drv, int flags) { GDevPtr *devSections; -@@ -543,6 +643,7 @@ - for (i = 0; i < numUsed; i++) { - ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0); - EntityInfoPtr pEnt; -+ - if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], - VIAPciChipsets, 0, 0, 0, 0, 0))) - { -@@ -610,6 +711,7 @@ +@@ -610,6 +709,7 @@ return foundScreen; } /* VIAProbe */ @@ -231,7 +223,7 @@ Index: src/via_driver.c #ifdef XF86DRI static void kickVblank(ScrnInfoPtr pScrn) -@@ -756,6 +858,10 @@ +@@ -756,6 +895,10 @@ vgaHWPtr hwp; int i, bMemSize = 0; @@ -242,7 +234,7 @@ Index: src/via_driver.c DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAPreInit\n")); if (pScrn->numEntities > 1) -@@ -939,7 +1045,8 @@ +@@ -939,7 +1082,8 @@ pEnt->device->chipID); } else { from = X_PROBED; @@ -252,7 +244,7 @@ Index: src/via_driver.c pVia->Chipset = LookupChipID(VIAPciChipsets, pVia->ChipId); pScrn->chipset = (char *)xf86TokenToString(VIAChipsets, pVia->Chipset); -@@ -948,12 +1055,20 @@ +@@ -948,12 +1092,20 @@ xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset); if (pEnt->device->chipRev >= 0) { @@ -273,7 +265,42 @@ Index: src/via_driver.c } if (pVia->Chipset == VIA_CLE266) -@@ -1378,8 +1493,10 @@ +@@ -968,19 +1120,34 @@ + switch (pVia->Chipset) { + case VIA_CLE266: + case VIA_KM400: ++#if XSERVER_LIBPCIACCESS ++ pci_device_cfg_read_u32 (bridge, & pScrn->videoRam, 0xE1); ++ pScrn->videoRam = (1 << ( ( pScrn->videoRam & 0x70) >> 4 )) << 10 ; ++#else + pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70 ) >> 4 ) ) << 10 ; + break; ++#endif + case VIA_PM800: + case VIA_VM800: + case VIA_K8M800: ++#if XSERVER_LIBPCIACCESS ++ pci_device_cfg_read_u32 (bridge, & pScrn->videoRam, 0xA1); ++ pScrn->videoRam = (1 << ( ( pScrn->videoRam & 0x70) >> 4 )) << 10 ; ++#else + pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70 ) >> 4 ) ) << 10 ; + break; ++#endif + case VIA_K8M890: + case VIA_P4M890: + case VIA_P4M900: + case VIA_CX700: ++#if XSERVER_LIBPCIACCESS ++ pci_device_cfg_read_u32 (bridge, & pScrn->videoRam, 0xA1); ++ pScrn->videoRam = (1 << ( ( pScrn->videoRam & 0x70) >> 4 )) << 12 ; ++#else + pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70 ) >> 4 ) ) << 12 ; + break; ++#endif + default: + if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, +@@ -1378,8 +1545,10 @@ /* maybe throw in some more sanity checks here */ @@ -284,7 +311,7 @@ Index: src/via_driver.c if (!VIAMapMMIO(pScrn)) { VIAFreeRec(pScrn); -@@ -1407,7 +1524,9 @@ +@@ -1407,7 +1576,9 @@ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "...Finished parsing config file options.\n"); @@ -294,73 +321,7 @@ Index: src/via_driver.c /* Read memory bandwidth from registers */ pVia->MemClk = hwp->readCrtc(hwp, 0x3D) >> 4; -@@ -1440,6 +1559,65 @@ - return FALSE; - } - -+ from = X_PROBED; -+ -+ /* Detect the amount of installed RAM */ -+ switch (pVia->Chipset) { -+ case VIA_CLE266: -+ case VIA_KM400: -+#if XSERVER_LIBPCIACCESS -+ pci_device_cfg_read_u32 (bridge, & pScrn->videoRam, 0xE1); -+ pScrn->videoRam = (1 << ( ( pScrn->videoRam & 0x70) >> 4 )) << 10 ; -+#else -+ pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70 ) >> 4 ) ) << 10 ; -+ break; -+#endif -+ case VIA_PM800: -+ case VIA_VM800: -+ case VIA_K8M800: -+#if XSERVER_LIBPCIACCESS -+ pci_device_cfg_read_u32 (bridge, & pScrn->videoRam, 0xA1); -+ pScrn->videoRam = (1 << ( ( pScrn->videoRam & 0x70) >> 4 )) << 10 ; -+#else -+ pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70 ) >> 4 ) ) << 10 ; -+ break; -+#endif -+ case VIA_K8M890: -+ case VIA_P4M900: -+ case VIA_CX700: -+#if XSERVER_LIBPCIACCESS -+ pci_device_cfg_read_u32 (bridge, & pScrn->videoRam, 0xA1); -+ pScrn->videoRam = (1 << ( ( pScrn->videoRam & 0x70) >> 4 )) << 12 ; -+#else -+ pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70 ) >> 4 ) ) << 12 ; -+ break; -+#endif -+ default: -+ if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536) { -+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, -+ "Using old memory-detection method."); -+ bMemSize = hwp->readSeq(hwp, 0x39); -+ if (bMemSize > 16 && bMemSize <= 128) -+ pScrn->videoRam = (bMemSize + 1) << 9; -+ else if (bMemSize > 0 && bMemSize < 31) -+ pScrn->videoRam = bMemSize << 12; -+ else { -+ from = X_DEFAULT; -+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, -+ "Memory size detection failed: using 16 MB.\n"); -+ pScrn->videoRam = 16 << 10; -+ } -+ } else { -+ from = X_DEFAULT; -+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, -+ "No memory-detection done. Use VideoRAM option."); -+ } -+ } -+ -+ if (from == X_PROBED) -+ xf86DrvMsg(pScrn->scrnIndex, from, "Probed VideoRAM = %d kB\n", -+ pScrn->videoRam); -+ - /* Split FB for SAMM */ - /* FIXME: For now, split FB into two equal sections. This should - * be able to be adjusted by user with a config option. */ -@@ -2046,27 +2224,75 @@ +@@ -2046,26 +2217,74 @@ VIAMapMMIO(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); @@ -391,7 +352,7 @@ Index: src/via_driver.c + (PCI_DEV_MAP_FLAG_WRITABLE + |PCI_DEV_MAP_FLAG_WRITE_COMBINE), + (void **) &pVia->MapBase); - ++ + if (err) + { + xf86DrvMsg (pScrn->scrnIndex, X_ERROR, @@ -406,7 +367,7 @@ Index: src/via_driver.c + if (!pVia->MapBase) + return FALSE; + #endif -+ + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "mapping BitBlt MMIO @ 0x%lx with size 0x%x\n", pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE); @@ -421,7 +382,7 @@ Index: src/via_driver.c + (PCI_DEV_MAP_FLAG_WRITABLE + |PCI_DEV_MAP_FLAG_WRITE_COMBINE), + (void **) &pVia->BltBase); - ++ + if (err) + { + xf86DrvMsg (pScrn->scrnIndex, X_ERROR, @@ -437,11 +398,10 @@ Index: src/via_driver.c + if (!pVia->BltBase) + return FALSE; + #endif -+ + if (!pVia->MapBase || !pVia->BltBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Internal error: cound not map registers\n"); -@@ -2111,6 +2337,9 @@ +@@ -2111,6 +2330,9 @@ VIAMapFB(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); @@ -451,7 +411,7 @@ Index: src/via_driver.c DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAMapFB\n")); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, -@@ -2125,6 +2354,7 @@ +@@ -2125,6 +2347,7 @@ * in the OS support layer. */ @@ -459,7 +419,7 @@ Index: src/via_driver.c unsigned char *tmp; tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, pVia->FrameBufferBase, -@@ -2143,10 +2373,24 @@ +@@ -2143,10 +2366,24 @@ xf86UnMapVidMem(pScrn->scrnIndex, (pointer)tmp, pVia->videoRambytes); @@ -484,7 +444,7 @@ Index: src/via_driver.c pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, pVia->PciTag, pVia->FrameBufferBase, pVia->videoRambytes); -@@ -2156,6 +2400,7 @@ +@@ -2156,6 +2393,7 @@ "Internal error: could not map framebuffer\n"); return FALSE; } @@ -492,7 +452,7 @@ Index: src/via_driver.c pVia->FBFreeStart = (pScrn->displayWidth * pScrn->bitsPerPixel >> 3) * pScrn->virtualY; -@@ -2166,7 +2411,11 @@ +@@ -2166,7 +2404,11 @@ pVia->FBBase, pVia->FBFreeStart, pVia->FBFreeEnd); } @@ -504,12 +464,12 @@ Index: src/via_driver.c pScrn->fbOffset = 0; if(pVia->IsSecondary) pScrn->fbOffset = pScrn->videoRam << 10; -@@ -2184,7 +2433,17 @@ +@@ -2184,6 +2426,16 @@ /* Disable MMIO */ ViaSeqMask(VGAHWPTR(pScrn), 0x1A, 0x00, 0x60); +#ifdef XSERVER_LIBPCIACCESS - if (pVia->MapBase) ++ if (pVia->MapBase) + pci_device_unmap_range(pVia->PciInfo, (pointer)pVia->MapBase, VIA_MMIO_REGSIZE); + + if (pVia->BltBase) @@ -518,11 +478,10 @@ Index: src/via_driver.c + if (pVia->FBBase) + pci_device_unmap_range(pVia->PciInfo, (pointer)pVia->FBBase, pVia->videoRambytes); +#else -+ if (pVia->MapBase) + if (pVia->MapBase) xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->MapBase, VIA_MMIO_REGSIZE); - if (pVia->BltBase) -@@ -2192,6 +2451,7 @@ +@@ -2192,6 +2444,7 @@ if (pVia->FBBase) xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->FBBase, pVia->videoRambytes); @@ -532,12 +491,12 @@ Index: src/via_driver.c static void Index: src/via_driver.h =================================================================== ---- src/via_driver.h (revision 489) -+++ src/via_driver.h (working copy) +--- src/via_driver.h (revision 489) ++++ src/via_driver.h (working copy) @@ -66,6 +66,10 @@ #include "via_dmabuffer.h" #include "via_3d.h" - + +#ifdef XSERVER_LIBPCIACCESS +#include +#endif @@ -547,7 +506,7 @@ Index: src/via_driver.h #include "sarea.h" @@ -234,8 +238,15 @@ int agpMem; - + CloseScreenProcPtr CloseScreen; - pciVideoPtr PciInfo; - PCITAG PciTag; diff --git a/xorg-x11-drv-openchrome.spec b/xorg-x11-drv-openchrome.spec index 1b4e871..832b89f 100644 --- a/xorg-x11-drv-openchrome.spec +++ b/xorg-x11-drv-openchrome.spec @@ -9,7 +9,7 @@ Summary: Xorg X11 openchrome video driver Name: xorg-x11-drv-openchrome Version: 0.2.901 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.openchrome.org License: MIT Group: User Interface/X Hardware Support @@ -18,7 +18,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source0: http://www.openchrome.org/releases/%{tarball}-%{version}.tar.bz2 Source1: openchrome.xinf -Patch1: openchrome-0.2.901-libpciaccess.patch +Patch1: openchrome-0.2.901-libpciaccess_2.patch ExclusiveArch: %{ix86} x86_64 BuildRequires: pkgconfig @@ -101,6 +101,9 @@ fi %changelog +* Mon Jan 07 2008 Xavier Bachelot - 0.2.901-2 +- Fix broken libpciaccess patch. + * Wed Jan 02 2008 Xavier Bachelot - 0.2.901-1 - Update to 0.2.901. - Remove obsoleted patches.