rpms/xorg-x11-drv-openchrome/devel openchrome-0.2.901-libpciaccess.patch, 1.6, 1.7 xorg-x11-drv-openchrome.spec, 1.14, 1.15

Xavier Bachelot (xavierb) fedora-extras-commits at redhat.com
Sat Mar 8 20:36:52 UTC 2008


Author: xavierb

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

Modified Files:
	openchrome-0.2.901-libpciaccess.patch 
	xorg-x11-drv-openchrome.spec 
Log Message:
- Yet another revision of the libpciaccess patch.


openchrome-0.2.901-libpciaccess.patch:

Index: openchrome-0.2.901-libpciaccess.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-openchrome/devel/openchrome-0.2.901-libpciaccess.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- openchrome-0.2.901-libpciaccess.patch	7 Mar 2008 15:14:26 -0000	1.6
+++ openchrome-0.2.901-libpciaccess.patch	8 Mar 2008 20:36:47 -0000	1.7
@@ -56,9 +56,174 @@
  AM_CONDITIONAL(DEBUG, test x$DEBUG = xyes)
  if test "$DEBUG" = yes; then
          AC_DEFINE(HAVE_DEBUG,1,[Enable debug support])
-diff -Naur src/via_driver.c src/via_driver.c
+diff -Naur src/via_driver.h src/via_driver.h
+--- src/via_driver.h	2008-01-02 19:01:32.000000000 +0100
++++ src/via_driver.h	2008-01-10 12:20:18.000000000 +0100
+@@ -66,6 +66,10 @@
+ #include "via_dmabuffer.h"
+ #include "via_3d.h"
+ 
++#ifdef XSERVER_LIBPCIACCESS
++#include <pciaccess.h>
++#endif
++
+ #ifdef XF86DRI
+ #define _XF86DRI_SERVER_
+ #include "sarea.h"
+@@ -234,8 +238,15 @@
+     int                 agpMem;
+ 
+     CloseScreenProcPtr  CloseScreen;
+-    pciVideoPtr         PciInfo;
+-    PCITAG              PciTag;
++    #if XSERVER_LIBPCIACCESS
++        struct pci_device *PciInfo;
++        int mmio_bar;
++        int fb_bar;
++        PCITAG PciTag;
++    #else
++        pciVideoPtr PciInfo;
++        PCITAG PciTag;
++    #endif
+     int                 Chipset;
+     int                 ChipId;
+     int                 ChipRev;
+diff -Naur src/via_dri.c src/via_dri.c
+--- src/via_dri.c	2007-06-14 22:45:45.000000000 +0200
++++ src/via_dri.c	2008-01-10 12:20:18.000000000 +0100
+@@ -111,9 +111,15 @@
+  
+     pVIADRI->irqEnabled = drmGetInterruptFromBusID
+ 	(pVia->drmFD,
++#if XSERVER_LIBPCIACCESS
++         ((pVia->PciInfo->domain << 8) | pVia->PciInfo->bus),
++         pVia->PciInfo->dev, pVia->PciInfo->func
++#else
+ 	 ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum,
+ 	 ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum,
+-	 ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum);
++	 ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum
++#endif
++         );
+     if ((drmCtlInstHandler(pVia->drmFD, pVIADRI->irqEnabled))) {
+ 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ 		   "[drm] Failure adding irq handler. "
+@@ -677,9 +683,15 @@
+     pDRIInfo->clientDriverName = VIAClientDriverName;
+     pDRIInfo->busIdString = xalloc(64);
+     sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d",
++#if XSERVER_LIBPCIACCESS
++        ((pVia->PciInfo->domain << 8) | pVia->PciInfo->bus),
++        pVia->PciInfo->dev, pVia->PciInfo->func
++#else
+         ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum,
+         ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum,
+-        ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum);
++        ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum
++#endif
++        );
+     pDRIInfo->ddxDriverMajorVersion = VIA_DRIDDX_VERSION_MAJOR;
+     pDRIInfo->ddxDriverMinorVersion = VIA_DRIDDX_VERSION_MINOR;
+     pDRIInfo->ddxDriverPatchVersion = VIA_DRIDDX_VERSION_PATCH;
+diff -Naur src/via.h src/via.h
+--- src/via.h	2007-09-10 22:51:07.000000000 +0200
++++ src/via.h	2008-01-10 12:20:18.000000000 +0100
+@@ -25,7 +25,7 @@
+ #ifndef _VIA_H_
+ #define _VIA_H_ 1
+ 
+-#include "xorgVersion.h"
++//#include "xorgVersion.h"
+ 
+ #include <errno.h>
+ #include <string.h>
+@@ -664,4 +664,20 @@
+ 
+ #define VBE_DEFAULT_REFRESH                     6000
+ 
++#if XSERVER_LIBPCIACCESS
++#define VIA_MEMBASE(p,n)  (p)->regions[(n)].base_addr
++#define VENDOR_ID(p)      (p)->vendor_id
++#define DEVICE_ID(p)      (p)->device_id
++#define SUBVENDOR_ID(p)   (p)->subvendor_id
++#define SUBSYS_ID(p)      (p)->subdevice_id
++#define CHIP_REVISION(p)  (p)->revision
++#else
++#define VIA_MEMBASE(p,n)  (p)->memBase[n]
++#define VENDOR_ID(p)      (p)->vendor
++#define DEVICE_ID(p)      (p)->chipType
++#define SUBVENDOR_ID(p)   (p)->subsysVendor
++#define SUBSYS_ID(p)      (p)->subsysCard
++#define CHIP_REVISION(p)  (p)->chipRev
++#endif
++
+ #endif /* _VIA_H_ */
+diff -Naur ChangeLog ChangeLog
+--- ChangeLog	2008-01-02 19:31:02.000000000 +0100
++++ ChangeLog	2008-01-10 12:20:18.000000000 +0100
+@@ -1,3 +1,21 @@
++2008-03-06  Jon Nettleton  <jon-dot-nettleton-at-gmail-dot-com>
++
++	* src/via.h:
++	* src/via_driver.c: (VIAPreInit):
++	* src/via_id.c: (ViaCheckCardId):
++
++	Switched ViaCheckCardId to use the macros defined in 
++	via.h.  This allows it to work with libpciaccess enabled
++	xorg servers as well as legacy versions.
++
++2007-12-31  Jon Nettleton  <jon-dot-nettleton-at-gmail-dot-com>
++
++	* src/via_driver.c: (VIAPreInit), (VIAMapMMIO):
++
++	Finally got a chance to work some more on libpciaccess.
++	Memory detection is still not 100% proper but should be
++	more functional and working at least.
++
+ 2007-10-29  Benno Schulenberg  <bensberg-at-justemail-dot-net>
+ 
+ 	* src/via_driver.c: (VIAPreInit):
+--- src/via_id.c	2008-03-06 20:30:31.000000000 +0100
++++ src/via_id.c	2008-03-06 22:25:29.000000000 +0100
+@@ -30,6 +30,7 @@
+ #endif
+ 
+ #include "via_driver.h"
++#include "via.h"
+ #include "via_id.h"
+ 
+ /*
+@@ -218,15 +218,15 @@
+     struct ViaCardIdStruct *Id;
+     VIAPtr pVia = VIAPTR(pScrn);
+     
+-    if ((pVia->PciInfo->subsysVendor == pVia->PciInfo->vendor) &&
+-	(pVia->PciInfo->subsysCard == pVia->PciInfo->chipType))
++    if ((SUBVENDOR_ID(pVia->PciInfo) == VENDOR_ID(pVia->PciInfo)) &&
++	(SUBSYS_ID(pVia->PciInfo) == DEVICE_ID(pVia->PciInfo)))
+         xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+                    "Manufacturer plainly copied main PCI IDs to subsystem/card IDs.\n");
+ 
+     for (Id = ViaCardId; Id->String; Id++) {
+ 	if ((Id->Chip == pVia->Chipset) && 
+-	    (Id->Vendor == pVia->PciInfo->subsysVendor) &&
+-	    (Id->Device == pVia->PciInfo->subsysCard)) {
++	    (Id->Vendor == SUBVENDOR_ID(pVia->PciInfo)) &&
++	    (Id->Device == SUBSYS_ID(pVia->PciInfo))) {
+ 	    xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected %s.\n", Id->String);
+ 	    pVia->Id = Id;
+ 	    return;
+@@ -235,7 +235,7 @@
+     
+     xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 
+ 	       "Unknown Card-Ids (%4X|%4X|%4X); please report to openchrome-users at openchrome.org\n",
+-	       pVia->PciInfo->chipType, pVia->PciInfo->subsysVendor, pVia->PciInfo->subsysCard);
++	       DEVICE_ID(pVia->PciInfo), SUBVENDOR_ID(pVia->PciInfo), SUBSYS_ID(pVia->PciInfo));
+     pVia->Id = NULL;
+ }
+ 
 --- src/via_driver.c	2008-01-02 18:58:40.000000000 +0100
-+++ src/via_driver.c	2008-01-10 12:37:37.000000000 +0100
++++ src/via_driver.c	2008-03-07 22:39:15.000000000 +0100
 @@ -50,7 +50,30 @@
  
  /* Prototypes. */
@@ -193,7 +358,7 @@
 +    {
 +        scrn->driverVersion = VIA_VERSION;
 +        scrn->driverName = DRIVER_NAME;
-+        scrn->name = "VIA";
++        scrn->name = "CHROME";
 +        scrn->Probe = NULL;
 +
 +        entity = xf86GetEntityInfo (entity_num);
@@ -269,157 +434,52 @@
      }
  
      if (pVia->Chipset == VIA_CLE266)
-@@ -961,52 +1074,6 @@
- 
-     xf86DrvMsg(pScrn->scrnIndex, from, "Chipset revision: %d\n", pVia->ChipRev);
- 
--    xfree(pEnt);
--
--    /* Detect the amount of installed RAM */
--    from = X_PROBED;
--    switch (pVia->Chipset) {
--        case VIA_CLE266:
--        case VIA_KM400:
--            pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70 ) >> 4 ) ) << 10 ;
--            break;
--        case VIA_PM800:
--        case VIA_VM800:
--        case VIA_K8M800:
--            pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70 ) >> 4 ) ) << 10 ;
--            break;
--        case VIA_K8M890:
--        case VIA_P4M890:
--        case VIA_P4M900:
--        case VIA_CX700:
--            pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70 ) >> 4 ) ) << 12 ;
--            break;
--        default:
--            if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536) {
--                xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
--                           "Using old memory-detection method.\n");
--                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.\n");
--            }
--    }
--
--    if (from == X_PROBED)
--        xf86DrvMsg(pScrn->scrnIndex, from,
--                   "Probed amount of VideoRAM = %d kB\n", pScrn->videoRam);
--
-     xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
- 	       "Setting up default chipset options...\n");
-     if (!VIASetupDefaultOptions(pScrn)) {
-@@ -1019,9 +1086,16 @@
-     xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
- 	       "Starting to parse config file options...\n");
- 
--    if (xf86GetOptValInteger(VIAOptions, OPTION_VIDEORAM, &pScrn->videoRam))
--        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
--                   "Setting amount of VideoRAM to %d kB\n", pScrn->videoRam);
-+    pScrn->videoRam = pEnt->device->videoRam;
-+    from = xf86GetOptValInteger(VIAOptions, OPTION_VIDEORAM,
-+				&pScrn->videoRam) ? 
-+	X_CONFIG : X_PROBED;
-+    xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM is set to %d kB\n",
-+               pScrn->videoRam);
-+    if (pScrn->videoRam != pEnt->device->videoRam)
-+        xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-+                   "Detected VideoRAM was %d kB!\n", pEnt->device->videoRam);
-+    xfree(pEnt);
- 
-     //pVia->shadowFB = FALSE;
-     from = xf86GetOptValBool(VIAOptions, OPTION_SHADOW_FB, &pVia->shadowFB) ? 
-@@ -1378,8 +1452,10 @@
- 
-     /* maybe throw in some more sanity checks here */
- 
-+#if !XSERVER_LIBPCIACCESS
-     pVia->PciTag = pciTag(pVia->PciInfo->bus, pVia->PciInfo->device,
-                           pVia->PciInfo->func);
-+#endif
- 
-     if (!VIAMapMMIO(pScrn)) {
- 	VIAFreeRec(pScrn);
-@@ -1440,6 +1518,65 @@
-         return FALSE;
-     }
- 
-+    from = X_PROBED;
-+
-+    /* Detect the amount of installed RAM */
-+    switch (pVia->Chipset) {
-+        case VIA_CLE266:
-+        case VIA_KM400:
+@@ -968,18 +1081,33 @@
+     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;
+             pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70 ) >> 4 ) ) << 10 ;
 +#endif
-+        case VIA_PM800:
-+        case VIA_VM800:
-+        case VIA_K8M800:
+             break;
+         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;
+             pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70 ) >> 4 ) ) << 10 ;
 +#endif
-+        case VIA_K8M890:
-+        case VIA_P4M900:
-+        case VIA_CX700:
+             break;
+         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;
+             pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 3), 0xA1) & 0x70 ) >> 4 ) ) << 12 ;
++#endif
+             break;
+         default:
+             if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536) {
+@@ -1378,8 +1506,10 @@
+ 
+     /* maybe throw in some more sanity checks here */
+ 
++#if !XSERVER_LIBPCIACCESS
+     pVia->PciTag = pciTag(pVia->PciInfo->bus, pVia->PciInfo->device,
+                           pVia->PciInfo->func);
 +#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,26 +2183,74 @@
+ 
+     if (!VIAMapMMIO(pScrn)) {
+ 	VIAFreeRec(pScrn);
+@@ -2046,26 +2176,74 @@
  VIAMapMMIO(ScrnInfoPtr pScrn)
  {
      VIAPtr pVia = VIAPTR(pScrn);
@@ -499,7 +559,7 @@
  
      if (!pVia->MapBase || !pVia->BltBase) {
          xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-@@ -2111,6 +2296,9 @@
+@@ -2111,6 +2289,9 @@
  VIAMapFB(ScrnInfoPtr pScrn)
  {
      VIAPtr pVia = VIAPTR(pScrn);
@@ -509,7 +569,7 @@
  
      DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAMapFB\n"));
      xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-@@ -2125,6 +2313,7 @@
+@@ -2125,6 +2306,7 @@
  	 * in the OS support layer.
  	 */
  
@@ -517,7 +577,7 @@
          unsigned char *tmp; 
          tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
  			    pVia->PciTag, pVia->FrameBufferBase,
-@@ -2143,10 +2332,24 @@
+@@ -2143,10 +2325,24 @@
          xf86UnMapVidMem(pScrn->scrnIndex, (pointer)tmp,
                          pVia->videoRambytes);
  
@@ -542,7 +602,7 @@
          pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
                                       pVia->PciTag, pVia->FrameBufferBase,
                                       pVia->videoRambytes);
-@@ -2156,6 +2359,7 @@
+@@ -2156,6 +2352,7 @@
                         "Internal error: could not map framebuffer\n");
              return FALSE;
          }
@@ -550,7 +610,7 @@
  
          pVia->FBFreeStart = (pScrn->displayWidth * pScrn->bitsPerPixel >> 3) *
                              pScrn->virtualY;
-@@ -2166,7 +2370,11 @@
+@@ -2166,7 +2363,11 @@
                     pVia->FBBase, pVia->FBFreeStart, pVia->FBFreeEnd);
      }
  
@@ -562,7 +622,7 @@
      pScrn->fbOffset = 0;
      if(pVia->IsSecondary) pScrn->fbOffset = pScrn->videoRam << 10;
  
-@@ -2184,6 +2392,16 @@
+@@ -2184,6 +2385,16 @@
      /* Disable MMIO */
      ViaSeqMask(VGAHWPTR(pScrn), 0x1A, 0x00, 0x60);
  
@@ -579,7 +639,7 @@
      if (pVia->MapBase)
          xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->MapBase, VIA_MMIO_REGSIZE);
  
-@@ -2192,6 +2410,7 @@
+@@ -2192,6 +2403,7 @@
  
      if (pVia->FBBase)
          xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->FBBase, pVia->videoRambytes);
@@ -587,161 +647,3 @@
  }
  
  static void
-diff -Naur src/via_driver.h src/via_driver.h
---- src/via_driver.h	2008-01-02 19:01:32.000000000 +0100
-+++ src/via_driver.h	2008-01-10 12:20:18.000000000 +0100
-@@ -66,6 +66,10 @@
- #include "via_dmabuffer.h"
- #include "via_3d.h"
- 
-+#ifdef XSERVER_LIBPCIACCESS
-+#include <pciaccess.h>
-+#endif
-+
- #ifdef XF86DRI
- #define _XF86DRI_SERVER_
- #include "sarea.h"
-@@ -234,8 +238,15 @@
-     int                 agpMem;
- 
-     CloseScreenProcPtr  CloseScreen;
--    pciVideoPtr         PciInfo;
--    PCITAG              PciTag;
-+    #if XSERVER_LIBPCIACCESS
-+        struct pci_device *PciInfo;
-+        int mmio_bar;
-+        int fb_bar;
-+        PCITAG PciTag;
-+    #else
-+        pciVideoPtr PciInfo;
-+        PCITAG PciTag;
-+    #endif
-     int                 Chipset;
-     int                 ChipId;
-     int                 ChipRev;
-diff -Naur src/via_dri.c src/via_dri.c
---- src/via_dri.c	2007-06-14 22:45:45.000000000 +0200
-+++ src/via_dri.c	2008-01-10 12:20:18.000000000 +0100
-@@ -111,9 +111,15 @@
-  
-     pVIADRI->irqEnabled = drmGetInterruptFromBusID
- 	(pVia->drmFD,
-+#if XSERVER_LIBPCIACCESS
-+         ((pVia->PciInfo->domain << 8) | pVia->PciInfo->bus),
-+         pVia->PciInfo->dev, pVia->PciInfo->func
-+#else
- 	 ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum,
- 	 ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum,
--	 ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum);
-+	 ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum
-+#endif
-+         );
-     if ((drmCtlInstHandler(pVia->drmFD, pVIADRI->irqEnabled))) {
- 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- 		   "[drm] Failure adding irq handler. "
-@@ -677,9 +683,15 @@
-     pDRIInfo->clientDriverName = VIAClientDriverName;
-     pDRIInfo->busIdString = xalloc(64);
-     sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d",
-+#if XSERVER_LIBPCIACCESS
-+        ((pVia->PciInfo->domain << 8) | pVia->PciInfo->bus),
-+        pVia->PciInfo->dev, pVia->PciInfo->func
-+#else
-         ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum,
-         ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum,
--        ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum);
-+        ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum
-+#endif
-+        );
-     pDRIInfo->ddxDriverMajorVersion = VIA_DRIDDX_VERSION_MAJOR;
-     pDRIInfo->ddxDriverMinorVersion = VIA_DRIDDX_VERSION_MINOR;
-     pDRIInfo->ddxDriverPatchVersion = VIA_DRIDDX_VERSION_PATCH;
-diff -Naur src/via.h src/via.h
---- src/via.h	2007-09-10 22:51:07.000000000 +0200
-+++ src/via.h	2008-01-10 12:20:18.000000000 +0100
-@@ -25,7 +25,7 @@
- #ifndef _VIA_H_
- #define _VIA_H_ 1
- 
--#include "xorgVersion.h"
-+//#include "xorgVersion.h"
- 
- #include <errno.h>
- #include <string.h>
-@@ -664,4 +664,20 @@
- 
- #define VBE_DEFAULT_REFRESH                     6000
- 
-+#if XSERVER_LIBPCIACCESS
-+#define VIA_MEMBASE(p,n)  (p)->regions[(n)].base_addr
-+#define VENDOR_ID(p)      (p)->vendor_id
-+#define DEVICE_ID(p)      (p)->device_id
-+#define SUBVENDOR_ID(p)   (p)->subvendor_id
-+#define SUBSYS_ID(p)      (p)->subdevice_id
-+#define CHIP_REVISION(p)  (p)->revision
-+#else
-+#define VIA_MEMBASE(p,n)  (p)->memBase[n]
-+#define VENDOR_ID(p)      (p)->vendor
-+#define DEVICE_ID(p)      (p)->chipType
-+#define SUBVENDOR_ID(p)   (p)->subsysVendor
-+#define SUBSYS_ID(p)      (p)->subsysCard
-+#define CHIP_REVISION(p)  (p)->chipRev
-+#endif
-+
- #endif /* _VIA_H_ */
-diff -Naur ChangeLog ChangeLog
---- ChangeLog	2008-01-02 19:31:02.000000000 +0100
-+++ ChangeLog	2008-01-10 12:20:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+2008-03-06  Jon Nettleton  <jon-dot-nettleton-at-gmail-dot-com>
-+
-+	* src/via.h:
-+	* src/via_driver.c: (VIAPreInit):
-+	* src/via_id.c: (ViaCheckCardId):
-+
-+	Switched ViaCheckCardId to use the macros defined in 
-+	via.h.  This allows it to work with libpciaccess enabled
-+	xorg servers as well as legacy versions.
-+
-+2007-12-31  Jon Nettleton  <jon-dot-nettleton-at-gmail-dot-com>
-+
-+	* src/via_driver.c: (VIAPreInit), (VIAMapMMIO):
-+
-+	Finally got a chance to work some more on libpciaccess.
-+	Memory detection is still not 100% proper but should be
-+	more functional and working at least.
-+
- 2007-10-29  Benno Schulenberg  <bensberg-at-justemail-dot-net>
- 
- 	* src/via_driver.c: (VIAPreInit):
---- src/via_id.c	2008-03-06 20:30:31.000000000 +0100
-+++ src/via_id.c	2008-03-06 22:25:29.000000000 +0100
-@@ -218,15 +218,15 @@
-     struct ViaCardIdStruct *Id;
-     VIAPtr pVia = VIAPTR(pScrn);
-     
--    if ((pVia->PciInfo->subsysVendor == pVia->PciInfo->vendor) &&
--	(pVia->PciInfo->subsysCard == pVia->PciInfo->chipType))
-+    if ((SUBVENDOR_ID(pVia->PciInfo) == VENDOR_ID(pVia->PciInfo)) &&
-+	(SUBSYS_ID(pVia->PciInfo) == DEVICE_ID(pVia->PciInfo)))
-         xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-                    "Manufacturer plainly copied main PCI IDs to subsystem/card IDs.\n");
- 
-     for (Id = ViaCardId; Id->String; Id++) {
- 	if ((Id->Chip == pVia->Chipset) && 
--	    (Id->Vendor == pVia->PciInfo->subsysVendor) &&
--	    (Id->Device == pVia->PciInfo->subsysCard)) {
-+	    (Id->Vendor == SUBVENDOR_ID(pVia->PciInfo)) &&
-+	    (Id->Device == SUBSYS_ID(pVia->PciInfo))) {
- 	    xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected %s.\n", Id->String);
- 	    pVia->Id = Id;
- 	    return;
-@@ -235,7 +235,7 @@
-     
-     xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 
- 	       "Unknown Card-Ids (%4X|%4X|%4X); please report to openchrome-users at openchrome.org\n",
--	       pVia->PciInfo->chipType, pVia->PciInfo->subsysVendor, pVia->PciInfo->subsysCard);
-+	       DEVICE_ID(pVia->PciInfo), SUBVENDOR_ID(pVia->PciInfo), SUBSYS_ID(pVia->PciInfo));
-     pVia->Id = NULL;
- }
- 


Index: xorg-x11-drv-openchrome.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-openchrome/devel/xorg-x11-drv-openchrome.spec,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- xorg-x11-drv-openchrome.spec	7 Mar 2008 15:14:26 -0000	1.14
+++ xorg-x11-drv-openchrome.spec	8 Mar 2008 20:36:47 -0000	1.15
@@ -9,7 +9,7 @@
 Summary:	Xorg X11 openchrome video driver
 Name:		xorg-x11-drv-openchrome
 Version:	0.2.901
-Release:	11%{?dist}
+Release:	12%{?dist}
 URL:		http://www.openchrome.org
 License:	MIT
 Group:		User Interface/X Hardware Support
@@ -109,7 +109,10 @@
 
 
 %changelog
-* Thu Mar 07 2008 Xavier Bachelot <xavier AT bachelot DOT org> - 0.2.901-11
+* Sat Mar 08 2008 Xavier Bachelot <xavier AT bachelot DOT org> - 0.2.901-12
+- Yet another revision of the libpciaccess patch.
+
+* Fri Mar 07 2008 Xavier Bachelot <xavier AT bachelot DOT org> - 0.2.901-11
 - Fix a typo in libpciaccess patch.
 
 * Fri Mar 07 2008 Adam Jackson <ajax at redhat.com> 0.2.901-10




More information about the fedora-extras-commits mailing list