st/xorg: Don't use deprecated x*alloc / xfree functions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
This commit is contained in:
parent
0301c9ac62
commit
2ab7a8a3eb
|
@ -361,7 +361,7 @@ crtc_destroy(xf86CrtcPtr crtc)
|
|||
|
||||
drmModeFreeCrtc(crtcp->drm_crtc);
|
||||
|
||||
xfree(crtcp);
|
||||
free(crtcp);
|
||||
crtc->driver_private = NULL;
|
||||
}
|
||||
|
||||
|
@ -409,7 +409,7 @@ xorg_crtc_init(ScrnInfoPtr pScrn)
|
|||
if (crtc == NULL)
|
||||
goto out;
|
||||
|
||||
crtcp = xcalloc(1, sizeof(struct crtc_private));
|
||||
crtcp = calloc(1, sizeof(struct crtc_private));
|
||||
if (!crtcp) {
|
||||
xf86CrtcDestroy(crtc);
|
||||
goto out;
|
||||
|
|
|
@ -201,11 +201,11 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
|
|||
DRI2Buffer2Ptr buffer;
|
||||
BufferPrivatePtr private;
|
||||
|
||||
buffer = xcalloc(1, sizeof *buffer);
|
||||
buffer = calloc(1, sizeof *buffer);
|
||||
if (!buffer)
|
||||
return NULL;
|
||||
|
||||
private = xcalloc(1, sizeof *private);
|
||||
private = calloc(1, sizeof *private);
|
||||
if (!private) {
|
||||
goto fail;
|
||||
}
|
||||
|
@ -217,9 +217,9 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
|
|||
if (dri2_do_create_buffer(pDraw, (DRI2BufferPtr)buffer, format))
|
||||
return buffer;
|
||||
|
||||
xfree(private);
|
||||
free(private);
|
||||
fail:
|
||||
xfree(buffer);
|
||||
free(buffer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -229,8 +229,8 @@ dri2_destroy_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer)
|
|||
/* So far it is safe to downcast a DRI2Buffer2Ptr to DRI2BufferPtr */
|
||||
dri2_do_destroy_buffer(pDraw, (DRI2BufferPtr)buffer);
|
||||
|
||||
xfree(buffer->driverPrivate);
|
||||
xfree(buffer);
|
||||
free(buffer->driverPrivate);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
#endif /* DRI2INFOREC_VERSION >= 2 */
|
||||
|
@ -244,11 +244,11 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
|
|||
DRI2BufferPtr buffers;
|
||||
int i;
|
||||
|
||||
buffers = xcalloc(count, sizeof *buffers);
|
||||
buffers = calloc(count, sizeof *buffers);
|
||||
if (!buffers)
|
||||
goto fail_buffers;
|
||||
|
||||
privates = xcalloc(count, sizeof *privates);
|
||||
privates = calloc(count, sizeof *privates);
|
||||
if (!privates)
|
||||
goto fail_privates;
|
||||
|
||||
|
@ -263,9 +263,9 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
|
|||
return buffers;
|
||||
|
||||
fail:
|
||||
xfree(privates);
|
||||
free(privates);
|
||||
fail_privates:
|
||||
xfree(buffers);
|
||||
free(buffers);
|
||||
fail_buffers:
|
||||
return NULL;
|
||||
}
|
||||
|
@ -280,8 +280,8 @@ dri2_destroy_buffers(DrawablePtr pDraw, DRI2BufferPtr buffers, int count)
|
|||
}
|
||||
|
||||
if (buffers) {
|
||||
xfree(buffers[0].driverPrivate);
|
||||
xfree(buffers);
|
||||
free(buffers[0].driverPrivate);
|
||||
free(buffers);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ xorg_tracker_set_functions(ScrnInfoPtr scrn)
|
|||
Bool
|
||||
xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
|
||||
{
|
||||
char *BusID = xalloc(64);
|
||||
char *BusID = malloc(64);
|
||||
sprintf(BusID, "pci:%04x:%02x:%02x.%d",
|
||||
device->domain, device->bus,
|
||||
device->dev, device->func);
|
||||
|
@ -130,14 +130,14 @@ xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
|
|||
if (drmCheckModesettingSupported(BusID)) {
|
||||
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
|
||||
"Drm modesetting not supported %s\n", BusID);
|
||||
xfree(BusID);
|
||||
free(BusID);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
|
||||
"Drm modesetting supported on %s\n", BusID);
|
||||
|
||||
xfree(BusID);
|
||||
free(BusID);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ drv_free_rec(ScrnInfoPtr pScrn)
|
|||
if (!pScrn->driverPrivate)
|
||||
return;
|
||||
|
||||
xfree(pScrn->driverPrivate);
|
||||
free(pScrn->driverPrivate);
|
||||
|
||||
pScrn->driverPrivate = NULL;
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
|
|||
if (ms->fd < 0) {
|
||||
char *BusID;
|
||||
|
||||
BusID = xalloc(64);
|
||||
BusID = malloc(64);
|
||||
sprintf(BusID, "PCI:%d:%d:%d",
|
||||
((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
|
||||
ms->PciInfo->dev, ms->PciInfo->func
|
||||
|
@ -283,7 +283,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
|
|||
|
||||
ms->fd = drmOpen(driver_descriptor.driver_name, BusID);
|
||||
ms->isMaster = TRUE;
|
||||
xfree(BusID);
|
||||
free(BusID);
|
||||
|
||||
if (ms->fd >= 0)
|
||||
return TRUE;
|
||||
|
@ -432,7 +432,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
|
|||
|
||||
/* Process the options */
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
if (!(ms->Options = xalloc(sizeof(drv_options))))
|
||||
if (!(ms->Options = malloc(sizeof(drv_options))))
|
||||
return FALSE;
|
||||
memcpy(ms->Options, drv_options, sizeof(drv_options));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
|
||||
|
|
|
@ -720,7 +720,7 @@ ExaCreatePixmap(ScreenPtr pScreen, int size, int align)
|
|||
{
|
||||
struct exa_pixmap_priv *priv;
|
||||
|
||||
priv = xcalloc(1, sizeof(struct exa_pixmap_priv));
|
||||
priv = calloc(1, sizeof(struct exa_pixmap_priv));
|
||||
if (!priv)
|
||||
return NULL;
|
||||
|
||||
|
@ -737,7 +737,7 @@ ExaDestroyPixmap(ScreenPtr pScreen, void *dPriv)
|
|||
|
||||
pipe_resource_reference(&priv->tex, NULL);
|
||||
|
||||
xfree(priv);
|
||||
free(priv);
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
@ -975,7 +975,7 @@ xorg_exa_close(ScrnInfoPtr pScrn)
|
|||
ms->ctx = NULL;
|
||||
|
||||
exaDriverFini(pScrn->pScreen);
|
||||
xfree(exa);
|
||||
free(exa);
|
||||
ms->exa = NULL;
|
||||
}
|
||||
|
||||
|
@ -987,7 +987,7 @@ xorg_exa_init(ScrnInfoPtr pScrn, Bool accel)
|
|||
ExaDriverPtr pExa;
|
||||
CustomizerPtr cust = ms->cust;
|
||||
|
||||
exa = xcalloc(1, sizeof(struct exa_context));
|
||||
exa = calloc(1, sizeof(struct exa_context));
|
||||
if (!exa)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ output_get_modes(xf86OutputPtr output)
|
|||
for (i = 0; i < drm_connector->count_modes; i++) {
|
||||
drm_mode = &drm_connector->modes[i];
|
||||
if (drm_mode) {
|
||||
mode = xcalloc(1, sizeof(DisplayModeRec));
|
||||
mode = calloc(1, sizeof(DisplayModeRec));
|
||||
if (!mode)
|
||||
continue;
|
||||
mode->Clock = drm_mode->clock;
|
||||
|
@ -195,7 +195,7 @@ output_destroy(xf86OutputPtr output)
|
|||
{
|
||||
struct output_private *priv = output->driver_private;
|
||||
drmModeFreeConnector(priv->drm_connector);
|
||||
xfree(priv);
|
||||
free(priv);
|
||||
output->driver_private = NULL;
|
||||
}
|
||||
|
||||
|
@ -262,14 +262,14 @@ xorg_output_init(ScrnInfoPtr pScrn)
|
|||
drm_connector->connector_type_id);
|
||||
|
||||
|
||||
priv = xcalloc(sizeof(*priv), 1);
|
||||
priv = calloc(sizeof(*priv), 1);
|
||||
if (!priv) {
|
||||
continue;
|
||||
}
|
||||
|
||||
output = xf86OutputCreate(pScrn, &output_funcs, name);
|
||||
if (!output) {
|
||||
xfree(priv);
|
||||
free(priv);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue