Replace Xalloc/Xfree with malloc/free.
Shuts down depreciation warnings during build.
This commit is contained in:
parent
009d12875d
commit
caca7d63c0
@ -166,7 +166,7 @@ RADEONGetExtTMDSInfo(ScrnInfoPtr pScrn, radeon_dvo_ptr dvo)
|
||||
dvo->DVOChip =
|
||||
RADEONDVODeviceInit(pDVOBus, dvo->dvo_i2c_slave_addr);
|
||||
if (!dvo->DVOChip)
|
||||
xfree(pDVOBus);
|
||||
free(pDVOBus);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -443,7 +443,7 @@ RADEONDVODeviceInit(I2CBusPtr b, I2CSlaveAddr addr)
|
||||
{
|
||||
I2CDevPtr dvo;
|
||||
|
||||
dvo = xcalloc(1, sizeof(I2CDevRec));
|
||||
dvo = calloc(1, sizeof(I2CDevRec));
|
||||
if (dvo == NULL)
|
||||
return NULL;
|
||||
|
||||
@ -459,7 +459,7 @@ RADEONDVODeviceInit(I2CBusPtr b, I2CSlaveAddr addr)
|
||||
return dvo;
|
||||
}
|
||||
|
||||
xfree(dvo);
|
||||
free(dvo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2083,7 +2083,7 @@ R600DrawInit(ScreenPtr pScreen)
|
||||
info->accel_state->vsync = FALSE;
|
||||
|
||||
if (!exaDriverInit(pScreen, info->accel_state->exa)) {
|
||||
xfree(info->accel_state->exa);
|
||||
free(info->accel_state->exa);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1206,7 +1206,7 @@ FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a)
|
||||
a->ScanlineColorExpandBuffers = info->accel_state->scratch_buffer;
|
||||
if (!info->accel_state->scratch_save)
|
||||
info->accel_state->scratch_save
|
||||
= xalloc(((pScrn->virtualX+31)/32*4)
|
||||
= malloc(((pScrn->virtualX+31)/32*4)
|
||||
+ (pScrn->virtualX * info->CurrentLayout.pixel_bytes));
|
||||
info->accel_state->scratch_buffer[0] = info->accel_state->scratch_save;
|
||||
a->SetupForScanlineCPUToScreenColorExpandFill
|
||||
|
@ -489,7 +489,7 @@ rhdAtomAllocateFbScratch(atomBiosHandlePtr handle,
|
||||
xf86DrvMsg(handle->scrnIndex, X_INFO,
|
||||
"Cannot get VRAM scratch space. "
|
||||
"Allocating in main memory instead\n");
|
||||
handle->scratchBase = xcalloc(fb_size,1);
|
||||
handle->scratchBase = calloc(fb_size,1);
|
||||
return ATOM_SUCCESS;
|
||||
}
|
||||
return ATOM_FAILED;
|
||||
@ -591,14 +591,14 @@ rhdAtomInit(atomBiosHandlePtr unused1, AtomBiosRequestID unused2,
|
||||
BIOSImageSize = RADEON_VBIOS_SIZE;
|
||||
#endif
|
||||
|
||||
if (!(atomDataPtr = xcalloc(1, sizeof(atomDataTables)))) {
|
||||
if (!(atomDataPtr = calloc(1, sizeof(atomDataTables)))) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"Cannot allocate memory for "
|
||||
"ATOM BIOS data tabes\n");
|
||||
goto error;
|
||||
}
|
||||
if (!rhdAtomGetDataTable(scrnIndex, info->VBIOS, atomDataPtr, &cmd_offset, BIOSImageSize))
|
||||
goto error1;
|
||||
if (!(handle = xcalloc(1, sizeof(atomBiosHandleRec)))) {
|
||||
if (!(handle = calloc(1, sizeof(atomBiosHandleRec)))) {
|
||||
xf86DrvMsg(scrnIndex,X_ERROR,"Cannot allocate memory\n");
|
||||
goto error1;
|
||||
}
|
||||
@ -617,7 +617,7 @@ rhdAtomInit(atomBiosHandlePtr unused1, AtomBiosRequestID unused2,
|
||||
return ATOM_SUCCESS;
|
||||
|
||||
error1:
|
||||
xfree(atomDataPtr);
|
||||
free(atomDataPtr);
|
||||
error:
|
||||
return ATOM_FAILED;
|
||||
}
|
||||
@ -628,10 +628,10 @@ rhdAtomTearDown(atomBiosHandlePtr handle,
|
||||
{
|
||||
//RHDFUNC(handle);
|
||||
|
||||
xfree(handle->BIOSBase);
|
||||
xfree(handle->atomDataPtr);
|
||||
if (handle->scratchBase) xfree(handle->scratchBase);
|
||||
xfree(handle);
|
||||
free(handle->BIOSBase);
|
||||
free(handle->atomDataPtr);
|
||||
if (handle->scratchBase) free(handle->scratchBase);
|
||||
free(handle);
|
||||
return ATOM_SUCCESS;
|
||||
}
|
||||
|
||||
@ -717,7 +717,7 @@ rhdAtomDTDTimings(atomBiosHandlePtr handle, ATOM_DTD_FORMAT *dtd)
|
||||
if (!dtd->usHActive || !dtd->usVActive)
|
||||
return NULL;
|
||||
|
||||
if (!(mode = (DisplayModePtr)xcalloc(1,sizeof(DisplayModeRec))))
|
||||
if (!(mode = (DisplayModePtr)calloc(1,sizeof(DisplayModeRec))))
|
||||
return NULL;
|
||||
|
||||
mode->CrtcHDisplay = mode->HDisplay = le16_to_cpu(dtd->usHActive);
|
||||
@ -801,7 +801,7 @@ rhdAtomLvdsDDC(atomBiosHandlePtr handle, uint32_t offset, unsigned char *record)
|
||||
- sizeof(UCHAR);
|
||||
if (offset > handle->BIOSImageSize) break;
|
||||
/* dup string as we free it later */
|
||||
if (!(EDIDBlock = (unsigned char *)xalloc(
|
||||
if (!(EDIDBlock = (unsigned char *)malloc(
|
||||
((ATOM_FAKE_EDID_PATCH_RECORD*)record)->ucFakeEDIDLength)))
|
||||
return NULL;
|
||||
memcpy(EDIDBlock,&((ATOM_FAKE_EDID_PATCH_RECORD*)record)->ucFakeEDIDString,
|
||||
@ -811,7 +811,7 @@ rhdAtomLvdsDDC(atomBiosHandlePtr handle, uint32_t offset, unsigned char *record)
|
||||
{
|
||||
xf86MonPtr mon = xf86InterpretEDID(handle->scrnIndex,EDIDBlock);
|
||||
xf86PrintEDID(mon);
|
||||
xfree(mon);
|
||||
free(mon);
|
||||
}
|
||||
return EDIDBlock;
|
||||
|
||||
@ -1638,9 +1638,9 @@ radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_suppo
|
||||
if (device_support & ATOM_DEVICE_LCD1_SUPPORT) {
|
||||
if (info->encoders[device_index]->dev_priv == NULL) {
|
||||
info->encoders[device_index]->dev_priv =
|
||||
(radeon_lvds_ptr)xcalloc(1,sizeof(radeon_lvds_rec));
|
||||
(radeon_lvds_ptr)calloc(1,sizeof(radeon_lvds_rec));
|
||||
if (info->encoders[device_index]->dev_priv == NULL) {
|
||||
ErrorF("xalloc failed\n");
|
||||
ErrorF("malloc failed\n");
|
||||
return FALSE;
|
||||
} else
|
||||
RADEONGetATOMLVDSInfo(pScrn, (radeon_lvds_ptr)info->encoders[device_index]->dev_priv);
|
||||
@ -1652,7 +1652,7 @@ radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_suppo
|
||||
}
|
||||
}
|
||||
|
||||
info->encoders[device_index] = (radeon_encoder_ptr)xcalloc(1,sizeof(radeon_encoder_rec));
|
||||
info->encoders[device_index] = (radeon_encoder_ptr)calloc(1,sizeof(radeon_encoder_rec));
|
||||
if (info->encoders[device_index] != NULL) {
|
||||
info->encoders[device_index]->ref_count++;
|
||||
info->encoders[device_index]->encoder_id = encoder_id;
|
||||
@ -1661,9 +1661,9 @@ radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_suppo
|
||||
// add dev_priv stuff
|
||||
switch (encoder_id) {
|
||||
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
|
||||
info->encoders[device_index]->dev_priv = (radeon_lvds_ptr)xcalloc(1,sizeof(radeon_lvds_rec));
|
||||
info->encoders[device_index]->dev_priv = (radeon_lvds_ptr)calloc(1,sizeof(radeon_lvds_rec));
|
||||
if (info->encoders[device_index]->dev_priv == NULL) {
|
||||
ErrorF("xalloc failed\n");
|
||||
ErrorF("malloc failed\n");
|
||||
return FALSE;
|
||||
} else {
|
||||
if (info->IsAtomBios)
|
||||
@ -1674,9 +1674,9 @@ radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_suppo
|
||||
break;
|
||||
case ENCODER_OBJECT_ID_INTERNAL_DAC2:
|
||||
if (!IS_AVIVO_VARIANT) {
|
||||
info->encoders[device_index]->dev_priv = (radeon_tvdac_ptr)xcalloc(1,sizeof(radeon_tvdac_rec));
|
||||
info->encoders[device_index]->dev_priv = (radeon_tvdac_ptr)calloc(1,sizeof(radeon_tvdac_rec));
|
||||
if (info->encoders[device_index]->dev_priv == NULL) {
|
||||
ErrorF("xalloc failed\n");
|
||||
ErrorF("malloc failed\n");
|
||||
return FALSE;
|
||||
} else
|
||||
RADEONGetTVDacAdjInfo(pScrn, (radeon_tvdac_ptr)info->encoders[device_index]->dev_priv);
|
||||
@ -1684,9 +1684,9 @@ radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_suppo
|
||||
break;
|
||||
case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
|
||||
if (!IS_AVIVO_VARIANT) {
|
||||
info->encoders[device_index]->dev_priv = (radeon_tmds_ptr)xcalloc(1,sizeof(radeon_tmds_rec));
|
||||
info->encoders[device_index]->dev_priv = (radeon_tmds_ptr)calloc(1,sizeof(radeon_tmds_rec));
|
||||
if (info->encoders[device_index]->dev_priv == NULL) {
|
||||
ErrorF("xalloc failed\n");
|
||||
ErrorF("malloc failed\n");
|
||||
return FALSE;
|
||||
} else
|
||||
RADEONGetTMDSInfo(pScrn, (radeon_tmds_ptr)info->encoders[device_index]->dev_priv);
|
||||
@ -1694,9 +1694,9 @@ radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_suppo
|
||||
break;
|
||||
case ENCODER_OBJECT_ID_INTERNAL_DVO1:
|
||||
if (!IS_AVIVO_VARIANT) {
|
||||
info->encoders[device_index]->dev_priv = (radeon_dvo_ptr)xcalloc(1,sizeof(radeon_dvo_rec));
|
||||
info->encoders[device_index]->dev_priv = (radeon_dvo_ptr)calloc(1,sizeof(radeon_dvo_rec));
|
||||
if (info->encoders[device_index]->dev_priv == NULL) {
|
||||
ErrorF("xalloc failed\n");
|
||||
ErrorF("malloc failed\n");
|
||||
return FALSE;
|
||||
} else
|
||||
RADEONGetExtTMDSInfo(pScrn, (radeon_dvo_ptr)info->encoders[device_index]->dev_priv);
|
||||
@ -1708,9 +1708,9 @@ radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_suppo
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_LVTM1:
|
||||
if (device_support & ATOM_DEVICE_LCD1_SUPPORT) {
|
||||
info->encoders[device_index]->dev_priv = (radeon_lvds_ptr)xcalloc(1,sizeof(radeon_lvds_rec));
|
||||
info->encoders[device_index]->dev_priv = (radeon_lvds_ptr)calloc(1,sizeof(radeon_lvds_rec));
|
||||
if (info->encoders[device_index]->dev_priv == NULL) {
|
||||
ErrorF("xalloc failed\n");
|
||||
ErrorF("malloc failed\n");
|
||||
return FALSE;
|
||||
} else
|
||||
RADEONGetATOMLVDSInfo(pScrn, (radeon_lvds_ptr)info->encoders[device_index]->dev_priv);
|
||||
@ -1719,7 +1719,7 @@ radeon_add_encoder(ScrnInfoPtr pScrn, uint32_t encoder_id, uint32_t device_suppo
|
||||
}
|
||||
return TRUE;
|
||||
} else {
|
||||
ErrorF("xalloc failed\n");
|
||||
ErrorF("malloc failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -296,9 +296,9 @@ RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
int size = info->PciInfo->rom_size > RADEON_VBIOS_SIZE ? info->PciInfo->rom_size : RADEON_VBIOS_SIZE;
|
||||
info->VBIOS = xalloc(size);
|
||||
info->VBIOS = malloc(size);
|
||||
#else
|
||||
info->VBIOS = xalloc(RADEON_VBIOS_SIZE);
|
||||
info->VBIOS = malloc(RADEON_VBIOS_SIZE);
|
||||
#endif
|
||||
if (!info->VBIOS) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
@ -316,7 +316,7 @@ RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
|
||||
if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
"Unrecognized BIOS signature, BIOS data will not be used\n");
|
||||
xfree (info->VBIOS);
|
||||
free (info->VBIOS);
|
||||
info->VBIOS = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
@ -331,7 +331,7 @@ RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
|
||||
else if (info->VBIOS[dptr + 0x14] != 0x0) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
"Not an x86 BIOS ROM image, BIOS data will not be used\n");
|
||||
xfree (info->VBIOS);
|
||||
free (info->VBIOS);
|
||||
info->VBIOS = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
@ -341,7 +341,7 @@ RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
|
||||
if(!info->ROMHeaderStart) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
"Invalid ROM pointer, BIOS data will not be used\n");
|
||||
xfree (info->VBIOS);
|
||||
free (info->VBIOS);
|
||||
info->VBIOS = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -642,7 +642,7 @@ Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask)
|
||||
pRADEONEnt->Controller[1] = xnfcalloc(sizeof(RADEONCrtcPrivateRec), 1);
|
||||
if (!pRADEONEnt->Controller[1])
|
||||
{
|
||||
xfree(pRADEONEnt->Controller[0]);
|
||||
free(pRADEONEnt->Controller[0]);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -121,21 +121,21 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
|
||||
if (use_db) numConfigs *= 2;
|
||||
|
||||
if (!(pConfigs
|
||||
= (__GLXvisualConfig *)xcalloc(sizeof(__GLXvisualConfig),
|
||||
= (__GLXvisualConfig *)calloc(sizeof(__GLXvisualConfig),
|
||||
numConfigs))) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!(pRADEONConfigs
|
||||
= (RADEONConfigPrivPtr)xcalloc(sizeof(RADEONConfigPrivRec),
|
||||
= (RADEONConfigPrivPtr)calloc(sizeof(RADEONConfigPrivRec),
|
||||
numConfigs))) {
|
||||
xfree(pConfigs);
|
||||
free(pConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
if (!(pRADEONConfigPtrs
|
||||
= (RADEONConfigPrivPtr *)xcalloc(sizeof(RADEONConfigPrivPtr),
|
||||
= (RADEONConfigPrivPtr *)calloc(sizeof(RADEONConfigPrivPtr),
|
||||
numConfigs))) {
|
||||
xfree(pConfigs);
|
||||
xfree(pRADEONConfigs);
|
||||
free(pConfigs);
|
||||
free(pRADEONConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -207,21 +207,21 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
|
||||
if (use_db) numConfigs *= 2;
|
||||
|
||||
if (!(pConfigs
|
||||
= (__GLXvisualConfig *)xcalloc(sizeof(__GLXvisualConfig),
|
||||
= (__GLXvisualConfig *)calloc(sizeof(__GLXvisualConfig),
|
||||
numConfigs))) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!(pRADEONConfigs
|
||||
= (RADEONConfigPrivPtr)xcalloc(sizeof(RADEONConfigPrivRec),
|
||||
= (RADEONConfigPrivPtr)calloc(sizeof(RADEONConfigPrivRec),
|
||||
numConfigs))) {
|
||||
xfree(pConfigs);
|
||||
free(pConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
if (!(pRADEONConfigPtrs
|
||||
= (RADEONConfigPrivPtr *)xcalloc(sizeof(RADEONConfigPrivPtr),
|
||||
= (RADEONConfigPrivPtr *)calloc(sizeof(RADEONConfigPrivPtr),
|
||||
numConfigs))) {
|
||||
xfree(pConfigs);
|
||||
xfree(pRADEONConfigs);
|
||||
free(pConfigs);
|
||||
free(pRADEONConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -566,12 +566,12 @@ static void RADEONDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
||||
|
||||
if (nbox > 1) {
|
||||
/* Keep ordering in each band, reverse order of bands */
|
||||
pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
|
||||
pboxNew1 = (BoxPtr)malloc(sizeof(BoxRec)*nbox);
|
||||
if (!pboxNew1) return;
|
||||
|
||||
pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
|
||||
pptNew1 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox);
|
||||
if (!pptNew1) {
|
||||
xfree(pboxNew1);
|
||||
free(pboxNew1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -608,14 +608,14 @@ static void RADEONDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
||||
|
||||
if (nbox > 1) {
|
||||
/* reverse order of rects in each band */
|
||||
pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
|
||||
pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
|
||||
pboxNew2 = (BoxPtr)malloc(sizeof(BoxRec)*nbox);
|
||||
pptNew2 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox);
|
||||
|
||||
if (!pboxNew2 || !pptNew2) {
|
||||
xfree(pptNew2);
|
||||
xfree(pboxNew2);
|
||||
xfree(pptNew1);
|
||||
xfree(pboxNew1);
|
||||
free(pptNew2);
|
||||
free(pboxNew2);
|
||||
free(pptNew1);
|
||||
free(pboxNew1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -686,10 +686,10 @@ static void RADEONDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
||||
|
||||
info->accel_state->dst_pitch_offset = info->dri->frontPitchOffset;;
|
||||
|
||||
xfree(pptNew2);
|
||||
xfree(pboxNew2);
|
||||
xfree(pptNew1);
|
||||
xfree(pboxNew1);
|
||||
free(pptNew2);
|
||||
free(pboxNew2);
|
||||
free(pptNew1);
|
||||
free(pboxNew1);
|
||||
|
||||
info->accel_state->accel->NeedToSync = TRUE;
|
||||
#endif /* USE_XAA */
|
||||
@ -1406,7 +1406,7 @@ Bool RADEONDRIGetVersion(ScrnInfoPtr pScrn)
|
||||
if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
|
||||
busId = DRICreatePCIBusID(info->PciInfo);
|
||||
} else {
|
||||
busId = xalloc(64);
|
||||
busId = malloc(64);
|
||||
sprintf(busId,
|
||||
"PCI:%d:%d:%d",
|
||||
PCI_DEV_BUS(info->PciInfo),
|
||||
@ -1416,7 +1416,7 @@ Bool RADEONDRIGetVersion(ScrnInfoPtr pScrn)
|
||||
|
||||
/* Low level DRM open */
|
||||
fd = drmOpen(RADEON_DRIVER_NAME, busId);
|
||||
xfree(busId);
|
||||
free(busId);
|
||||
if (fd < 0) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"[dri] RADEONDRIGetVersion failed to open the DRM\n"
|
||||
@ -1550,7 +1550,7 @@ Bool RADEONDRIScreenInit(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),
|
||||
@ -1597,7 +1597,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
|
||||
pDRIInfo->SAREASize = SAREA_MAX;
|
||||
#endif
|
||||
|
||||
if (!(pRADEONDRI = (RADEONDRIPtr)xcalloc(sizeof(RADEONDRIRec),1))) {
|
||||
if (!(pRADEONDRI = (RADEONDRIPtr)calloc(sizeof(RADEONDRIRec),1))) {
|
||||
DRIDestroyInfoRec(info->dri->pDRIInfo);
|
||||
info->dri->pDRIInfo = NULL;
|
||||
return FALSE;
|
||||
@ -1644,7 +1644,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
|
||||
if (!DRIScreenInit(pScreen, pDRIInfo, &info->dri->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;
|
||||
@ -1928,7 +1928,7 @@ void RADEONDRICloseScreen(ScreenPtr pScreen)
|
||||
}
|
||||
|
||||
if (info->dri->pciGartBackup) {
|
||||
xfree(info->dri->pciGartBackup);
|
||||
free(info->dri->pciGartBackup);
|
||||
info->dri->pciGartBackup = NULL;
|
||||
}
|
||||
|
||||
@ -1938,18 +1938,18 @@ void RADEONDRICloseScreen(ScreenPtr pScreen)
|
||||
/* De-allocate all DRI data structures */
|
||||
if (info->dri->pDRIInfo) {
|
||||
if (info->dri->pDRIInfo->devPrivate) {
|
||||
xfree(info->dri->pDRIInfo->devPrivate);
|
||||
free(info->dri->pDRIInfo->devPrivate);
|
||||
info->dri->pDRIInfo->devPrivate = NULL;
|
||||
}
|
||||
DRIDestroyInfoRec(info->dri->pDRIInfo);
|
||||
info->dri->pDRIInfo = NULL;
|
||||
}
|
||||
if (info->dri->pVisualConfigs) {
|
||||
xfree(info->dri->pVisualConfigs);
|
||||
free(info->dri->pVisualConfigs);
|
||||
info->dri->pVisualConfigs = NULL;
|
||||
}
|
||||
if (info->dri->pVisualConfigsPriv) {
|
||||
xfree(info->dri->pVisualConfigsPriv);
|
||||
free(info->dri->pVisualConfigsPriv);
|
||||
info->dri->pVisualConfigsPriv = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -367,17 +367,17 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn)
|
||||
info = RADEONPTR(pScrn);
|
||||
|
||||
if (info->cp) {
|
||||
xfree(info->cp);
|
||||
free(info->cp);
|
||||
info->cp = NULL;
|
||||
}
|
||||
|
||||
if (info->dri) {
|
||||
xfree(info->dri);
|
||||
free(info->dri);
|
||||
info->dri = NULL;
|
||||
}
|
||||
|
||||
if (info->accel_state) {
|
||||
xfree(info->accel_state);
|
||||
free(info->accel_state);
|
||||
info->accel_state = NULL;
|
||||
}
|
||||
|
||||
@ -387,15 +387,15 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn)
|
||||
if (info->encoders[i]->ref_count != 0)
|
||||
continue;
|
||||
if (info->encoders[i]->dev_priv) {
|
||||
xfree(info->encoders[i]->dev_priv);
|
||||
free(info->encoders[i]->dev_priv);
|
||||
info->encoders[i]->dev_priv = NULL;
|
||||
}
|
||||
xfree(info->encoders[i]);
|
||||
free(info->encoders[i]);
|
||||
info->encoders[i]= NULL;
|
||||
}
|
||||
}
|
||||
|
||||
xfree(pScrn->driverPrivate);
|
||||
free(pScrn->driverPrivate);
|
||||
pScrn->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
@ -2056,7 +2056,7 @@ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn)
|
||||
char *optstr;
|
||||
#endif
|
||||
|
||||
if (!(info->accel_state = xcalloc(1, sizeof(struct radeon_accel_state)))) {
|
||||
if (!(info->accel_state = calloc(1, sizeof(struct radeon_accel_state)))) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to allocate accel_state rec!\n");
|
||||
return FALSE;
|
||||
}
|
||||
@ -2210,12 +2210,12 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
|
||||
info->directRenderingEnabled = FALSE;
|
||||
info->directRenderingInited = FALSE;
|
||||
|
||||
if (!(info->dri = xcalloc(1, sizeof(struct radeon_dri)))) {
|
||||
if (!(info->dri = calloc(1, sizeof(struct radeon_dri)))) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"Unable to allocate dri rec!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!(info->cp = xcalloc(1, sizeof(struct radeon_cp)))) {
|
||||
if (!(info->cp = calloc(1, sizeof(struct radeon_cp)))) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"Unable to allocate cp rec!\n");
|
||||
return FALSE;
|
||||
}
|
||||
@ -2913,7 +2913,7 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
/* We can't do this until we have a
|
||||
pScrn->display. */
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
if (!(info->Options = xalloc(sizeof(RADEONOptions))))
|
||||
if (!(info->Options = malloc(sizeof(RADEONOptions))))
|
||||
goto fail;
|
||||
|
||||
memcpy(info->Options, RADEONOptions, sizeof(RADEONOptions));
|
||||
@ -3127,7 +3127,7 @@ fail:
|
||||
/* Pre-init failed. */
|
||||
/* Free the video bios (if applicable) */
|
||||
if (info->VBIOS) {
|
||||
xfree(info->VBIOS);
|
||||
free(info->VBIOS);
|
||||
info->VBIOS = NULL;
|
||||
}
|
||||
|
||||
@ -3585,7 +3585,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
|
||||
"Initializing fb layer\n");
|
||||
|
||||
if (info->r600_shadow_fb) {
|
||||
info->fb_shadow = xcalloc(1,
|
||||
info->fb_shadow = calloc(1,
|
||||
pScrn->displayWidth * pScrn->virtualY *
|
||||
((pScrn->bitsPerPixel + 7) >> 3));
|
||||
if (info->fb_shadow == NULL) {
|
||||
@ -5869,7 +5869,7 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
#ifdef USE_EXA
|
||||
if (info->accel_state->exa) {
|
||||
exaDriverFini(pScreen);
|
||||
xfree(info->accel_state->exa);
|
||||
free(info->accel_state->exa);
|
||||
info->accel_state->exa = NULL;
|
||||
}
|
||||
#endif /* USE_EXA */
|
||||
@ -5880,7 +5880,7 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
info->accel_state->accel = NULL;
|
||||
|
||||
if (info->accel_state->scratch_save)
|
||||
xfree(info->accel_state->scratch_save);
|
||||
free(info->accel_state->scratch_save);
|
||||
info->accel_state->scratch_save = NULL;
|
||||
}
|
||||
#endif /* USE_XAA */
|
||||
@ -5892,7 +5892,7 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
|
||||
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
|
||||
"Disposing DGA\n");
|
||||
if (info->DGAModes) xfree(info->DGAModes);
|
||||
if (info->DGAModes) free(info->DGAModes);
|
||||
info->DGAModes = NULL;
|
||||
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
|
||||
"Unmapping memory\n");
|
||||
|
@ -547,7 +547,7 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr pScreen)
|
||||
RADEONEngineInit(pScrn);
|
||||
|
||||
if (!exaDriverInit(pScreen, info->accel_state->exa)) {
|
||||
xfree(info->accel_state->exa);
|
||||
free(info->accel_state->exa);
|
||||
return FALSE;
|
||||
}
|
||||
exaMarkSync(pScreen);
|
||||
|
@ -1053,7 +1053,7 @@ static void
|
||||
radeon_destroy (xf86OutputPtr output)
|
||||
{
|
||||
if (output->driver_private)
|
||||
xfree(output->driver_private);
|
||||
free(output->driver_private);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -141,7 +141,7 @@ radeon_get_scrninfo(int entity_num)
|
||||
}
|
||||
}
|
||||
|
||||
xfree(pEnt);
|
||||
free(pEnt);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -185,8 +185,8 @@ RADEONProbe(DriverPtr drv, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
xfree(usedChips);
|
||||
xfree(devSections);
|
||||
free(usedChips);
|
||||
free(devSections);
|
||||
|
||||
return foundScreen;
|
||||
}
|
||||
|
@ -725,7 +725,7 @@ RADEONSetupImageTexturedVideo(ScreenPtr pScreen)
|
||||
int i;
|
||||
int num_texture_ports = 16;
|
||||
|
||||
adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) + num_texture_ports *
|
||||
adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + num_texture_ports *
|
||||
(sizeof(RADEONPortPrivRec) + sizeof(DevUnion)));
|
||||
if (adapt == NULL)
|
||||
return NULL;
|
||||
|
@ -277,7 +277,7 @@ void RADEONInitVideo(ScreenPtr pScreen)
|
||||
|
||||
|
||||
num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
|
||||
newAdaptors = xalloc((num_adaptors + 2) * sizeof(XF86VideoAdaptorPtr *));
|
||||
newAdaptors = malloc((num_adaptors + 2) * sizeof(XF86VideoAdaptorPtr *));
|
||||
if (newAdaptors == NULL)
|
||||
return;
|
||||
|
||||
@ -312,7 +312,7 @@ void RADEONInitVideo(ScreenPtr pScreen)
|
||||
xf86XVScreenInit(pScreen, adaptors, num_adaptors);
|
||||
|
||||
if(newAdaptors)
|
||||
xfree(newAdaptors);
|
||||
free(newAdaptors);
|
||||
|
||||
}
|
||||
|
||||
@ -1413,7 +1413,7 @@ static void RADEONSetupTheatre(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Unsupported reference clock frequency, Rage Theatre disabled\n");
|
||||
t->theatre_num=-1;
|
||||
xfree(pPriv->theatre);
|
||||
free(pPriv->theatre);
|
||||
pPriv->theatre = NULL;
|
||||
return;
|
||||
}
|
||||
@ -1432,9 +1432,9 @@ RADEONAllocAdaptor(ScrnInfoPtr pScrn)
|
||||
if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn)))
|
||||
return NULL;
|
||||
|
||||
if(!(pPriv = xcalloc(1, sizeof(RADEONPortPrivRec) + sizeof(DevUnion))))
|
||||
if(!(pPriv = calloc(1, sizeof(RADEONPortPrivRec) + sizeof(DevUnion))))
|
||||
{
|
||||
xfree(adapt);
|
||||
free(adapt);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1545,7 +1545,7 @@ RADEONAllocAdaptor(ScrnInfoPtr pScrn)
|
||||
if(!xf86LoadSubModule(pScrn,"theatre"))
|
||||
{
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"Unable to load Rage Theatre module\n");
|
||||
xfree(pPriv->theatre);
|
||||
free(pPriv->theatre);
|
||||
goto skip_theatre;
|
||||
}
|
||||
break;
|
||||
@ -1555,7 +1555,7 @@ RADEONAllocAdaptor(ScrnInfoPtr pScrn)
|
||||
if(!xf86LoadSubModule(pScrn,"theatre200"))
|
||||
{
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"Unable to load Rage Theatre module\n");
|
||||
xfree(pPriv->theatre);
|
||||
free(pPriv->theatre);
|
||||
goto skip_theatre;
|
||||
}
|
||||
pPriv->theatre->microc_path = info->RageTheatreMicrocPath;
|
||||
@ -1565,7 +1565,7 @@ RADEONAllocAdaptor(ScrnInfoPtr pScrn)
|
||||
default:
|
||||
{
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"Unknown Theatre chip\n");
|
||||
xfree(pPriv->theatre);
|
||||
free(pPriv->theatre);
|
||||
goto skip_theatre;
|
||||
}
|
||||
}
|
||||
@ -1576,7 +1576,7 @@ RADEONAllocAdaptor(ScrnInfoPtr pScrn)
|
||||
xf86_InitTheatre(pPriv->theatre);
|
||||
if(pPriv->theatre->mode == MODE_UNINITIALIZED)
|
||||
{
|
||||
Xfree(pPriv->theatre);
|
||||
free(pPriv->theatre);
|
||||
pPriv->theatre = NULL;
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Rage Theatre disabled\n");
|
||||
/* Here the modules must be unloaded */
|
||||
@ -3199,18 +3199,18 @@ RADEONAllocateSurface(
|
||||
surface->width = w;
|
||||
surface->height = h;
|
||||
|
||||
if(!(surface->pitches = xalloc(sizeof(int)))) {
|
||||
if(!(surface->pitches = malloc(sizeof(int)))) {
|
||||
radeon_legacy_free_memory(pScrn, surface_memory);
|
||||
return BadAlloc;
|
||||
}
|
||||
if(!(surface->offsets = xalloc(sizeof(int)))) {
|
||||
xfree(surface->pitches);
|
||||
if(!(surface->offsets = malloc(sizeof(int)))) {
|
||||
free(surface->pitches);
|
||||
radeon_legacy_free_memory(pScrn, surface_memory);
|
||||
return BadAlloc;
|
||||
}
|
||||
if(!(pPriv = xalloc(sizeof(OffscreenPrivRec)))) {
|
||||
xfree(surface->pitches);
|
||||
xfree(surface->offsets);
|
||||
if(!(pPriv = malloc(sizeof(OffscreenPrivRec)))) {
|
||||
free(surface->pitches);
|
||||
free(surface->offsets);
|
||||
radeon_legacy_free_memory(pScrn, surface_memory);
|
||||
return BadAlloc;
|
||||
}
|
||||
@ -3254,9 +3254,9 @@ RADEONFreeSurface(
|
||||
RADEONStopSurface(surface);
|
||||
radeon_legacy_free_memory(pScrn, pPriv->surface_memory);
|
||||
pPriv->surface_memory = NULL;
|
||||
xfree(surface->pitches);
|
||||
xfree(surface->offsets);
|
||||
xfree(surface->devPrivate.ptr);
|
||||
free(surface->pitches);
|
||||
free(surface->offsets);
|
||||
free(surface->devPrivate.ptr);
|
||||
|
||||
return Success;
|
||||
}
|
||||
@ -3371,7 +3371,7 @@ RADEONInitOffscreenImages(ScreenPtr pScreen)
|
||||
XF86OffscreenImagePtr offscreenImages;
|
||||
/* need to free this someplace */
|
||||
|
||||
if (!(offscreenImages = xalloc(sizeof(XF86OffscreenImageRec))))
|
||||
if (!(offscreenImages = malloc(sizeof(XF86OffscreenImageRec))))
|
||||
return;
|
||||
|
||||
offscreenImages[0].image = &Images[0];
|
||||
|
@ -349,7 +349,7 @@ void RADEONVIP_reset(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
|
||||
|
||||
void RADEONVIP_init(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
|
||||
{
|
||||
pPriv->VIP=xcalloc(1,sizeof(GENERIC_BUS_Rec));
|
||||
pPriv->VIP=calloc(1,sizeof(GENERIC_BUS_Rec));
|
||||
pPriv->VIP->scrnIndex=pScrn->scrnIndex;
|
||||
pPriv->VIP->DriverPrivate.ptr=pPriv;
|
||||
pPriv->VIP->ioctl=RADEONVIP_ioctl;
|
||||
|
@ -46,7 +46,7 @@ TheatrePtr DetectTheatre(GENERIC_BUS_Ptr b)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
t = xcalloc(1,sizeof(TheatreRec));
|
||||
t = calloc(1,sizeof(TheatreRec));
|
||||
t->VIP = b;
|
||||
t->theatre_num = -1;
|
||||
t->mode=MODE_UNINITIALIZED;
|
||||
@ -81,7 +81,7 @@ TheatrePtr DetectTheatre(GENERIC_BUS_Ptr b)
|
||||
|
||||
if(t->theatre_num < 0)
|
||||
{
|
||||
xfree(t);
|
||||
free(t);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,10 @@
|
||||
* authorization from the author.
|
||||
*
|
||||
* $Log: theatre200.c,v $
|
||||
* Revision 1.2 2012/03/04 15:44:48 matthieu
|
||||
* Replace Xalloc/Xfree with malloc/free.
|
||||
* Shuts down depreciation warnings during build.
|
||||
*
|
||||
* Revision 1.1 2012/01/25 21:27:07 matthieu
|
||||
* Add radeon driver 6.12.2 renamed as 'radeonold'.
|
||||
*
|
||||
@ -175,7 +179,7 @@ static int microc_load (char* micro_path, char* micro_type, struct rt200_microc_
|
||||
{
|
||||
int ret;
|
||||
|
||||
curr_seg = (struct rt200_microc_seg*)Xalloc(sizeof(struct rt200_microc_seg));
|
||||
curr_seg = (struct rt200_microc_seg*)malloc(sizeof(struct rt200_microc_seg));
|
||||
if (curr_seg == NULL)
|
||||
{
|
||||
ERROR_0("Cannot allocate memory\n");
|
||||
@ -191,7 +195,7 @@ static int microc_load (char* micro_path, char* micro_type, struct rt200_microc_
|
||||
goto fail_exit;
|
||||
}
|
||||
|
||||
curr_seg->data = (unsigned char*)Xalloc(curr_seg->num_bytes);
|
||||
curr_seg->data = (unsigned char*)malloc(curr_seg->num_bytes);
|
||||
if (curr_seg->data == NULL)
|
||||
{
|
||||
ERROR_0("cannot allocate memory\n");
|
||||
@ -254,7 +258,7 @@ static int microc_load (char* micro_path, char* micro_type, struct rt200_microc_
|
||||
|
||||
for (i = 0; i < microc_headp->num_seg; i++)
|
||||
{
|
||||
curr_seg = (struct rt200_microc_seg*)Xalloc(sizeof(struct rt200_microc_seg));
|
||||
curr_seg = (struct rt200_microc_seg*)malloc(sizeof(struct rt200_microc_seg));
|
||||
if (curr_seg == NULL)
|
||||
{
|
||||
ERROR_0("Cannot allocate memory\n");
|
||||
@ -275,7 +279,7 @@ static int microc_load (char* micro_path, char* micro_type, struct rt200_microc_
|
||||
goto fail_exit;
|
||||
}
|
||||
|
||||
curr_seg->data = (unsigned char*)Xalloc(curr_seg->num_bytes);
|
||||
curr_seg->data = (unsigned char*)malloc(curr_seg->num_bytes);
|
||||
if (curr_seg->data == NULL)
|
||||
{
|
||||
ERROR_0("cannot allocate memory\n");
|
||||
@ -331,10 +335,10 @@ fail_exit:
|
||||
curr_seg = seg_list;
|
||||
while(curr_seg)
|
||||
{
|
||||
Xfree(curr_seg->data);
|
||||
free(curr_seg->data);
|
||||
prev_seg = curr_seg;
|
||||
curr_seg = curr_seg->next;
|
||||
Xfree(prev_seg);
|
||||
free(prev_seg);
|
||||
}
|
||||
fclose(file);
|
||||
|
||||
@ -348,10 +352,10 @@ static void microc_clean(struct rt200_microc_data* microc_datap, int screen)
|
||||
|
||||
while(seg_list)
|
||||
{
|
||||
Xfree(seg_list->data);
|
||||
free(seg_list->data);
|
||||
prev_seg = seg_list;
|
||||
seg_list = seg_list->next;
|
||||
Xfree(prev_seg);
|
||||
free(prev_seg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,10 @@
|
||||
* authorization from the author.
|
||||
*
|
||||
* $Log: theatre_detect.c,v $
|
||||
* Revision 1.2 2012/03/04 15:44:48 matthieu
|
||||
* Replace Xalloc/Xfree with malloc/free.
|
||||
* Shuts down depreciation warnings during build.
|
||||
*
|
||||
* Revision 1.1 2012/01/25 21:27:07 matthieu
|
||||
* Add radeon driver 6.12.2 renamed as 'radeonold'.
|
||||
*
|
||||
@ -92,7 +96,7 @@ _X_EXPORT TheatrePtr DetectTheatre(GENERIC_BUS_Ptr b)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
t = xcalloc(1,sizeof(TheatreRec));
|
||||
t = calloc(1,sizeof(TheatreRec));
|
||||
t->VIP = b;
|
||||
t->theatre_num = -1;
|
||||
t->mode=MODE_UNINITIALIZED;
|
||||
@ -126,7 +130,7 @@ _X_EXPORT TheatrePtr DetectTheatre(GENERIC_BUS_Ptr b)
|
||||
|
||||
if(t->theatre_num < 0)
|
||||
{
|
||||
xfree(t);
|
||||
free(t);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user