diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-11-25 15:06:15 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-12-20 15:01:56 +1000 |
commit | 5bfc1940e22026410cae7fcff12594a413a8b7db (patch) | |
tree | 3497d4201f938975e601f340b444715db71a8b47 /src | |
parent | f77091d09bf093f6168d3bf0424121b9231232d8 (diff) | |
download | xf86-input-wacom-5bfc1940e22026410cae7fcff12594a413a8b7db.tar.gz |
Switch all uses of xf86IDrvMsg and others over to our custom logger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/wcmCommon.c | 16 | ||||
-rw-r--r-- | src/wcmConfig.c | 16 | ||||
-rw-r--r-- | src/wcmFilter.c | 4 | ||||
-rw-r--r-- | src/wcmISDV4.c | 41 | ||||
-rw-r--r-- | src/wcmTouchFilter.c | 2 | ||||
-rw-r--r-- | src/wcmUSB.c | 56 | ||||
-rw-r--r-- | src/wcmValidateDevice.c | 67 | ||||
-rw-r--r-- | src/wcmXCommand.c | 4 | ||||
-rw-r--r-- | src/xf86Wacom.c | 24 |
9 files changed, 111 insertions, 119 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 4a634ac..0d4e121 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -1141,7 +1141,7 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel, /* Tool on the tablet when driver starts. This sometime causes * access errors to the device */ if (!tool->enabled) { - LogMessageVerbSigSafe(X_ERROR, 0, "tool not initialized yet. Skipping event. \n"); + wcmLog(NULL, W_ERROR, "tool not initialized yet. Skipping event. \n"); return; } @@ -1334,8 +1334,7 @@ static void detectPressureIssue(WacomDevicePtr priv, and is too close to the maximum pressure */ if (priv->oldMinPressure > pressureThreshold && priv->eventCnt > MIN_EVENT_COUNT) - LogMessageVerbSigSafe( - X_WARNING, 0, + wcmLog(NULL, W_WARNING, "On %s(%d) a base pressure of %d persists while the pen is in proximity.\n" "\tThis is > %d percent of the maximum value (%d).\n" "\tThis indicates a worn out pen, it is time to change your tool. Also see:\n" @@ -1536,7 +1535,6 @@ static void commonDispatchDevice(WacomDevicePtr priv, int wcmInitTablet(WacomDevicePtr priv) { - InputInfoPtr pInfo = priv->pInfo; WacomCommonPtr common = priv->common; WacomModelPtr model = common->wcmModel; @@ -1550,29 +1548,29 @@ int wcmInitTablet(WacomDevicePtr priv) /* Threshold for counting pressure as a button */ common->wcmThreshold = priv->maxCurve * DEFAULT_THRESHOLD; - xf86IDrvMsg(pInfo, X_PROBED, "using pressure threshold of %d for button 1\n", + wcmLog(priv, W_PROBED, "using pressure threshold of %d for button 1\n", common->wcmThreshold); } /* Calculate default panscroll threshold if not set */ - xf86IDrvMsg(pInfo, X_CONFIG, "panscroll is %d\n", common->wcmPanscrollThreshold); + wcmLog(priv, W_CONFIG, "panscroll is %d\n", common->wcmPanscrollThreshold); if (common->wcmPanscrollThreshold < 1) { common->wcmPanscrollThreshold = common->wcmResolY * 13 / 1000; /* 13mm */ } if (common->wcmPanscrollThreshold < 1) { common->wcmPanscrollThreshold = 1000; } - xf86IDrvMsg(pInfo, X_CONFIG, "panscroll modified to %d\n", common->wcmPanscrollThreshold); + wcmLog(priv, W_CONFIG, "panscroll modified to %d\n", common->wcmPanscrollThreshold); /* output tablet state as probed */ if (IsPen(priv)) - xf86IDrvMsg(pInfo, X_PROBED, "maxX=%d maxY=%d maxZ=%d " + wcmLog(priv, W_PROBED, "maxX=%d maxY=%d maxZ=%d " "resX=%d resY=%d tilt=%s\n", common->wcmMaxX, common->wcmMaxY, common->wcmMaxZ, common->wcmResolX, common->wcmResolY, HANDLE_TILT(common) ? "enabled" : "disabled"); else if (IsTouch(priv)) - xf86IDrvMsg(pInfo, X_PROBED, "maxX=%d maxY=%d maxZ=%d " + wcmLog(priv, W_PROBED, "maxX=%d maxY=%d maxZ=%d " "resX=%d resY=%d \n", common->wcmMaxTouchX, common->wcmMaxTouchY, common->wcmMaxZ, diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 9b64d1b..f57c07d 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -173,7 +173,7 @@ wcmSetType(WacomDevicePtr priv, const char *type) return 1; invalid: - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "No type or invalid type specified.\n" "Must be one of stylus, touch, cursor, eraser, or pad\n"); @@ -438,7 +438,6 @@ static Bool wcmMatchDevice(WacomDevicePtr priv, WacomCommonPtr *common_return) static Bool wcmDetectDeviceClass(WacomDevicePtr priv) { - InputInfoPtr pInfo = priv->pInfo; WacomCommonPtr common = priv->common; if (common->wcmDevCls) @@ -450,7 +449,7 @@ wcmDetectDeviceClass(WacomDevicePtr priv) else if (gWacomUSBDevice.Detect(priv)) common->wcmDevCls = &gWacomUSBDevice; else - xf86IDrvMsg(pInfo, X_ERROR, "cannot identify device class.\n"); + wcmLog(priv, W_ERROR, "cannot identify device class.\n"); return (common->wcmDevCls != NULL); } @@ -613,8 +612,7 @@ char *wcmEventAutoDevProbe (WacomDevicePtr priv) is_wacom = wcmIsWacomDevice(fname); if (is_wacom) { - xf86IDrvMsg(pInfo, X_PROBED, - "probed device is %s (waited %d msec)\n", fname, wait); + wcmLog(priv, W_PROBED, "probed device is %s (waited %d msec)\n", fname, wait); xf86ReplaceStrOption(pInfo->options, "Device", fname); /* this assumes there is only one Wacom device on the system */ @@ -622,12 +620,12 @@ char *wcmEventAutoDevProbe (WacomDevicePtr priv) } } wait += 100; - xf86IDrvMsg(pInfo, X_ERROR, "waiting 100 msec (total %dms) for device to become ready\n", wait); + wcmLog(priv, W_ERROR, "waiting 100 msec (total %dms) for device to become ready\n", wait); usleep(100*1000); } - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "no Wacom event device found (checked %d nodes, waited %d msec)\n", i + 1, wait); - xf86IDrvMsg(pInfo, X_ERROR, "unable to probe device\n"); + wcmLog(priv, W_ERROR, "unable to probe device\n"); return NULL; } @@ -758,7 +756,7 @@ int wcmPreInit(WacomDevicePtr priv) /* check if the type is valid for those don't need hotplug */ if(!need_hotplug && !wcmIsAValidType(priv, type)) { - xf86IDrvMsg(pInfo, X_ERROR, "Invalid type '%s' for this device.\n", type); + wcmLog(priv, W_ERROR, "Invalid type '%s' for this device.\n", type); goto SetupProc_fail; } diff --git a/src/wcmFilter.c b/src/wcmFilter.c index a057ae1..54c8a8b 100644 --- a/src/wcmFilter.c +++ b/src/wcmFilter.c @@ -65,8 +65,8 @@ void wcmSetPressureCurve(WacomDevicePtr pDev, int x0, int y0, pDev->pPressCurve = calloc(FILTER_PRESSURE_RES+1, sizeof(*pDev->pPressCurve)); if (!pDev->pPressCurve) { - LogMessageVerbSigSafe(X_WARNING, 0, - "Unable to allocate memory for pressure curve; using default.\n"); + wcmLog(NULL, W_WARNING, + "Unable to allocate memory for pressure curve; using default.\n"); x0 = 0; y0 = 0; x1 = 100; diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c index 9791227..292e325 100644 --- a/src/wcmISDV4.c +++ b/src/wcmISDV4.c @@ -106,12 +106,12 @@ static void memdump(WacomDevicePtr priv, char *buffer, unsigned int len) /* can't use DBG macro here, need to do it manually. */ for (i = 0 ; i < len && common->debugLevel >= 10; i++) { - LogMessageVerbSigSafe(X_NONE, 0, "%#hhx ", buffer[i]); + wcmLog(NULL, W_NONE, "%#hhx ", buffer[i]); if (i % 8 == 7) - LogMessageVerbSigSafe(X_NONE, 0, "\n"); + wcmLog(NULL, W_NONE, "\n"); } - LogMessageVerbSigSafe(X_NONE, 0, "\n"); + wcmLog(NULL, W_NONE, "\n"); #endif } @@ -122,7 +122,7 @@ static int wcmWait(int t) if (err != -1) return Success; - LogMessageVerbSigSafe(X_ERROR, 0, "Wacom select error : %s\n", strerror(errno)); + wcmLog(NULL, W_ERROR, "Wacom select error : %s\n", strerror(errno)); return err; } @@ -161,7 +161,7 @@ static int wcmSerialValidate(WacomDevicePtr priv, const unsigned char* data) if (!(data[0] & HEADER_BIT)) { n = wcmSkipInvalidBytes(data, common->wcmPktLength); - LogMessageVerbSigSafe(X_WARNING, 0, + wcmLog(NULL, W_WARNING, "missing header bit. skipping %d bytes.\n", n); return n; @@ -174,7 +174,7 @@ static int wcmSerialValidate(WacomDevicePtr priv, const unsigned char* data) n = wcmSkipInvalidBytes(&data[1], common->wcmPktLength - 1); n += 1; /* the header byte we already checked */ if (n != common->wcmPktLength) { - LogMessageVerbSigSafe(X_WARNING, 0, "%s: bad data at %d v=%x l=%d\n", pInfo->name, + wcmLog(NULL, W_WARNING, "%s: bad data at %d v=%x l=%d\n", pInfo->name, n, data[n], common->wcmPktLength); return n; } @@ -222,7 +222,7 @@ static Bool isdv4ParseOptions(WacomDevicePtr priv) pInfo->options = xf86ReplaceIntOption(pInfo->options, "BaudRate", baud); break; default: - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "Illegal speed value (must be 19200 or 38400)."); return FALSE; @@ -232,7 +232,7 @@ static Bool isdv4ParseOptions(WacomDevicePtr priv) { if (!(common->private = calloc(1, sizeof(wcmISDV4Data)))) { - xf86IDrvMsg(pInfo, X_ERROR, "failed to alloc backend-specific data.\n"); + wcmLog(priv, W_ERROR, "failed to alloc backend-specific data.\n"); return FALSE; } isdv4data = common->private; @@ -341,7 +341,7 @@ static int isdv4InitISDV4(WacomDevicePtr priv) /* Try with the other baudrate */ baud = (isdv4data->baudrate == 38400)? 19200 : 38400; - xf86IDrvMsg(pInfo, X_WARNING, + wcmLog(priv, W_WARNING, "Query failed with %d baud. Trying %d.\n", isdv4data->baudrate, baud); @@ -369,7 +369,7 @@ static int isdv4InitISDV4(WacomDevicePtr priv) rc = isdv4ParseQuery((unsigned char*)data, sizeof(data), &reply); if (rc <= 0) { - xf86IDrvMsg(pInfo, X_ERROR, "Error while parsing ISDV4 query.\n"); + wcmLog(priv, W_ERROR, "Error while parsing ISDV4 query.\n"); if (rc == 0) DBG(2, common, "reply or len invalid.\n"); @@ -423,7 +423,7 @@ static int isdv4InitISDV4(WacomDevicePtr priv) rc = isdv4ParseTouchQuery((unsigned char*)data, sizeof(data), &reply); if (rc <= 0) { - xf86IDrvMsg(pInfo, X_ERROR, "Error while parsing ISDV4 touch query.\n"); + wcmLog(priv, W_ERROR, "Error while parsing ISDV4 touch query.\n"); if (rc == 0) DBG(2, common, "reply or len invalid.\n"); @@ -473,7 +473,7 @@ static int isdv4InitISDV4(WacomDevicePtr priv) (common->tablet_id != 0x9F)) { - xf86IDrvMsg(pInfo, X_WARNING, + wcmLog(priv, W_WARNING, "tablet id(%x) mismatch with data id (0x01) \n", common->tablet_id); goto out; @@ -484,7 +484,7 @@ static int isdv4InitISDV4(WacomDevicePtr priv) if ((common->tablet_id != 0xE2) && (common->tablet_id != 0xE3)) { - xf86IDrvMsg(pInfo, X_WARNING, + wcmLog(priv, W_WARNING, "tablet id(%x) mismatch with data id (0x03) \n", common->tablet_id); goto out; @@ -515,7 +515,7 @@ static int isdv4InitISDV4(WacomDevicePtr priv) common->wcmTouchResolY); } - xf86IDrvMsg(pInfo, X_INFO, "serial tablet id 0x%X.\n", common->tablet_id); + wcmLog(priv, W_INFO, "serial tablet id 0x%X.\n", common->tablet_id); out: if (ret == Success) @@ -595,7 +595,7 @@ static int isdv4ParseTouchPacket(WacomDevicePtr priv, const unsigned char *data, rc = isdv4ParseTouchData(data, len, common->wcmPktLength, &touchdata); if (rc <= 0) { - LogMessageVerbSigSafe(X_ERROR, 0, "%s: failed to parse touch data (err %d).\n", + wcmLog(NULL, W_ERROR, "%s: failed to parse touch data (err %d).\n", pInfo->name, rc); return -1; } @@ -670,8 +670,7 @@ static int isdv4ParsePenPacket(WacomDevicePtr priv, const unsigned char *data, if (rc == -1) { - LogMessageVerbSigSafe(X_ERROR, 0, - "%s: failed to parse coordinate data.\n", pInfo->name); + wcmLog(NULL, W_ERROR, "%s: failed to parse coordinate data.\n", pInfo->name); return -1; } @@ -821,7 +820,7 @@ static int wcmWriteWait(WacomDevicePtr priv, const char* request) SYSCALL((len = write(pInfo->fd, request, strlen(request)))); if ((len == -1) && (errno != EAGAIN)) { - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "wcmWriteWait error : %s\n", strerror(errno)); return 0; } @@ -831,7 +830,7 @@ static int wcmWriteWait(WacomDevicePtr priv, const char* request) } while ((len <= 0) && maxtry); if (!maxtry) - xf86IDrvMsg(pInfo, X_WARNING, + wcmLog(priv, W_WARNING, "Failed to issue command '%s' after %d tries.\n", request, MAXTRY); @@ -856,7 +855,7 @@ static int wcmWaitForTablet(WacomDevicePtr priv, char* answer, int size) SYSCALL((len = read(pInfo->fd, answer, size))); if ((len == -1) && (errno != EAGAIN)) { - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "xf86ReadSerial error : %s\n", strerror(errno)); return 0; @@ -866,7 +865,7 @@ static int wcmWaitForTablet(WacomDevicePtr priv, char* answer, int size) } while ((len <= 0) && maxtry); if (!maxtry) - xf86IDrvMsg(pInfo, X_WARNING, + wcmLog(priv, W_WARNING, "Waited too long for answer (failed after %d tries).\n", MAXTRY); diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index 0828175..04acc75 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -410,7 +410,7 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id) if (!IsTouch(priv)) { /* this should never happen */ - LogMessageVerbSigSafe(X_ERROR, 0, "WACOM: No touch device found for %s \n", + wcmLog(NULL, W_ERROR, "WACOM: No touch device found for %s \n", common->device_path); return; } diff --git a/src/wcmUSB.c b/src/wcmUSB.c index 68cb517..67f39a5 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -122,7 +122,7 @@ static Bool usbDetect(WacomDevicePtr priv) if (err < 0) { - xf86IDrvMsg(pInfo, X_ERROR, "usbDetect: can not ioctl version\n"); + wcmLog(priv, W_ERROR, "usbDetect: can not ioctl version\n"); return 0; } @@ -138,7 +138,7 @@ static Bool usbParseOptions(WacomDevicePtr priv) if (!common->private && !(common->private = calloc(1, sizeof(wcmUSBData)))) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to alloc event queue.\n"); + wcmLog(priv, W_ERROR, "unable to alloc event queue.\n"); return FALSE; } @@ -167,7 +167,7 @@ usbStart(WacomDevicePtr priv) /* this is called for all tools, so all but the first one fails with * EBUSY */ if (err < 0 && errno != EBUSY) - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "Wacom X driver can't grab event device (%s)\n", strerror(errno)); } @@ -441,14 +441,14 @@ static Bool usbWcmInit(WacomDevicePtr priv) /* fetch vendor, product, and model name */ if (ioctl(pInfo->fd, EVIOCGID, &sID) == -1) { - xf86IDrvMsg(pInfo, X_ERROR, "failed to ioctl ID .\n"); + wcmLog(priv, W_ERROR, "failed to ioctl ID .\n"); return !Success; } if (!common->private && !(common->private = calloc(1, sizeof(wcmUSBData)))) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to alloc event queue.\n"); + wcmLog(priv, W_ERROR, "unable to alloc event queue.\n"); return !Success; } @@ -598,7 +598,7 @@ int usbInitialize(WacomDevicePtr priv) if (ioctl(pInfo->fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to ioctl event bits.\n"); + wcmLog(priv, W_ERROR, "unable to ioctl event bits.\n"); return !Success; } @@ -609,14 +609,14 @@ int usbInitialize(WacomDevicePtr priv) ISBITSET(common->wcmKeys, BTN_0)) goto pad_init; - xf86IDrvMsg(pInfo, X_ERROR, "no abs bits.\n"); + wcmLog(priv, W_ERROR, "no abs bits.\n"); return !Success; } /* absolute values */ if (ioctl(pInfo->fd, EVIOCGBIT(EV_ABS, sizeof(abs)), abs) < 0) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to ioctl max values.\n"); + wcmLog(priv, W_ERROR, "unable to ioctl max values.\n"); return !Success; } @@ -628,13 +628,13 @@ int usbInitialize(WacomDevicePtr priv) ISBITSET(common->wcmKeys, BTN_0)) goto pad_init; - xf86IDrvMsg(pInfo, X_ERROR, "unable to ioctl xmax value.\n"); + wcmLog(priv, W_ERROR, "unable to ioctl xmax value.\n"); return !Success; } if (absinfo.maximum <= 0) { - xf86IDrvMsg(pInfo, X_ERROR, "xmax value is %d, expected > 0.\n", + wcmLog(priv, W_ERROR, "xmax value is %d, expected > 0.\n", absinfo.maximum); return !Success; } @@ -654,13 +654,13 @@ int usbInitialize(WacomDevicePtr priv) /* max y */ if (ioctl(pInfo->fd, EVIOCGABS(ABS_Y), &absinfo) < 0) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to ioctl ymax value.\n"); + wcmLog(priv, W_ERROR, "unable to ioctl ymax value.\n"); return !Success; } if (absinfo.maximum <= 0) { - xf86IDrvMsg(pInfo, X_ERROR, "ymax value is %d, expected > 0.\n", absinfo.maximum); + wcmLog(priv, W_ERROR, "ymax value is %d, expected > 0.\n", absinfo.maximum); return !Success; } @@ -812,7 +812,7 @@ int usbInitialize(WacomDevicePtr priv) if (ioctl(pInfo->fd, EVIOCGBIT(EV_SW, sizeof(sw)), sw) < 0) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to ioctl sw bits.\n"); + wcmLog(priv, W_ERROR, "unable to ioctl sw bits.\n"); return 0; } else if (ISBITSET(sw, SW_MUTE_DEVICE)) @@ -822,7 +822,7 @@ int usbInitialize(WacomDevicePtr priv) memset(sw, 0, sizeof(sw)); if (ioctl(pInfo->fd, EVIOCGSW(sizeof(sw)), sw) < 0) - xf86IDrvMsg(pInfo, X_ERROR, "unable to ioctl sw state.\n"); + wcmLog(priv, W_ERROR, "unable to ioctl sw state.\n"); if (ISBITSET(sw, SW_MUTE_DEVICE)) common->wcmHWTouchSwitchState = 0; @@ -1006,8 +1006,8 @@ static void usbParseEvent(WacomDevicePtr priv, /* space left? bail if not. */ if (private->wcmEventCnt >= ARRAY_SIZE(private->wcmEvents)) { - LogMessageVerbSigSafe(X_ERROR, 0, "%s: usbParse: Exceeded event queue (%d) \n", - pInfo->name, private->wcmEventCnt); + wcmLog(NULL, W_ERROR, "%s: usbParse: Exceeded event queue (%d) \n", + pInfo->name, private->wcmEventCnt); usbResetEventCounter(private); return; } @@ -1049,8 +1049,7 @@ static void usbParseMscEvent(WacomDevicePtr priv, /* we don't report serial numbers for some tools but we never report * a serial number with a value of 0 - if that happens drop the * whole frame */ - LogMessageVerbSigSafe(X_ERROR, 0, - "%s: usbParse: Ignoring event from invalid serial 0\n", + wcmLog(NULL, W_ERROR, "%s: usbParse: Ignoring event from invalid serial 0\n", pInfo->name); usbResetEventCounter(private); } @@ -1382,9 +1381,9 @@ mod_buttons(int buttons, int btn, int state) if (btn >= sizeof(int) * 8) { - LogMessageVerbSigSafe(X_ERROR, 0, - "%s: Invalid button number %d. Insufficient storage\n", - __func__, btn); + wcmLog(NULL, W_ERROR, + "%s: Invalid button number %d. Insufficient storage\n", + __func__, btn); return buttons; } @@ -1728,7 +1727,6 @@ static int deviceTypeFromEvent(WacomDevicePtr priv, int type, int code, int valu */ static int refreshDeviceType(WacomDevicePtr priv, int fd) { - InputInfoPtr pInfo = priv->pInfo; WacomCommonPtr common = priv->common; int device_type = 0; unsigned long keys[NBITS(KEY_MAX)] = { 0 }; @@ -1736,7 +1734,7 @@ static int refreshDeviceType(WacomDevicePtr priv, int fd) int i; if (rc == -1) { - xf86IDrvMsg(pInfo, X_ERROR, "failed to retrieve key bits on %s\n", common->device_path); + wcmLog(priv, W_ERROR, "failed to retrieve key bits on %s\n", common->device_path); return 0; } @@ -1884,7 +1882,7 @@ static void usbDispatchEvents(WacomDevicePtr priv) dslast = common->wcmChannel[channel].valid.state; if (ds->device_type && ds->device_type != private->wcmDeviceType) - LogMessageVerbSigSafe(X_ERROR, 0, + wcmLog(NULL, W_ERROR, "usbDispatchEvents: Device Type mismatch - %d -> %d. This is a BUG.\n", ds->device_type, private->wcmDeviceType); /* no device type? */ @@ -1940,7 +1938,7 @@ static void usbDispatchEvents(WacomDevicePtr priv) common->wcmChannel[channel].dirty |= TRUE; } else - LogMessageVerbSigSafe(X_ERROR, 0, + wcmLog(NULL, W_ERROR, "%s: rel event recv'd (%d)!\n", pInfo->name, event->code); @@ -2054,28 +2052,28 @@ static int usbProbeKeys(WacomDevicePtr priv) if (ioctl(pInfo->fd, EVIOCGBIT(EV_KEY, (sizeof(unsigned long) * NBITS(KEY_MAX))), common->wcmKeys) < 0) { - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "usbProbeKeys unable to ioctl USB key bits.\n"); return 0; } if (ioctl(pInfo->fd, EVIOCGPROP(sizeof(common->wcmInputProps)), common->wcmInputProps) < 0) { - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "usbProbeKeys unable to ioctl input properties.\n"); return 0; } if (ioctl(pInfo->fd, EVIOCGID, &wacom_id) < 0) { - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "usbProbeKeys unable to ioctl Device ID.\n"); return 0; } if (ioctl(pInfo->fd, EVIOCGBIT(EV_ABS, sizeof(abs)), abs) < 0) { - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "usbProbeKeys unable to ioctl abs bits.\n"); return 0; } diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index 599dc0b..8cd95a0 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -66,7 +66,7 @@ static Bool wcmCheckSource(WacomDevicePtr priv, dev_t min_maj) } } if (match) - xf86IDrvMsg(pInfo, X_WARNING, + wcmLog(priv, W_WARNING, "device file already in use by %s. Ignoring.\n", pDevices->name); return match; } @@ -92,7 +92,8 @@ int wcmIsDuplicate(const char* device, WacomDevicePtr priv) if (stat(device, &st) == -1) { /* can not access major/minor to check device duplication */ - xf86IDrvMsg(pInfo, X_ERROR, "stat failed (%s). cannot check for duplicates.\n", + wcmLog(priv, W_ERROR, + "stat failed (%s). cannot check for duplicates.\n", strerror(errno)); /* older systems don't support the required ioctl. let it pass */ @@ -111,7 +112,7 @@ int wcmIsDuplicate(const char* device, WacomDevicePtr priv) else { /* major/minor can never be 0, right? */ - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "device opened with a major/minor of 0. Something was wrong.\n"); isInUse = 4; } @@ -144,7 +145,7 @@ Bool wcmIsAValidType(WacomDevicePtr priv, const char* type) if (!type) { - xf86IDrvMsg(pInfo, X_ERROR, "No type specified\n"); + wcmLog(priv, W_ERROR, "No type specified\n"); return FALSE; } @@ -163,7 +164,7 @@ Bool wcmIsAValidType(WacomDevicePtr priv, const char* type) if (i >= ARRAY_SIZE(wcmType)) { /* No type with the given name was found. */ - xf86IDrvMsg(pInfo, X_ERROR, "type '%s' is not known to the driver\n", type); + wcmLog(priv, W_ERROR, "type '%s' is not known to the driver\n", type); return FALSE; } @@ -197,7 +198,7 @@ Bool wcmIsAValidType(WacomDevicePtr priv, const char* type) * maybe the user knows better than us... */ SETBIT(common->wcmKeys, wcmType[i].tool[0]); - xf86IDrvMsg(pInfo, X_WARNING, "user-defined type '%s' may not be valid\n", type); + wcmLog(priv, W_WARNING, "user-defined type '%s' may not be valid\n", type); return TRUE; } @@ -562,14 +563,13 @@ wcmHotplugDevice(ClientPtr client, pointer closure ) */ static void wcmQueueHotplug(WacomDevicePtr priv, const char* basename, const char *type, int serial) { - InputInfoPtr pInfo = priv->pInfo; WacomHotplugInfo *hotplug_info; hotplug_info = calloc(1, sizeof(WacomHotplugInfo)); if (!hotplug_info) { - xf86IDrvMsg(pInfo, X_ERROR, "OOM, cannot hotplug dependent devices\n"); + wcmLog(priv, W_ERROR, "OOM, cannot hotplug dependent devices\n"); return; } @@ -593,7 +593,6 @@ static void wcmQueueHotplug(WacomDevicePtr priv, const char* basename, const cha */ static void wcmTryHotplugSerialType(WacomDevicePtr priv, WacomToolPtr ser, const char *basename, int idflag, const char *type) { - InputInfoPtr pInfo = priv->pInfo; if (!(ser->typeid & idflag)) { // No need to print an error message. The device doesn't // claim to support this type so there's no problem. @@ -601,7 +600,7 @@ static void wcmTryHotplugSerialType(WacomDevicePtr priv, WacomToolPtr ser, const } if (!wcmIsAValidType(priv, type)) { - xf86IDrvMsg(pInfo, X_ERROR, "invalid device type '%s'.\n", type); + wcmLog(priv, W_ERROR, "invalid device type '%s'.\n", type); return; } @@ -616,13 +615,12 @@ static void wcmTryHotplugSerialType(WacomDevicePtr priv, WacomToolPtr ser, const */ static void wcmHotplugSerials(WacomDevicePtr priv, const char *basename) { - InputInfoPtr pInfo = priv->pInfo; WacomCommonPtr common = priv->common; WacomToolPtr ser = common->serials; while (ser) { - xf86IDrvMsg(pInfo, X_INFO, "hotplugging serial %d.\n", ser->serial); + wcmLog(priv, W_INFO, "hotplugging serial %d.\n", ser->serial); wcmTryHotplugSerialType(priv, ser, basename, STYLUS_ID, "stylus"); wcmTryHotplugSerialType(priv, ser, basename, ERASER_ID, "eraser"); wcmTryHotplugSerialType(priv, ser, basename, CURSOR_ID, "cursor"); @@ -633,10 +631,9 @@ static void wcmHotplugSerials(WacomDevicePtr priv, const char *basename) void wcmHotplugOthers(WacomDevicePtr priv, const char *basename) { - InputInfoPtr pInfo = priv->pInfo; int i, skip = 1; - xf86IDrvMsg(pInfo, X_INFO, "hotplugging dependent devices.\n"); + wcmLog(priv, W_INFO, "hotplugging dependent devices.\n"); /* same loop is used to init the first device, if we get here we * need to start at the second one */ @@ -653,7 +650,7 @@ void wcmHotplugOthers(WacomDevicePtr priv, const char *basename) wcmHotplugSerials(priv, basename); - xf86IDrvMsg(pInfo, X_INFO, "hotplugging completed.\n"); + wcmLog(priv, W_INFO, "hotplugging completed.\n"); } /** @@ -694,12 +691,12 @@ int wcmNeedAutoHotplug(WacomDevicePtr priv, char **type) } if (!*type) { - xf86IDrvMsg(pInfo, X_ERROR, "No valid type found for this device.\n"); + wcmLog(priv, W_ERROR, "No valid type found for this device.\n"); goto out; } - xf86IDrvMsg(pInfo, X_INFO, "type not specified, assuming '%s'.\n", *type); - xf86IDrvMsg(pInfo, X_INFO, "other types will be automatically added.\n"); + wcmLog(priv, W_INFO, "type not specified, assuming '%s'.\n", *type); + wcmLog(priv, W_INFO, "other types will be automatically added.\n"); /* Note: wcmIsHotpluggedDevice() relies on this */ pInfo->options = xf86AddNewOption(pInfo->options, "Type", *type); @@ -741,14 +738,14 @@ int wcmParseSerials (WacomDevicePtr priv) if (nmatch < 1) { - xf86IDrvMsg(pInfo, X_ERROR, "%s is invalid serial string.\n", tok); + wcmLog(priv, W_ERROR, "%s is invalid serial string.\n", tok); free(ser); return 1; } if (nmatch >= 1) { - xf86IDrvMsg(pInfo, X_CONFIG, "Tool serial %d found.\n", serial); + wcmLog(priv, W_CONFIG, "Tool serial %d found.\n", serial); ser->serial = serial; @@ -757,19 +754,19 @@ int wcmParseSerials (WacomDevicePtr priv) if (nmatch >= 2) { - xf86IDrvMsg(pInfo, X_CONFIG, "Tool %d has type %s.\n", serial, type); + wcmLog(priv, W_CONFIG, "Tool %d has type %s.\n", serial, type); if ((strcmp(type, "pen") == 0) || (strcmp(type, "airbrush") == 0)) ser->typeid = STYLUS_ID | ERASER_ID; else if (strcmp(type, "artpen") == 0) ser->typeid = STYLUS_ID; else if (strcmp(type, "cursor") == 0) ser->typeid = CURSOR_ID; - else xf86IDrvMsg(pInfo, X_CONFIG, "Invalid type %s, defaulting to pen.\n", type); + else wcmLog(priv, W_CONFIG, "Invalid type %s, defaulting to pen.\n", type); } if (nmatch == 3) { - xf86IDrvMsg(pInfo, X_CONFIG, "Tool %d is named %s.\n", serial, name); + wcmLog(priv, W_CONFIG, "Tool %d is named %s.\n", serial, name); ser->name = strdup(name); } else ser->name = strdup(""); /*no name yet*/ @@ -823,7 +820,8 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, else { if (s) - xf86IDrvMsg(pInfo, X_ERROR, "invalid Mode (should be absolute" + wcmLog(priv, W_ERROR, + "invalid Mode (should be absolute" " or relative). Using default.\n"); /* If Mode not specified or is invalid then rely on @@ -859,12 +857,12 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, rotation = ROTATE_HALF; else if (strcasecmp(s, "NONE") !=0) { - xf86IDrvMsg(pInfo, X_ERROR, "invalid Rotate option '%s'.\n", s); + wcmLog(priv, W_ERROR, "invalid Rotate option '%s'.\n", s); goto error; } if (is_dependent && rotation != common->wcmRotate) - xf86IDrvMsg(pInfo, X_INFO, "ignoring rotation of dependent device\n"); + wcmLog(priv, W_INFO, "ignoring rotation of dependent device\n"); else wcmRotateTablet(priv, rotation); free(s); @@ -874,7 +872,7 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, common->wcmRawSample); if (common->wcmRawSample < 1 || common->wcmRawSample > MAX_SAMPLES) { - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "RawSample setting '%d' out of range [1..%d]. Using default.\n", common->wcmRawSample, MAX_SAMPLES); common->wcmRawSample = DEFAULT_SAMPLES; @@ -902,14 +900,14 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, int a,b,c,d; if ((sscanf(s,"%d,%d,%d,%d",&a,&b,&c,&d) != 4) || !wcmCheckPressureCurveValues(a, b, c, d)) - xf86IDrvMsg(pInfo, X_CONFIG, "PressCurve not valid\n"); + wcmLog(priv, W_CONFIG, "PressCurve not valid\n"); else wcmSetPressureCurve(priv,a,b,c,d); } free(s); if (xf86SetBoolOption(pInfo->options, "Pressure2K", 0)) { - xf86IDrvMsg(pInfo, X_CONFIG, "Using 2K pressure levels\n"); + wcmLog(priv, W_CONFIG, "Using 2K pressure levels\n"); priv->maxCurve = 2048; } @@ -923,7 +921,7 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, priv->wcmProxoutDist = xf86SetIntOption(pInfo->options, prop, 0); if (priv->wcmProxoutDist < 0 || priv->wcmProxoutDist > common->wcmMaxDist) - xf86IDrvMsg(pInfo, X_CONFIG, "%s invalid %d \n", + wcmLog(priv, W_CONFIG, "%s invalid %d \n", prop, priv->wcmProxoutDist); priv->wcmSurfaceDist = -1; } @@ -953,7 +951,8 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, if(toollist) /* Already have a tool with the same type/serial */ { - xf86IDrvMsg(pInfo, X_ERROR, "already have a tool with type/serial %d/%d.\n", + wcmLog(priv, W_ERROR, + "already have a tool with type/serial %d/%d.\n", tool->typeid, tool->serial); goto error; } else /* No match on existing tool/serial, add tool to the end of the list */ @@ -978,7 +977,7 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, if (is_primary || IsStylus(priv)) common->wcmTPCButton = tpc_button_is_on; else if (tpc_button_is_on != common->wcmTPCButton) - xf86IDrvMsg(pInfo, X_WARNING, "TPCButton option can only be set by stylus.\n"); + wcmLog(priv, W_WARNING, "TPCButton option can only be set by stylus.\n"); /* a single or double touch device */ if (TabletHasFeature(common, WCM_1FGT) || @@ -996,7 +995,7 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, if (is_primary || IsTouch(priv)) common->wcmTouch = touch_is_on; else if (touch_is_on != common->wcmTouch) - xf86IDrvMsg(pInfo, X_WARNING, + wcmLog(priv, W_WARNING, "Touch option can only be set by a touch tool.\n"); if (TabletHasFeature(common, WCM_1FGT)) @@ -1017,7 +1016,7 @@ Bool wcmPreInitParseOptions(WacomDevicePtr priv, Bool is_primary, if (is_primary || IsTouch(priv)) common->wcmGesture = gesture_is_on; else if (gesture_is_on != common->wcmGesture) - xf86IDrvMsg(pInfo, X_WARNING, + wcmLog(priv, W_WARNING, "Touch gesture option can only be set by a touch tool.\n"); common->wcmGestureParameters.wcmTapTime = diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c index cbee5f5..46bbf17 100644 --- a/src/wcmXCommand.c +++ b/src/wcmXCommand.c @@ -639,7 +639,7 @@ wcmSetHWTouchProperty(WacomDevicePtr priv) rc = XIGetDeviceProperty(pInfo->dev, prop_hardware_touch, &prop); if (rc != Success || prop->format != 8 || prop->size != 1) { - xf86IDrvMsg(pInfo, X_ERROR, "Failed to update hardware touch state.\n"); + wcmLog(priv, W_ERROR, "Failed to update hardware touch state.\n"); return; } @@ -1059,7 +1059,7 @@ wcmSetSerialProperty(WacomDevicePtr priv) rc = XIGetDeviceProperty(pInfo->dev, prop_serials, &prop); if (rc != Success || prop->format != 32 || prop->size != 5) { - xf86IDrvMsg(pInfo, X_ERROR, "Failed to update serial number.\n"); + wcmLog(priv, W_ERROR, "Failed to update serial number.\n"); return; } diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c index f06dfc8..43f0e4b 100644 --- a/src/xf86Wacom.c +++ b/src/xf86Wacom.c @@ -293,26 +293,26 @@ static int wcmDevInit(DeviceIntPtr pWcm) btn_labels, butmap) == FALSE) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to allocate Button class device\n"); + wcmLog(priv, W_ERROR, "unable to allocate Button class device\n"); return FALSE; } if (InitFocusClassDeviceStruct(pInfo->dev) == FALSE) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to init Focus class device\n"); + wcmLog(priv, W_ERROR, "unable to init Focus class device\n"); return FALSE; } if (InitPtrFeedbackClassDeviceStruct(pInfo->dev, wcmDevControlProc) == FALSE) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to init ptr feedback\n"); + wcmLog(priv, W_ERROR, "unable to init ptr feedback\n"); return FALSE; } if (InitProximityClassDeviceStruct(pInfo->dev) == FALSE) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to init proximity class device\n"); + wcmLog(priv, W_ERROR, "unable to init proximity class device\n"); return FALSE; } @@ -323,17 +323,17 @@ static int wcmDevInit(DeviceIntPtr pWcm) GetMotionHistorySize(), (is_absolute(priv) ? Absolute : Relative) | OutOfProximity) == FALSE) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to allocate Valuator class device\n"); + wcmLog(priv, W_ERROR, "unable to allocate Valuator class device\n"); return FALSE; } if (!InitKeyboardDeviceStruct(pInfo->dev, NULL, NULL, wcmKbdCtrlCallback)) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to init kbd device struct\n"); + wcmLog(priv, W_ERROR, "unable to init kbd device struct\n"); return FALSE; } if(InitLedFeedbackClassDeviceStruct (pInfo->dev, wcmKbdLedCallback) == FALSE) { - xf86IDrvMsg(pInfo, X_ERROR, "unable to init led feedback device struct\n"); + wcmLog(priv, W_ERROR, "unable to init led feedback device struct\n"); return FALSE; } @@ -342,7 +342,7 @@ static int wcmDevInit(DeviceIntPtr pWcm) TabletHasFeature(common, WCM_LCD) ? XIDirectTouch : XIDependentTouch, 2)) { - xf86IDrvMsg(pInfo, X_ERROR, "Unable to init touch class device struct!\n"); + wcmLog(priv, W_ERROR, "Unable to init touch class device struct!\n"); return FALSE; } priv->common->touch_mask = valuator_mask_new(2); @@ -371,7 +371,7 @@ int wcmOpen(WacomDevicePtr priv) if (pInfo->fd < 0) { int saved_errno = errno; - xf86IDrvMsg(pInfo, X_ERROR, "Error opening %s (%s)\n", + wcmLog(priv, W_ERROR, "Error opening %s (%s)\n", common->device_path, strerror(errno)); return -saved_errno; } @@ -462,7 +462,7 @@ static int wcmReady(WacomDevicePtr priv) int n = xf86WaitForInput(pInfo->fd, 0); if (n < 0) { int saved_errno = errno; - xf86IDrvMsg(pInfo, X_ERROR, "select error: %s\n", strerror(errno)); + wcmLog(priv, W_ERROR, "select error: %s\n", strerror(errno)); return -saved_errno; } else { DBG(10, priv, "%d numbers of data\n", n); @@ -492,7 +492,7 @@ static void wcmDevReadInput(InputInfoPtr pInfo) /* dispatch */ if ((rc = wcmReadPacket(priv)) < 0) { - LogMessageVerbSigSafe(X_ERROR, 0, + wcmLog(NULL, W_ERROR, "%s: Error reading wacom device : %s\n", pInfo->name, strerror(-rc)); if (rc == -ENODEV) xf86RemoveEnabledDevice(pInfo); @@ -618,7 +618,7 @@ static int wcmDevProc(DeviceIntPtr pWcm, int what) break; #endif default: - xf86IDrvMsg(pInfo, X_ERROR, + wcmLog(priv, W_ERROR, "invalid mode=%d. This is an X server bug.\n", what); goto out; } /* end switch */ |