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