xf86-video-r128: Branch 'master' - 2 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sat Oct 29 19:32:59 PDT 2011


 src/atipcirename.h |   22 ++++++++++++++++++++++
 src/r128_accel.c   |    2 +-
 src/r128_dga.c     |    2 +-
 src/r128_dri.c     |   36 ++++++++++++++++++------------------
 src/r128_driver.c  |   22 +++++++++++-----------
 src/r128_probe.c   |    6 +++---
 src/r128_video.c   |    8 ++++----
 7 files changed, 60 insertions(+), 38 deletions(-)

New commits:
commit ea9e6b548633df5b6ffeac8071f27a5c04ac817e
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 29 19:31:19 2011 -0700

    pciTag was removed from xorg-server, so provide it in-driver until this is updated to use libpciaccess
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/src/atipcirename.h b/src/atipcirename.h
index de8f0a3..7d9d3a8 100644
--- a/src/atipcirename.h
+++ b/src/atipcirename.h
@@ -34,6 +34,28 @@ enum region_type {
     REGION_IO 
 };
 
+#if (defined(__alpha__) || defined(__ia64__)) && defined (linux)
+#define PCI_DOM_MASK    0x01fful
+#else
+#define PCI_DOM_MASK 0x0ffu
+#endif
+
+#ifndef PCI_DOM_MASK
+# define PCI_DOM_MASK 0x0ffu
+#endif
+#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu)
+
+static inline uint32_t
+pciTag(int busnum, int devnum, int funcnum)
+{
+	uint32_t tag;
+	tag  = (busnum & (PCI_DOMBUS_MASK)) << 16;
+	tag |= (devnum & 0x00001fu) << 11;
+	tag |= (funcnum & 0x000007u) << 8;
+
+	return tag;
+}
+
 #ifndef XSERVER_LIBPCIACCESS
 
 /* pciVideoPtr */
commit cfcaac0d7861c00af23c683487dcad2fcb51a908
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 29 19:29:35 2011 -0700

    Use malloc/calloc/realloc/free directly
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/src/r128_accel.c b/src/r128_accel.c
index 8870682..eeb2bfc 100644
--- a/src/r128_accel.c
+++ b/src/r128_accel.c
@@ -1804,7 +1804,7 @@ static void R128MMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
 					       | LEFT_EDGE_CLIPPING_NEGATIVE_X;
     a->NumScanlineColorExpandBuffers   = 1;
     a->ScanlineColorExpandBuffers      = info->scratch_buffer;
-    info->scratch_save                 = xalloc(((pScrn->virtualX+31)/32*4)
+    info->scratch_save                 = malloc(((pScrn->virtualX+31)/32*4)
 					    + (pScrn->virtualX
 					    * info->CurrentLayout.pixel_bytes));
     info->scratch_buffer[0]            = info->scratch_save;
diff --git a/src/r128_dga.c b/src/r128_dga.c
index 7dd03aa..1e493ee 100644
--- a/src/r128_dga.c
+++ b/src/r128_dga.c
@@ -69,7 +69,7 @@ SECOND_PASS:
 	    if (secondPitch)
 		pitch = secondPitch;
 
-	    if (!(newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec))))
+	    if (!(newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec))))
 		break;
 
 	    modes       = newmodes;
diff --git a/src/r128_dri.c b/src/r128_dri.c
index 2927718..624e3a5 100644
--- a/src/r128_dri.c
+++ b/src/r128_dri.c
@@ -105,21 +105,21 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
 	if (R128_USE_DB)      numConfigs *= 2;
 
 	if (!(pConfigs
-	      = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
+	      = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig),
 					      numConfigs))) {
 	    return FALSE;
 	}
 	if (!(pR128Configs
-	      = (R128ConfigPrivPtr)xcalloc(sizeof(R128ConfigPrivRec),
+	      = (R128ConfigPrivPtr)calloc(sizeof(R128ConfigPrivRec),
 					     numConfigs))) {
-	    xfree(pConfigs);
+	    free(pConfigs);
 	    return FALSE;
 	}
 	if (!(pR128ConfigPtrs
-	      = (R128ConfigPrivPtr*)xcalloc(sizeof(R128ConfigPrivPtr),
+	      = (R128ConfigPrivPtr*)calloc(sizeof(R128ConfigPrivPtr),
 					      numConfigs))) {
-	    xfree(pConfigs);
-	    xfree(pR128Configs);
+	    free(pConfigs);
+	    free(pR128Configs);
 	    return FALSE;
 	}
 
@@ -188,21 +188,21 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
 	if (R128_USE_DB)      numConfigs *= 2;
 
 	if (!(pConfigs
-	      = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
+	      = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig),
 					      numConfigs))) {
 	    return FALSE;
 	}
 	if (!(pR128Configs
-	      = (R128ConfigPrivPtr)xcalloc(sizeof(R128ConfigPrivRec),
+	      = (R128ConfigPrivPtr)calloc(sizeof(R128ConfigPrivRec),
 					     numConfigs))) {
-	    xfree(pConfigs);
+	    free(pConfigs);
 	    return FALSE;
 	}
 	if (!(pR128ConfigPtrs
-	      = (R128ConfigPrivPtr*)xcalloc(sizeof(R128ConfigPrivPtr),
+	      = (R128ConfigPrivPtr*)calloc(sizeof(R128ConfigPrivPtr),
 					      numConfigs))) {
-	    xfree(pConfigs);
-	    xfree(pR128Configs);
+	    free(pConfigs);
+	    free(pR128Configs);
 	    return FALSE;
 	}
 
@@ -1026,7 +1026,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
     if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
 	pDRIInfo->busIdString = DRICreatePCIBusID(info->PciInfo);
     } else {
-	pDRIInfo->busIdString            = xalloc(64);
+	pDRIInfo->busIdString            = malloc(64);
 	sprintf(pDRIInfo->busIdString,
 		"PCI:%d:%d:%d",
 		PCI_DEV_BUS(info->PciInfo),
@@ -1065,7 +1065,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
     pDRIInfo->SAREASize = SAREA_MAX;
 #endif
 
-    if (!(pR128DRI = (R128DRIPtr)xcalloc(sizeof(R128DRIRec),1))) {
+    if (!(pR128DRI = (R128DRIPtr)calloc(sizeof(R128DRIRec),1))) {
 	DRIDestroyInfoRec(info->pDRIInfo);
 	info->pDRIInfo = NULL;
 	return FALSE;
@@ -1091,7 +1091,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
     if (!DRIScreenInit(pScreen, pDRIInfo, &info->drmFD)) {
 	xf86DrvMsg(pScreen->myNum, X_ERROR,
                    "[dri] DRIScreenInit failed.  Disabling DRI.\n");
-	xfree(pDRIInfo->devPrivate);
+	free(pDRIInfo->devPrivate);
 	pDRIInfo->devPrivate = NULL;
 	DRIDestroyInfoRec(pDRIInfo);
 	pDRIInfo = NULL;
@@ -1352,18 +1352,18 @@ void R128DRICloseScreen(ScreenPtr pScreen)
 				/* De-allocate all DRI data structures */
     if (info->pDRIInfo) {
 	if (info->pDRIInfo->devPrivate) {
-	    xfree(info->pDRIInfo->devPrivate);
+	    free(info->pDRIInfo->devPrivate);
 	    info->pDRIInfo->devPrivate = NULL;
 	}
 	DRIDestroyInfoRec(info->pDRIInfo);
 	info->pDRIInfo = NULL;
     }
     if (info->pVisualConfigs) {
-	xfree(info->pVisualConfigs);
+	free(info->pVisualConfigs);
 	info->pVisualConfigs = NULL;
     }
     if (info->pVisualConfigsPriv) {
-	xfree(info->pVisualConfigsPriv);
+	free(info->pVisualConfigsPriv);
 	info->pVisualConfigsPriv = NULL;
     }
 }
diff --git a/src/r128_driver.c b/src/r128_driver.c
index 9d08d77..eb1d978 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -228,7 +228,7 @@ static Bool R128GetRec(ScrnInfoPtr pScrn)
 static void R128FreeRec(ScrnInfoPtr pScrn)
 {
     if (!pScrn || !pScrn->driverPrivate) return;
-    xfree(pScrn->driverPrivate);
+    free(pScrn->driverPrivate);
     pScrn->driverPrivate = NULL;
 }
 
@@ -506,9 +506,9 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
 
 #ifdef XSERVER_LIBPCIACCESS
     int size = info->PciInfo->rom_size > R128_VBIOS_SIZE ? info->PciInfo->rom_size : R128_VBIOS_SIZE;
-    info->VBIOS = xalloc(size);
+    info->VBIOS = malloc(size);
 #else
-    info->VBIOS = xalloc(R128_VBIOS_SIZE);
+    info->VBIOS = malloc(R128_VBIOS_SIZE);
 #endif
 
     if (!info->VBIOS) {
@@ -541,7 +541,7 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
     }
     if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
 	info->BIOSAddr = 0x00000000;
-	xfree(info->VBIOS);
+	free(info->VBIOS);
 	info->VBIOS = NULL;
 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		   "Video BIOS not found!\n");
@@ -1519,7 +1519,7 @@ static void R128SetSyncRangeFromEdid(ScrnInfoPtr pScrn, int flag)
 }
 
 /***********
-   xfree's xf86ValidateModes routine deosn't work well with DFPs
+   free's xf86ValidateModes routine deosn't work well with DFPs
    here is our own validation routine. All modes between
    640<=XRes<=MaxRes and 480<=YRes<=MaxYRes will be permitted.
    NOTE: RageProII doesn't support rmx, can only work with the
@@ -1987,7 +1987,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 				/* We can't do this until we have a
 				   pScrn->display. */
     xf86CollectOptions(pScrn, NULL);
-    if (!(info->Options = xalloc(sizeof(R128Options))))    goto fail;
+    if (!(info->Options = malloc(sizeof(R128Options))))    goto fail;
     memcpy(info->Options, R128Options, sizeof(R128Options));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
 
@@ -2082,7 +2082,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 
 				/* Free the video bios (if applicable) */
     if (info->VBIOS) {
-	xfree(info->VBIOS);
+	free(info->VBIOS);
 	info->VBIOS = NULL;
     }
 
@@ -2101,7 +2101,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 
 				/* Free the video bios (if applicable) */
     if (info->VBIOS) {
-	xfree(info->VBIOS);
+	free(info->VBIOS);
 	info->VBIOS = NULL;
     }
 
@@ -4310,17 +4310,17 @@ static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen)
     if (info->accel)             XAADestroyInfoRec(info->accel);
     info->accel                  = NULL;
 
-    if (info->scratch_save)      xfree(info->scratch_save);
+    if (info->scratch_save)      free(info->scratch_save);
     info->scratch_save           = NULL;
 
     if (info->cursor)            xf86DestroyCursorInfoRec(info->cursor);
     info->cursor                 = NULL;
 
-    if (info->DGAModes)          xfree(info->DGAModes);
+    if (info->DGAModes)          free(info->DGAModes);
     info->DGAModes               = NULL;
 
     if (info->adaptor) {
-        xfree(info->adaptor->pPortPrivates[0].ptr);
+        free(info->adaptor->pPortPrivates[0].ptr);
 	xf86XVFreeVideoAdaptorRec(info->adaptor);
 	info->adaptor = NULL;
     }
diff --git a/src/r128_probe.c b/src/r128_probe.c
index 412da92..0477617 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -298,7 +298,7 @@ r128_get_scrninfo(int entity_num)
         instance++;
     }
 
-    xfree(pEnt);
+    free(pEnt);
 
     return TRUE;
 }
@@ -340,8 +340,8 @@ R128Probe(DriverPtr drv, int flags)
 	    foundScreen = TRUE;
     }
 
-    xfree(usedChips);
-    xfree(devSections);
+    free(usedChips);
+    free(devSections);
 
     return foundScreen;
 }
diff --git a/src/r128_video.c b/src/r128_video.c
index 8e83323..ec22ee1 100644
--- a/src/r128_video.c
+++ b/src/r128_video.c
@@ -95,7 +95,7 @@ void R128InitVideo(ScreenPtr pScreen)
 	    adaptors = &newAdaptor;
 	} else {
 	    newAdaptors =  /* need to free this someplace */
-		xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+		malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
 	    if(newAdaptors) {
 		memcpy(newAdaptors, adaptors, num_adaptors *
 					sizeof(XF86VideoAdaptorPtr));
@@ -110,7 +110,7 @@ void R128InitVideo(ScreenPtr pScreen)
 	xf86XVScreenInit(pScreen, adaptors, num_adaptors);
 
     if(newAdaptors)
-	xfree(newAdaptors);
+	free(newAdaptors);
 }
 
 #define MAXWIDTH 2048
@@ -188,9 +188,9 @@ R128AllocAdaptor(ScrnInfoPtr pScrn)
     if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn)))
 	return NULL;
 
-    if(!(pPriv = xcalloc(1, sizeof(R128PortPrivRec) + sizeof(DevUnion))))
+    if(!(pPriv = calloc(1, sizeof(R128PortPrivRec) + sizeof(DevUnion))))
     {
-	xfree(adapt);
+	free(adapt);
 	return NULL;
     }
 


More information about the xorg-commit mailing list