125
125
xnfalloc(sizeof(InputDriverRec));
126
126
*xf86InputDriverList[xf86NumInputDrivers - 1] = *driver;
127
127
xf86InputDriverList[xf86NumInputDrivers - 1]->module = module;
128
xf86InputDriverList[xf86NumInputDrivers - 1]->refCount = 0;
277
/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */
279
xf86AllocateInput(InputDriverPtr drv, int flags)
281
InputInfoPtr new, *prev = NULL;
283
if (!(new = calloc(sizeof(InputInfoRec), 1)))
288
new->module = DuplicateModule(drv->module, NULL);
290
for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
301
* Remove an entry from xf86InputDevs. Ideally it should free all allocated
302
* data. To do this properly may require a driver hook.
306
xf86DeleteInput(InputInfoPtr pInp, int flags)
310
/* First check if the inputdev is valid. */
315
/* If a free function is defined, call it here. */
321
UnloadModule(pInp->module);
324
pInp->drv->refCount--;
326
/* This should *really* be handled in drv->UnInit(dev) call instead, but
327
* if the driver forgets about it make sure we free it or at least crash
328
* with flying colors */
331
FreeInputAttributes(pInp->attrs);
333
/* Remove the entry from the list. */
334
if (pInp == xf86InputDevs)
335
xf86InputDevs = pInp->next;
338
while (p && p->next != pInp)
341
p->next = pInp->next;
342
/* Else the entry wasn't in the xf86InputDevs list (ignore this). */
348
277
xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
1199
1124
* Empty all of the clip lists on the screen
1201
1126
xf86SetRootClip (pScreen, FALSE);
1203
* save the screen pixmap devPrivate field and
1204
* replace it with NULL so accidental references
1205
* to the frame buffer are caught
1207
pScrnInfo->pixmapPrivate = pspix->devPrivate;
1208
pspix->devPrivate.ptr = NULL;
1184
/* Print input driver messages in the standard format of
1185
<driver>: <device name>: <message> */
1187
xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format,
1192
if (asprintf(&msg, "%s: %s: %s", dev->drv->driverName, dev->name, format)
1194
LogVMessageVerb(type, verb, "%s", args);
1196
LogVMessageVerb(type, verb, msg, args);
1201
/* Print input driver message, with verbose level specified directly */
1203
xf86IDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format,
1208
va_start(ap, format);
1209
xf86VIDrvMsgVerb(dev, type, verb, format, ap);
1213
/* Print input driver messages, with verbose level of 1 (default) */
1215
xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...)
1219
va_start(ap, format);
1220
xf86VIDrvMsgVerb(dev, type, 1, format, ap);
1266
1225
/* Print non-driver messages with verbose level specified directly */
1268
1227
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
1272
1231
va_start(ap, format);
1273
xf86VDrvMsgVerb(-1, type, verb, format, ap);
1232
LogVMessageVerb(type, verb, format, ap);
1283
1242
va_start(ap, format);
1284
xf86VDrvMsgVerb(-1, type, 1, format, ap);
1243
LogVMessageVerb(type, 1, format, ap);
1321
1280
/* Get the log file name */
1322
1281
if (xf86LogFileFrom == X_DEFAULT) {
1323
1282
/* Append the display number and ".log" */
1324
lf = malloc(strlen(xf86LogFile) + strlen("%s") +
1325
strlen(LOGSUFFIX) + 1);
1283
if (asprintf(&lf, "%s%%s" LOGSUFFIX, xf86LogFile) == -1)
1327
1284
FatalError("Cannot allocate space for the log file name\n");
1328
sprintf(lf, "%s%%s" LOGSUFFIX, xf86LogFile);
1329
1285
xf86LogFile = lf;