Module Name:    xsrc
Committed By:   mrg
Date:           Thu Jul 23 01:19:17 UTC 2015

Modified Files:
        xsrc/external/mit/xf86-video-i740/dist/src: i740_driver.c
        xsrc/external/mit/xf86-video-newport/dist/src: newport.h
            newport_driver.c
        xsrc/external/mit/xf86-video-tdfx/dist/src: tdfx_dri.c tdfx_driver.c
Removed Files:
        xsrc/external/mit/xf86-video-newport/dist: README.sgml

Log Message:
merge i740 1.3.5, newport 0.2.4 and tdfx 1.4.6.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
    xsrc/external/mit/xf86-video-i740/dist/src/i740_driver.c
cvs rdiff -u -r1.1.1.1 -r0 \
    xsrc/external/mit/xf86-video-newport/dist/README.sgml
cvs rdiff -u -r1.3 -r1.4 \
    xsrc/external/mit/xf86-video-newport/dist/src/newport.h
cvs rdiff -u -r1.10 -r1.11 \
    xsrc/external/mit/xf86-video-newport/dist/src/newport_driver.c
cvs rdiff -u -r1.3 -r1.4 \
    xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_dri.c
cvs rdiff -u -r1.5 -r1.6 \
    xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_driver.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-i740/dist/src/i740_driver.c
diff -u xsrc/external/mit/xf86-video-i740/dist/src/i740_driver.c:1.4 xsrc/external/mit/xf86-video-i740/dist/src/i740_driver.c:1.5
--- xsrc/external/mit/xf86-video-i740/dist/src/i740_driver.c:1.4	Sun Jun  2 21:44:44 2013
+++ xsrc/external/mit/xf86-video-i740/dist/src/i740_driver.c	Thu Jul 23 01:19:16 2015
@@ -63,10 +63,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
 #include "compiler.h"
 
-/* Drivers using the mi implementation of backing store need: */
-
-#include "mibstore.h"
-
 /* All drivers using the vgahw module need this */
 /* This driver needs to be modified to not use vgaHW for multihead operation */
 #include "vgaHW.h"
@@ -1558,7 +1554,6 @@ I740ScreenInit(SCREEN_INIT_ARGS_DECL) {
     }
   }
 
-  miInitializeBackingStore(pScreen);
   xf86SetBackingStore(pScreen);
   xf86SetSilkenMouse(pScreen);
 

Index: xsrc/external/mit/xf86-video-newport/dist/src/newport.h
diff -u xsrc/external/mit/xf86-video-newport/dist/src/newport.h:1.3 xsrc/external/mit/xf86-video-newport/dist/src/newport.h:1.4
--- xsrc/external/mit/xf86-video-newport/dist/src/newport.h:1.3	Fri Dec 17 04:19:50 2010
+++ xsrc/external/mit/xf86-video-newport/dist/src/newport.h	Thu Jul 23 01:19:16 2015
@@ -23,6 +23,7 @@
 #include "xf86.h"
 #include "xf86_OSproc.h"
 #include "compiler.h"
+
 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
 #include "xf86Resources.h"
 #endif

Index: xsrc/external/mit/xf86-video-newport/dist/src/newport_driver.c
diff -u xsrc/external/mit/xf86-video-newport/dist/src/newport_driver.c:1.10 xsrc/external/mit/xf86-video-newport/dist/src/newport_driver.c:1.11
--- xsrc/external/mit/xf86-video-newport/dist/src/newport_driver.c:1.10	Wed Jun  4 18:20:44 2014
+++ xsrc/external/mit/xf86-video-newport/dist/src/newport_driver.c	Thu Jul 23 01:19:16 2015
@@ -1,6 +1,4 @@
 /*
- * Id: newport_driver.c,v 1.2 2000/11/29 20:58:10 agx Exp $ 
- *
  * Driver for the SGI Indy's Newport graphics card
  * 
  * This driver is based on the newport.c & newport_con.c kernel code
@@ -30,7 +28,6 @@
  * Project.
  *
  */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v 1.25 2003/04/23 21:51:41 tsi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -74,9 +71,9 @@
 #define NEWPORT_VERSION		4000
 #define NEWPORT_NAME		"NEWPORT"
 #define NEWPORT_DRIVER_NAME	"newport"
-#define NEWPORT_MAJOR_VERSION	0
-#define NEWPORT_MINOR_VERSION	2
-#define NEWPORT_PATCHLEVEL	0
+#define NEWPORT_MAJOR_VERSION	PACKAGE_VERSION_MAJOR
+#define NEWPORT_MINOR_VERSION	PACKAGE_VERSION_MINOR
+#define NEWPORT_PATCHLEVEL	PACKAGE_VERSION_PATCHLEVEL
 
 
 /* Prototypes ------------------------------------------------------- */
@@ -117,36 +114,6 @@ static SymTabRec NewportChipsets[] = {
     {-1, NULL }
 };
 
-/* List of Symbols from other modules that this module references */
-
-static const char *fbSymbols[] = {
-	"fbPictureInit",
-	"fbScreenInit",
-	NULL
-};	
-
-static const char *ramdacSymbols[] = {
-    "xf86CreateCursorInfoRec",
-    "xf86InitCursor",
-    NULL
-};
-
-static const char *shadowSymbols[] = {
-	"ShadowFBInit",
-	NULL
-};
-
-static const char *xaaSymbols[] = {
-    "XAACreateInfoRec",
-    "XAADestroyInfoRec",
-    "XAAGetFallbackOps",
-    "XAAInit",
-    NULL
-};
-
-
-#ifdef XFree86LOADER
-
 static MODULESETUPPROTO(newportSetup);
 
 static XF86ModuleVersionInfo newportVersRec =
@@ -187,14 +154,6 @@ newportSetup(pointer module, pointer opt
 		xf86AddDriver(&NEWPORT, module, 0);
 
 		/*
-		 * Tell the loader about symbols from other modules that this module
-		 * might refer to.
-		 *
-		 */
-		LoaderRefSymLists( fbSymbols, ramdacSymbols, shadowSymbols, xaaSymbols, NULL);
-
-
-		/*
 		 * The return value must be non-NULL on success even though
 		 * there is no TearDownProc.
 		 */
@@ -205,8 +164,6 @@ newportSetup(pointer module, pointer opt
        }
 }
 
-#endif /* XFree86LOADER */
-
 typedef enum {
 	OPTION_BITPLANES,
 	OPTION_BUS_ID,
@@ -242,9 +199,7 @@ NewportGetRec(ScrnInfoPtr pScrn)
 static Bool
 NewportFreeRec(ScrnInfoPtr pScrn)
 {
-	if (pScrn->driverPrivate == NULL)
-		return TRUE;
-	xfree(pScrn->driverPrivate);
+	free(pScrn->driverPrivate);
 	pScrn->driverPrivate = NULL;
 	return TRUE;
 }
@@ -263,7 +218,7 @@ NewportProbe(DriverPtr drv, int flags)
 	Bool foundScreen = FALSE;
 	GDevPtr *devSections;
 	GDevPtr dev = NULL;
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
+#ifndef XSERVER_LIBPCIACCESS
 	resRange range[] = { {ResExcMemBlock ,0,0}, _END };
 #endif
 	unsigned probedIDs[NEWPORT_MAX_BOARDS];
@@ -302,21 +257,15 @@ NewportProbe(DriverPtr drv, int flags)
 					int entity;
 					ScrnInfoPtr pScrn = NULL;
 
-					/* This is a hack because don't have the RAC info(and don't want it).  
-					 * Set it as an ISA entity to get the entity field set up right.
-					 */
-					entity = xf86ClaimFbSlot(drv, 0, dev,
-					    TRUE);
+					entity = xf86ClaimNoSlot(drv, 0, dev, TRUE);
+#ifndef XSERVER_LIBPCIACCESS
 					base = (NEWPORT_BASE_ADDR0
 						+ busID * NEWPORT_BASE_OFFSET);
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
-					RANGE(range[0], base, base +
-					    sizeof(NewportRegs), 
-					    ResExcMemBlock);
+					RANGE(range[0], base, base + sizeof(NewportRegs),\
+							ResExcMemBlock);
 #endif
-					pScrn = (void *)xf86ConfigFbEntity(NULL,
-					    0, entity, NULL, NULL, NULL, NULL);
-					/* Allocate a ScrnInfoRec */
+					pScrn = xf86AllocateScreen(drv, 0);
+					xf86AddEntityToScreen(pScrn, entity);
 					pScrn->driverVersion = NEWPORT_VERSION;
 					pScrn->driverName    = NEWPORT_DRIVER_NAME;
 					pScrn->name          = NEWPORT_NAME;
@@ -332,7 +281,7 @@ NewportProbe(DriverPtr drv, int flags)
 			}
 		}
 	}
-	xfree(devSections);
+	free(devSections);
 	return foundScreen;
 }
 
@@ -431,7 +380,7 @@ NewportPreInit(ScrnInfoPtr pScrn, int fl
 
 	/* Fill in pScrn->options) */
 	xf86CollectOptions(pScrn, NULL);
-	if (!(pNewport->Options = xalloc(sizeof(NewportOptions))))
+	if (!(pNewport->Options = malloc(sizeof(NewportOptions))))
 		return FALSE;
 	memcpy(pNewport->Options, NewportOptions, sizeof(NewportOptions));
 	xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pNewport->Options);
@@ -525,7 +474,6 @@ NewportPreInit(ScrnInfoPtr pScrn, int fl
 		NewportFreeRec(pScrn);
 		return FALSE;
 	}
-	xf86LoaderReqSymLists( fbSymbols, NULL);
 
 	/* Load ramdac modules */
     	if (pNewport->hwCursor) {
@@ -533,7 +481,6 @@ NewportPreInit(ScrnInfoPtr pScrn, int fl
 			NewportFreeRec(pScrn);
             		return FALSE;
         	}
-        	xf86LoaderReqSymLists(ramdacSymbols, NULL);
     	}
 
 	/* Load ShadowFB module */
@@ -541,7 +488,6 @@ NewportPreInit(ScrnInfoPtr pScrn, int fl
 		NewportFreeRec(pScrn);
 		return FALSE;
 	}
-	xf86LoaderReqSymLists(shadowSymbols, NULL);
 
 	/* Load XAA module */
 	if (!xf86LoadSubModule(pScrn, "xaa")) {
@@ -635,12 +581,13 @@ NewportScreenInit(int index, ScreenPtr p
 	pNewport->NoAccel = FALSE;
 	if (xf86ReturnOptValBool(pNewport->Options, OPTION_NOACCEL, FALSE)) 
 	{
-	    if (!xf86LoadSubModule(pScrn, "xaa"))
-		return FALSE;
-	    xf86LoaderReqSymLists(xaaSymbols, NULL);
 	    pNewport->NoAccel = TRUE;
 	    xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
 	}
+	if (!pNewport->NoAccel) {
+	    if (!xf86LoadSubModule(pScrn, "xaa"))
+		pNewport->NoAccel = TRUE;
+	}
 #if 0    
 	if (pScrn->bitsPerPixel < 24)
 	{ /* not implemented yet */
@@ -741,8 +688,7 @@ NewportCloseScreen(int scrnIndex, Screen
 #endif	
 
 	NewportRestore(pScrn, TRUE);
-	if (pNewport->ShadowPtr)
-		xfree(pNewport->ShadowPtr);
+	free(pNewport->ShadowPtr);
 
 	/* unmap the Newport's registers from memory */
 	NewportUnmapRegs(pScrn);

Index: xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_dri.c
diff -u xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_dri.c:1.3 xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_dri.c:1.4
--- xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_dri.c:1.3	Mon Jun  3 10:02:22 2013
+++ xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_dri.c	Thu Jul 23 01:19:16 2015
@@ -5,7 +5,6 @@
 
 #include "xf86.h"
 #include "xf86_OSproc.h"
-#include "xf86PciInfo.h"
 #include "xf86Pci.h"
 #include "fb.h"
 #include "miline.h"
@@ -362,8 +361,6 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen
   pDRIInfo->frameBufferStride = pTDFX->stride;
   pDRIInfo->ddxDrawableTableEntry = TDFX_MAX_DRAWABLES;
 
-  pDRIInfo->wrap.ValidateTree = 0;
-  pDRIInfo->wrap.PostValidateTree = 0;
   pTDFX->coreBlockHandler = pDRIInfo->wrap.BlockHandler;
   pDRIInfo->wrap.BlockHandler = TDFXDoBlockHandler;
   pTDFX->coreWakeupHandler = pDRIInfo->wrap.WakeupHandler;

Index: xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_driver.c
diff -u xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_driver.c:1.5 xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_driver.c:1.6
--- xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_driver.c:1.5	Mon Feb 23 11:28:46 2015
+++ xsrc/external/mit/xf86-video-tdfx/dist/src/tdfx_driver.c	Thu Jul 23 01:19:16 2015
@@ -62,10 +62,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
 #include "compiler.h"
 
-/* Drivers using the mi implementation of backing store need: */
-
-#include "mibstore.h"
-
 /* All drivers using the vgahw module need this */
 /* This driver needs to be modified to not use vgaHW for multihead operation */
 #include "vgaHW.h"
@@ -153,17 +149,20 @@ static void TDFXDisplayPowerManagementSe
 
 #ifdef XSERVER_LIBPCIACCESS
 #define TDFX_DEVICE_MATCH(d, sub, i) \
-    { 0x121A, (d), PCI_MATCH_ANY, (sub), 0, 0, (i) }
+    { PCI_VENDOR_3DFX, (d), PCI_MATCH_ANY, (sub), 0, 0, (i) }
 
 static const struct pci_id_match tdfx_device_match[] = {
     TDFX_DEVICE_MATCH(PCI_CHIP_BANSHEE, PCI_MATCH_ANY, Banshee),
 
+    TDFX_DEVICE_MATCH(PCI_CHIP_VELOCITY, PCI_MATCH_ANY, Voodoo3_Unknown),
+
     /* There are *many* missing PCI IDs here.
      */
-    TDFX_DEVICE_MATCH(PCI_CHIP_VOODOO3, 0x0036, Voodoo3_2000),
-    TDFX_DEVICE_MATCH(PCI_CHIP_VOODOO3, 0x003A, Voodoo3_3000),
+    TDFX_DEVICE_MATCH(PCI_CHIP_VOODOO3, PCI_CARD_VOODOO3_2000, Voodoo3_2000),
+    TDFX_DEVICE_MATCH(PCI_CHIP_VOODOO3, PCI_CARD_VOODOO3_3000, Voodoo3_3000),
 
     TDFX_DEVICE_MATCH(PCI_CHIP_VOODOO3, PCI_MATCH_ANY, Voodoo3_Unknown),
+    TDFX_DEVICE_MATCH(PCI_CHIP_VOODOO4, PCI_MATCH_ANY, Voodoo5),
     TDFX_DEVICE_MATCH(PCI_CHIP_VOODOO5, PCI_MATCH_ANY, Voodoo5),
     { 0, 0, 0 }
 };
@@ -202,7 +201,9 @@ _X_EXPORT DriverRec TDFX = {
 /* Chipsets */
 static SymTabRec TDFXChipsets[] = {
   { PCI_CHIP_BANSHEE, "3dfx Banshee"},
+  { PCI_CHIP_VELOCITY, "3dfx Velocity"},
   { PCI_CHIP_VOODOO3, "3dfx Voodoo3"},
+  { PCI_CHIP_VOODOO4, "3dfx Voodoo4"},
   { PCI_CHIP_VOODOO5, "3dfx Voodoo5"},
   { -1, NULL }
 };
@@ -210,7 +211,9 @@ static SymTabRec TDFXChipsets[] = {
 #ifndef XSERVER_LIBPCIACCESS
 static PciChipsets TDFXPciChipsets[] = {
   { PCI_CHIP_BANSHEE, PCI_CHIP_BANSHEE, RES_SHARED_VGA },
+  { PCI_CHIP_VELOCITY, PCI_CHIP_VELOCITY, RES_SHARED_VGA },
   { PCI_CHIP_VOODOO3, PCI_CHIP_VOODOO3, RES_SHARED_VGA },
+  { PCI_CHIP_VOODOO4, PCI_CHIP_VOODOO4, RES_SHARED_VGA },
   { PCI_CHIP_VOODOO5, PCI_CHIP_VOODOO5, RES_SHARED_VGA },
   { -1, -1, RES_UNDEFINED }
 };
@@ -1068,6 +1071,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags
     case PCI_CHIP_BANSHEE:
       pTDFX->MaxClock = 270000;
       break;
+    case PCI_CHIP_VELOCITY:
     case PCI_CHIP_VOODOO3:
       switch(match->subsysCard) {
       case PCI_CARD_VOODOO3_2000:
@@ -1081,6 +1085,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags
 	break;
       }
       break;
+    case PCI_CHIP_VOODOO4:
     case PCI_CHIP_VOODOO5:
       pTDFX->MaxClock = 350000;
       break;
@@ -1096,7 +1101,9 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags
     case PCI_CHIP_BANSHEE:
       clockRanges->interlaceAllowed = FALSE;
       break;
+    case PCI_CHIP_VELOCITY:
     case PCI_CHIP_VOODOO3:
+    case PCI_CHIP_VOODOO4:
     case PCI_CHIP_VOODOO5:
       clockRanges->interlaceAllowed = TRUE;
       break;
@@ -1271,11 +1278,11 @@ TDFXMapMem(ScrnInfoPtr pScrn)
      * FIXME: don't have any such hardware to test.
      */
     for (i = 0; i < pTDFX->numChips; i++) {
-	err = pci_device_map_memory_range(pTDFX->PciInfo[i],
-					  pTDFX->MMIOAddr[i],
-					  TDFXIOMAPSIZE,
-					  TRUE,
-					  & pTDFX->MMIOBase[i]);
+	err = pci_device_map_range(pTDFX->PciInfo[i],
+				   pTDFX->MMIOAddr[i],
+				   TDFXIOMAPSIZE,
+				   PCI_DEV_MAP_FLAG_WRITABLE,
+				   & pTDFX->MMIOBase[i]);
 	if (err) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "Unable to map MMIO region for card %u (%d).\n",
@@ -1285,11 +1292,11 @@ TDFXMapMem(ScrnInfoPtr pScrn)
     }
     
 
-    err = pci_device_map_memory_range(pTDFX->PciInfo[0],
-				      pTDFX->LinearAddr[0],
-				      pTDFX->FbMapSize,
-				      TRUE,
-				      & pTDFX->FbBase);
+    err = pci_device_map_range(pTDFX->PciInfo[0],
+			       pTDFX->LinearAddr[0],
+			       pTDFX->FbMapSize,
+			       PCI_DEV_MAP_FLAG_WRITABLE,
+			       & pTDFX->FbBase);
     if (err) {
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		   "Unable to map framebuffer (%d).\n", err);
@@ -1325,8 +1332,15 @@ TDFXUnmapMem(ScrnInfoPtr pScrn)
   pTDFX = TDFXPTR(pScrn);
 
 #ifdef XSERVER_LIBPCIACCESS
-    pci_device_unmap_region(pTDFX->PciInfo[0], 0);
-    pci_device_unmap_region(pTDFX->PciInfo[0], 1);
+    pci_device_unmap_range(pTDFX->PciInfo[0],
+                           pTDFX->FbBase,
+                           pTDFX->FbMapSize);
+
+    for (i = 0; i < pTDFX->numChips; i++) {
+        pci_device_unmap_range(pTDFX->PciInfo[i],
+                               pTDFX->MMIOBase[i],
+                               TDFXIOMAPSIZE);
+    }
 
     (void) memset(pTDFX->MMIOBase, 0, sizeof(pTDFX->MMIOBase));
     pTDFX->FbBase = NULL;
@@ -2279,7 +2293,7 @@ TDFXScreenInit(SCREEN_INIT_ARGS_DECL) {
   }
 
   scanlines = (pTDFX->backOffset - pTDFX->fbOffset) / pTDFX->stride;
-  if(pTDFX->ChipType < PCI_CHIP_VOODOO5) {
+  if(pTDFX->ChipType < PCI_CHIP_VOODOO4) {
       if (scanlines > 2047) 
 	scanlines = 2047;
   } else {
@@ -2388,7 +2402,6 @@ TDFXScreenInit(SCREEN_INIT_ARGS_DECL) {
     }
   }
 
-  miInitializeBackingStore(pScreen);
   xf86SetBackingStore(pScreen);
   xf86SetSilkenMouse(pScreen);
 
@@ -2601,14 +2614,13 @@ TDFXValidMode(SCRN_ARG_TYPE arg, Display
     switch (pTDFX->ChipType) {
       case PCI_CHIP_BANSHEE:
         return MODE_BAD;
-        break;
+      case PCI_CHIP_VELOCITY:
       case PCI_CHIP_VOODOO3:
+      case PCI_CHIP_VOODOO4:
       case PCI_CHIP_VOODOO5:
         return MODE_OK;
-        break;
       default:
         return MODE_BAD;
-        break;
     }
   }
   /* In clock doubled mode widths must be divisible by 16 instead of 8 */

Reply via email to