Commit e243805faabc14826bcea227c6ed2d0a13a3467a

  • avatar
  • Peter Hutterer <peter.hutterer @wh…t.net>
  • Mon Dec 21 23:33:23 CET 2009
Use xf86Msg instead of ErrorF for debug messages.

ErrorF is supposed to be used in the server, drivers are better off calling
xf86Msg since this uses the appropriate prefixes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  
5757{
5858 WacomDevicePtr priv = (WacomDevicePtr) local->private;
5959
60 DBG(10, priv->debugLevel, ErrorF("xf86WcmMappingFactor \n"));
60 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmMappingFactor \n"));
6161
6262 xf86WcmVirtualTabletSize(local);
6363
8181 if (priv->currentScreen == -1) /* tool on the tablet */
8282 priv->currentScreen = 0;
8383
84 DBG(10, priv->debugLevel, ErrorF("xf86WcmMappingFactor"
84 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmMappingFactor"
8585 " Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d) map"
8686 " to maxWidth =%d maxHeight =%d\n",
8787 priv->bottomX, priv->bottomY, priv->sizeX, priv->sizeY,
8989
9090 priv->factorX = (double)priv->maxWidth / (double)priv->sizeX;
9191 priv->factorY = (double)priv->maxHeight / (double)priv->sizeY;
92 DBG(2, priv->debugLevel, ErrorF("X factor = %.3g, Y factor = %.3g\n",
92 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "X factor = %.3g, Y factor = %.3g\n",
9393 priv->factorX, priv->factorY));
9494}
9595
106106 WacomDevicePtr priv = (WacomDevicePtr) local->private;
107107 int screenToSet = -1, i, j, x, y, tabletSize = 0;
108108
109 DBG(6, priv->debugLevel, ErrorF("xf86WcmSetScreen v0=%d v1=%d "
109 DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen v0=%d v1=%d "
110110 "currentScreen=%d\n", v0, v1, priv->currentScreen));
111111
112112 if (priv->screen_no != -1 && priv->screen_no >= priv->numScreen)
152152 if (v0 > priv->topY && v0 <= priv->topY + priv->tvoffsetY)
153153 priv->currentScreen = 1;
154154 }
155 DBG(10, priv->debugLevel, ErrorF("xf86WcmSetScreen TwinView setup screenToSet=%d\n",
155 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen TwinView setup screenToSet=%d\n",
156156 priv->currentScreen));
157157 }
158158
194194
195195 if (screenToSet == -1)
196196 {
197 DBG(3, priv->debugLevel, ErrorF("xf86WcmSetScreen Error: "
198 "Can not find valid screen (currentScreen=%d)\n",
197 DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen Error: "
198 "Can not find valid screen (currentScreen=%d)\n",
199199 priv->currentScreen));
200200 return;
201201 }
210210 y = screenInfo.screens[screenToSet]->height - 1;
211211
212212 xf86XInputSetScreen(local, screenToSet, x, y);
213 DBG(10, priv->debugLevel, ErrorF("xf86WcmSetScreen current=%d ToSet=%d\n",
213 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen current=%d ToSet=%d\n",
214214 priv->currentScreen, screenToSet));
215215 priv->currentScreen = screenToSet;
216216}
227227 int button, mask;
228228 WacomDevicePtr priv = (WacomDevicePtr) local->private;
229229 WacomCommonPtr common = priv->common;
230 DBG(6, priv->debugLevel, ErrorF("xf86WcmSendButtons "
230 DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSendButtons "
231231 "buttons=%d for %s\n", buttons, local->name));
232232
233233 /* Tablet PC buttons only apply to penabled devices */
461461 if (!priv->button[button]) /* ignore this button event */
462462 return;
463463
464 DBG(4, priv->debugLevel, ErrorF(
464 DBG(4, priv->debugLevel, xf86Msg(X_INFO,
465465 "sendAButton TPCButton(%s) button=%d state=%d "
466466 "code=%08x, for %s coreEvent=%s \n",
467467 common->wcmTPCButton ? "on" : "off",
579579 unsigned *keyP = 0;
580580 int is_absolute = priv->flags & ABSOLUTE_FLAG;
581581
582 DBG(10, priv->debugLevel, ErrorF("sendWheelStripEvents for %s \n", local->name));
582 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "sendWheelStripEvents for %s \n", local->name));
583583
584584 /* emulate events for relative wheel */
585585 if ( ds->relwheel )
669669
670670 if (!fakeButton) return;
671671
672 DBG(10, priv->debugLevel, ErrorF("sendWheelStripEvents "
672 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "sendWheelStripEvents "
673673 "send fakeButton %x with value = %d \n",
674674 fakeButton, value));
675675
748748
749749 if (priv->serial && serial != priv->serial)
750750 {
751 DBG(10, priv->debugLevel, ErrorF("[%s] serial number"
751 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "[%s] serial number"
752752 " is %u but your system configured %u",
753753 local->name, serial, (int)priv->serial));
754754 return;
768768 ty = ds->stripy;
769769 }
770770
771 DBG(7, priv->debugLevel, ErrorF("[%s] o_prox=%s x=%d y=%d z=%d "
771 DBG(7, priv->debugLevel, xf86Msg(X_INFO, "[%s] o_prox=%s x=%d y=%d z=%d "
772772 "b=%s b=%d tx=%d ty=%d wl=%d rot=%d th=%d\n",
773773 (type == STYLUS_ID) ? "stylus" :
774774 (type == CURSOR_ID) ? "cursor" :
823823 }
824824 v5 = wheel;
825825
826 DBG(6, priv->debugLevel, ErrorF("[%s] %s prox=%d\tx=%d"
826 DBG(6, priv->debugLevel, xf86Msg(X_INFO, "[%s] %s prox=%d\tx=%d"
827827 "\ty=%d\tz=%d\tv3=%d\tv4=%d\tv5=%d\tid=%d"
828828 "\tserial=%u\tbutton=%s\tbuttons=%d\n",
829829 local->name,
10691069 dsNew->y = dsOrig->y;
10701070 }
10711071
1072 DBG(10, common->debugLevel, ErrorF("xf86WcmSuppress at level = %d"
1072 DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmSuppress at level = %d"
10731073 " return value = %d\n", suppress, returnV));
10741074 return returnV;
10751075}
11041104 pChannel = common->wcmChannel + channel;
11051105 pLast = &pChannel->valid.state;
11061106
1107 DBG(10, common->debugLevel, ErrorF("xf86WcmEvent at channel = %d\n", channel));
1107 DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmEvent at channel = %d\n", channel));
11081108
11091109 /* sanity check the channel */
11101110 if (channel >= MAX_CHANNELS)
11161116
11171117 /* timestamp the state for velocity and acceleration analysis */
11181118 ds.sample = (int)GetTimeInMillis();
1119 DBG(10, common->debugLevel, ErrorF("xf86WcmEvent: "
1119 DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmEvent: "
11201120 "c=%d i=%d t=%d s=%u x=%d y=%d b=%d "
11211121 "p=%d rz=%d tx=%d ty=%d aw=%d rw=%d "
11221122 "t=%d df=%d px=%d st=%d cs=%d \n",
11351135 ds.device_type != PAD_ID && (ds.device_type != TOUCH_ID) )
11361136 {
11371137 DBG(11, common->debugLevel,
1138 ErrorF("discarded %dth USB data.\n",
1138 xf86Msg(X_INFO, "discarded %dth USB data.\n",
11391139 pChannel->nSamples));
11401140 ++pChannel->nSamples;
11411141 return; /* discard */
11501150 fs = &pChannel->rawFilter;
11511151 if (!fs->npoints && ds.proximity)
11521152 {
1153 DBG(11, common->debugLevel, ErrorF("initialize Channel data.\n"));
1153 DBG(11, common->debugLevel, xf86Msg(X_INFO, "initialize Channel data.\n"));
11541154 /* store channel device state for later use */
11551155 for (i=common->wcmRawSample - 1; i>=0; i--)
11561156 {
11831183 {
11841184 if (common->wcmModel->FilterRaw(common,pChannel,&ds))
11851185 {
1186 DBG(10, common->debugLevel, ErrorF(
1186 DBG(10, common->debugLevel, xf86Msg(X_INFO,
11871187 "Raw filtering discarded data.\n"));
11881188 resetSampleCounter(pChannel);
11891189 return; /* discard */
13381338 }
13391339 }
13401340
1341 DBG(10, common->debugLevel, ErrorF("commonDispatchDevice device type = %d\n", ds->device_type));
1341 DBG(10, common->debugLevel, xf86Msg(X_INFO, "commonDispatchDevice device type = %d\n", ds->device_type));
13421342 /* Find the device the current events are meant for */
13431343 /* 1: Find the tool (the one with correct serial or in second
13441344 * hand, the one with serial set to 0 if no match with the
14011401 LocalDevicePtr oDev = outprox->device;
14021402 WacomDeviceState out = { 0 };
14031403 out.device_type = DEVICE_ID(((WacomDevicePtr)(oDev->private))->flags);
1404 DBG(2, common->debugLevel, ErrorF("Soft prox-out for %s\n",
1404 DBG(2, common->debugLevel, xf86Msg(X_INFO, "Soft prox-out for %s\n",
14051405 outprox->device->name));
14061406 xf86WcmSendEvents(oDev, &out);
14071407 }
14131413 if(tool->current)
14141414 {
14151415 pDev = tool->current->device;
1416 DBG(11, common->debugLevel, ErrorF("tool id=%d for %s\n",
1416 DBG(11, common->debugLevel, xf86Msg(X_INFO, "tool id=%d for %s\n",
14171417 ds->device_type, pDev->name));
14181418 }
14191419 }
14711471 /* Send soft prox-out for touch first */
14721472 WacomDeviceState out = { 0 };
14731473 out.device_type = DEVICE_ID(temppriv->flags);
1474 DBG(2, common->debugLevel, ErrorF(
1474 DBG(2, common->debugLevel, xf86Msg(X_INFO,
14751475 "Send soft prox-out for %s first\n",
14761476 localDevices->name));
14771477 xf86WcmSendEvents(localDevices, &out);
15441544 }
15451545 else /* no other events to send */
15461546 {
1547 DBG(10, common->debugLevel, ErrorF(
1547 DBG(10, common->debugLevel, xf86Msg(X_INFO,
15481548 "Ignore non-movement relative data \n"));
15491549 return;
15501550 }
15741574 if (common->wcmMaxCursorDist < filtered.distance)
15751575 common->wcmMaxCursorDist = filtered.distance;
15761576 }
1577 DBG(10, common->debugLevel, ErrorF("Distance over"
1577 DBG(10, common->debugLevel, xf86Msg(X_INFO, "Distance over"
15781578 " the tablet: %d, ProxoutDist: %d current"
15791579 " min/max %d hard prox: %d\n",
15801580 filtered.distance,
16081608 /* otherwise, if no device matched... */
16091609 else
16101610 {
1611 DBG(11, common->debugLevel, ErrorF("no device matches with"
1611 DBG(11, common->debugLevel, xf86Msg(X_INFO, "no device matches with"
16121612 " id=%d, serial=%u\n",
16131613 ds->device_type, ds->serial_num));
16141614 }
18061806 priv->screenBottomY[1] = priv->tvResolution[1];
18071807 }
18081808
1809 DBG(10, priv->debugLevel, ErrorF("xf86WcmInitialTVScreens for \"%s\" "
1809 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialTVScreens for \"%s\" "
18101810 "topX0=%d topY0=%d bottomX0=%d bottomY0=%d "
18111811 "topX1=%d topY1=%d bottomX1=%d bottomY1=%d \n",
18121812 local->name, priv->screenTopX[0], priv->screenTopY[0],
18241824 WacomDevicePtr priv = (WacomDevicePtr)local->private;
18251825 int i;
18261826
1827 DBG(2, priv->debugLevel, ErrorF("xf86WcmInitialScreens for \"%s\" "
1827 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialScreens for \"%s\" "
18281828 "number of screen=%d \n", local->name, screenInfo.numScreens));
18291829 priv->tvoffsetX = 0;
18301830 priv->tvoffsetY = 0;
18491849 priv->screenBottomX[i] = dixScreenOrigins[i].x;
18501850 priv->screenBottomY[i] = dixScreenOrigins[i].y;
18511851
1852 DBG(10, priv->debugLevel, ErrorF("xf86WcmInitialScreens from dix for \"%s\" "
1852 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialScreens from dix for \"%s\" "
18531853 "ScreenOrigins[%d].x=%d ScreenOrigins[%d].y=%d \n",
18541854 local->name, i, priv->screenTopX[i], i, priv->screenTopY[i]));
18551855 }
18571857 priv->screenBottomX[i] += screenInfo.screens[i]->width;
18581858 priv->screenBottomY[i] += screenInfo.screens[i]->height;
18591859
1860 DBG(10, priv->debugLevel, ErrorF("xf86WcmInitialScreens for \"%s\" "
1860 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialScreens for \"%s\" "
18611861 "topX[%d]=%d topY[%d]=%d bottomX[%d]=%d bottomY[%d]=%d \n",
18621862 local->name, i, priv->screenTopX[i], i, priv->screenTopY[i],
18631863 i, priv->screenBottomX[i], i, priv->screenBottomY[i]));
18741874 WacomToolAreaPtr area = priv->toolarea;
18751875 int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
18761876
1877 DBG(10, priv->debugLevel, ErrorF("rotateOneTool for \"%s\" \n", priv->local->name));
1877 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "rotateOneTool for \"%s\" \n", priv->local->name));
18781878
18791879 if (!IsTouch(priv))
18801880 {
19511951 int oldRotation;
19521952 int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
19531953
1954 DBG(10, priv->debugLevel, ErrorF("xf86WcmRotateTablet for \"%s\" \n", local->name));
1954 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmRotateTablet for \"%s\" \n", local->name));
19551955
19561956 if (common->wcmRotate == value) /* initialization */
19571957 {
  
229229 WacomDevicePtr dev;
230230 WacomDevicePtr *prev;
231231
232 DBG(1, priv->debugLevel, ErrorF("xf86WcmUninit\n"));
232 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmUninit\n"));
233233
234234 if (priv->isParent)
235235 {
289289 strstr(pMatch->drv->driverName, "wacom") &&
290290 !strcmp(privMatch->common->wcmDevice, common->wcmDevice))
291291 {
292 DBG(2, priv->debugLevel, ErrorF(
292 DBG(2, priv->debugLevel, xf86Msg(X_INFO,
293293 "xf86WcmInit wacom port share between"
294294 " %s and %s\n", pLocal->name, pMatch->name));
295295 type = xf86FindOptionValue(pMatch->options, "Type");
  
248248 WacomDeviceState *pLast;
249249 int *x, *y, i;
250250
251 DBG(10, common->debugLevel, ErrorF("xf86WcmFilterCoord with "
251 DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmFilterCoord with "
252252 "common->wcmRawSample = %d \n", common->wcmRawSample));
253253 x = pChannel->rawFilter.x;
254254 y = pChannel->rawFilter.y;
  
123123 WacomDevicePtr priv = (WacomDevicePtr)local->private;
124124 WacomCommonPtr common = priv->common;
125125
126 DBG(1, priv->debugLevel, ErrorF("initializing ISDV4 tablet\n"));
126 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "initializing ISDV4 tablet\n"));
127127
128128 /* Initial baudrate is 38400 */
129129 if (xf86SetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0)
150150 WacomDevicePtr priv = (WacomDevicePtr)local->private;
151151 WacomCommonPtr common = priv->common;
152152
153 DBG(1, priv->debugLevel, ErrorF("Querying ISDV4 tablet\n"));
153 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "Querying ISDV4 tablet\n"));
154154
155155 /* Send stop command to the tablet */
156156 err = xf86WriteSerial(local->fd, WC_ISDV4_STOP, strlen(WC_ISDV4_STOP));
256256 WacomCommonPtr common = priv->common;
257257 int ret = Success;
258258
259 DBG(2, priv->debugLevel, ErrorF("getting ISDV4 Ranges\n"));
259 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "getting ISDV4 Ranges\n"));
260260
261261 /* Send query command to the tablet */
262262 ret = isdv4Query(local, WC_ISDV4_QUERY, data);
281281 if (!common->wcmMaxX || !common->wcmMaxY)
282282 common->tablet_id = 0xE2;
283283
284 DBG(2, priv->debugLevel, ErrorF("isdv4GetRanges Pen speed=%d "
284 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "isdv4GetRanges Pen speed=%d "
285285 "maxX=%d maxY=%d maxZ=%d resX=%d resY=%d \n",
286286 common->wcmISDV4Speed, common->wcmMaxX, common->wcmMaxY,
287287 common->wcmMaxZ, common->wcmResolX, common->wcmResolY));
367367 common->wcmVersion = ( data[10] | (data[9] << 7) );
368368 ret = Success;
369369
370 DBG(2, priv->debugLevel, ErrorF("isdv4GetRanges touch speed=%d "
370 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "isdv4GetRanges touch speed=%d "
371371 "maxTouchX=%d maxTouchY=%d TouchresX=%d TouchresY=%d \n",
372372 common->wcmISDV4Speed, common->wcmMaxTouchX,
373373 common->wcmMaxTouchY, common->wcmTouchResolX,
401401 WacomDeviceState* ds;
402402 int n, cur_type, channel = 0;
403403
404 DBG(10, common->debugLevel, ErrorF("isdv4Parse \n"));
404 DBG(10, common->debugLevel, xf86Msg(X_INFO, "isdv4Parse \n"));
405405
406406 /* determine the type of message (touch or stylus) */
407407 if (data[0] & 0x10) /* a touch data */
484484 }
485485 }
486486
487 DBG(8, priv->debugLevel, ErrorF("isdv4Parse MultiTouch "
487 DBG(8, priv->debugLevel, xf86Msg(X_INFO, "isdv4Parse MultiTouch "
488488 "%s proximity \n", ds->proximity ? "in" : "out of"));
489489 }
490490 else
536536 ds->device_id = ERASER_DEVICE_ID;
537537 }
538538
539 DBG(8, priv->debugLevel, ErrorF("isdv4Parse %s\n",
539 DBG(8, priv->debugLevel, xf86Msg(X_INFO, "isdv4Parse %s\n",
540540 ds->device_type == ERASER_ID ? "ERASER " :
541541 ds->device_type == STYLUS_ID ? "STYLUS" : "NONE"));
542542 }
  
127127 secondChannel->valid.states[1] };
128128 int direction = 0;
129129
130 DBG(10, priv->debugLevel, ErrorF("xf86WcmFingerTapToClick \n"));
130 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerTapToClick \n"));
131131
132132 /* skip initial second finger event */
133133 if (!dsLast[1].proximity)
298298 int gesture = 0;
299299 WacomFilterState filterd; /* borrow this struct */
300300
301 DBG(10, priv->debugLevel, ErrorF("xf86WcmFingerScroll \n"));
301 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerScroll \n"));
302302
303303 /* initialize the points so we can rotate them */
304304 filterd.x[0] = ds[0].x;
372372 int dist = touchDistance(common->wcmGestureState[0],
373373 common->wcmGestureState[1]);
374374
375 DBG(10, priv->debugLevel, ErrorF("xf86WcmFingerZoom \n"));
375 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerZoom \n"));
376376
377377 dist = touchDistance(ds[0], ds[1]) - dist;
378378
src/wcmUSB.c
(17 / 17)
  
372372#ifdef DEBUG
373373 WacomDevicePtr priv = (WacomDevicePtr)local->private;
374374
375 DBG(1, priv->debugLevel, ErrorF("usbDetect\n"));
375 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "usbDetect\n"));
376376#endif
377377
378378 SYSCALL(err = ioctl(local->fd, EVIOCGVERSION, &version));
508508 WacomDevicePtr priv = (WacomDevicePtr)local->private;
509509 WacomCommonPtr common = priv->common;
510510
511 DBG(1, priv->debugLevel, ErrorF("initializing USB tablet\n"));
511 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "initializing USB tablet\n"));
512512 *version = 0.0;
513513
514514 /* fetch vendor, product, and model name */
722722 WacomDevicePtr priv = (WacomDevicePtr)local->private;
723723 WacomCommonPtr common = priv->common;
724724
725 DBG(10, common->debugLevel, ErrorF("usbDetectConfig \n"));
725 DBG(10, common->debugLevel, xf86Msg(X_INFO, "usbDetectConfig \n"));
726726 if (IsPad (priv))
727727 priv->nbuttons = common->npadkeys;
728728 else
813813 xf86WcmEvent(common, i, &common->wcmChannel[i].work);
814814 }
815815 }
816 DBG(1, common->debugLevel, ErrorF("usbParse (device with serial number: %u)"
816 DBG(1, common->debugLevel, xf86Msg(X_INFO, "usbParse (device with serial number: %u)"
817817 " at %d: Exceeded channel count; ignoring the events.\n",
818818 serial, (int)GetTimeInMillis()));
819819 }
830830 WacomDevicePtr priv = (WacomDevicePtr)local->private;
831831 WacomCommonPtr common = priv->common;
832832
833 DBG(10, common->debugLevel, ErrorF("usbParseEvent \n"));
833 DBG(10, common->debugLevel, xf86Msg(X_INFO, "usbParseEvent \n"));
834834 /* store events until we receive the MSC_SERIAL containing
835835 * the serial number; without it we cannot determine the
836836 * correct channel. */
890890 /* ignore events without information */
891891 if (common->wcmEventCnt <= 2)
892892 {
893 DBG(3, common->debugLevel, ErrorF("%s - usbParse: dropping empty event"
893 DBG(3, common->debugLevel, xf86Msg(X_INFO, "%s - usbParse: dropping empty event"
894894 " for serial %d\n", local->name, common->wcmLastToolSerial));
895895 goto skipEvent;
896896 }
923923 WacomDevicePtr priv = (WacomDevicePtr)local->private;
924924 WacomCommonPtr common = priv->common;
925925
926 DBG(6, common->debugLevel, ErrorF("usbParseChannel %d events received\n", common->wcmEventCnt));
926 DBG(6, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel %d events received\n", common->wcmEventCnt));
927927 #define MOD_BUTTONS(bit, value) do { \
928928 shift = 1<<bit; \
929929 ds->buttons = (((value) != 0) ? \
931931 } while (0)
932932
933933 if (common->wcmEventCnt == 1 && !common->wcmEvents->type) {
934 DBG(6, common->debugLevel, ErrorF("usbParseChannel no real events received\n"));
934 DBG(6, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel no real events received\n"));
935935 return;
936936 }
937 DBG(6, common->debugLevel, ErrorF("usbParseChannel %d events received\n", common->wcmEventCnt));
937 DBG(6, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel %d events received\n", common->wcmEventCnt));
938938
939939 /* all USB data operates from previous context except relative values*/
940940 ds = &common->wcmChannel[channel].work;
945945 for (i=0; i<common->wcmEventCnt; ++i)
946946 {
947947 event = common->wcmEvents + i;
948 DBG(11, common->debugLevel, ErrorF("usbParseChannel "
948 DBG(11, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel "
949949 "event[%d]->type=%d code=%d value=%d\n",
950950 i, event->type, event->code, event->value));
951951
10021002 if (common->wcmProtocolLevel == 4)
10031003 ds->device_id = STYLUS_DEVICE_ID;
10041004 ds->proximity = (event->value != 0);
1005 DBG(6, common->debugLevel, ErrorF(
1005 DBG(6, common->debugLevel, xf86Msg(X_INFO,
10061006 "USB stylus detected %x\n",
10071007 event->code));
10081008 }
10151015 ds->proximity = (event->value != 0);
10161016 if (ds->proximity)
10171017 ds->proximity = ERASER_PROX;
1018 DBG(6, common->debugLevel, ErrorF(
1018 DBG(6, common->debugLevel, xf86Msg(X_INFO,
10191019 "USB eraser detected %x (value=%d)\n",
10201020 event->code, event->value));
10211021 }
10221022 else if ((event->code == BTN_TOOL_MOUSE) ||
10231023 (event->code == BTN_TOOL_LENS))
10241024 {
1025 DBG(6, common->debugLevel, ErrorF(
1025 DBG(6, common->debugLevel, xf86Msg(X_INFO,
10261026 "USB mouse detected %x (value=%d)\n",
10271027 event->code, event->value));
10281028 ds->device_type = CURSOR_ID;
10331033 }
10341034 else if (event->code == BTN_TOOL_FINGER)
10351035 {
1036 DBG(6, common->debugLevel, ErrorF(
1036 DBG(6, common->debugLevel, xf86Msg(X_INFO,
10371037 "USB Pad detected %x (value=%d)\n",
10381038 event->code, event->value));
10391039 ds->device_type = PAD_ID;
10441044 {
10451045 WacomChannelPtr pChannel = common->wcmChannel + channel;
10461046 WacomDeviceState dslast = pChannel->valid.state;
1047 DBG(6, common->debugLevel, ErrorF(
1047 DBG(6, common->debugLevel, xf86Msg(X_INFO,
10481048 "USB Touch detected %x (value=%d)\n",
10491049 event->code, event->value));
10501050 ds->device_type = TOUCH_ID;
10661066 {
10671067 WacomChannelPtr pChannel = common->wcmChannel + channel;
10681068 WacomDeviceState dslast = pChannel->valid.state;
1069 DBG(6, common->debugLevel, ErrorF(
1069 DBG(6, common->debugLevel, xf86Msg(X_INFO,
10701070 "USB Touch second finger detected %x (value=%d)\n",
10711071 event->code, event->value));
10721072 ds->device_type = TOUCH_ID;
11151115 if (((common->tablet_id == 0xC0) || (common->tablet_id == 0xC2)) &&
11161116 (ds->device_type == ERASER_ID))
11171117 {
1118 DBG(10, common->debugLevel, ErrorF("usbParseChannel "
1118 DBG(10, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel "
11191119 "DTF 720 doesn't support eraser "));
11201120 return;
11211121 }
  
5050 /* Pad is always in relative mode when it's a core device.
5151 * Always in absolute mode when it is not a core device.
5252 */
53 DBG(10, priv->debugLevel, ErrorF("xf86WcmSetPadCoreMode (%p)"
53 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetPadCoreMode (%p)"
5454 " is always in %s mode when it %s core device\n",
5555 (void *)local->dev,
5656 !is_core ? "absolute" : "relative",
7171 WacomDevicePtr priv = (WacomDevicePtr)local->private;
7272 int is_absolute = priv->flags & ABSOLUTE_FLAG;
7373
74 DBG(3, priv->debugLevel, ErrorF("xf86WcmSwitchModeCall for %s to mode=%d\n",
74 DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSwitchModeCall for %s to mode=%d\n",
7575 local->name, mode));
7676
7777 /* Pad is always in relative mode when it's a core device.
9696 }
9797 else if ( (mode != Absolute) && (mode != Relative))
9898 {
99 DBG(10, priv->debugLevel, ErrorF("xf86WcmSwitchModeCall"
99 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSwitchModeCall"
100100 " for %s invalid mode=%d\n", local->name, mode));
101101 return BadMatch;
102102 }
114114#ifdef DEBUG
115115 WacomDevicePtr priv = (WacomDevicePtr)local->private;
116116
117 DBG(3, priv->debugLevel, ErrorF("xf86WcmSwitchMode dev=%p mode=%d\n",
117 DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSwitchMode dev=%p mode=%d\n",
118118 (void *)dev, mode));
119119#endif
120120 /* Share this call with sendAButton in wcmCommon.c */
211211 WacomCommonPtr common = priv->common;
212212 int values[WCM_MAX_MOUSE_BUTTONS];
213213
214 DBG(10, priv->debugLevel, ErrorF("InitWcmDeviceProperties for %s \n", local->name));
214 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "InitWcmDeviceProperties for %s \n", local->name));
215215
216216 values[0] = priv->topX;
217217 values[1] = priv->topY;
299299 WacomDevicePtr priv = (WacomDevicePtr) local->private;
300300 WacomCommonPtr common = priv->common;
301301
302 DBG(10, priv->debugLevel, ErrorF("xf86WcmSetProperty for %s \n", local->name));
302 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetProperty for %s \n", local->name));
303303
304304 if (property == prop_tablet_area)
305305 {
488488 {
489489 screen = -1;
490490 priv->currentScreen = 0;
491 DBG(10, priv->debugLevel, ErrorF("xf86WcmSetProperty TwinView sets to "
491 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetProperty TwinView sets to "
492492 "TV_NONE: can't change screen_no. \n"));
493493 }
494494 xf86WcmChangeScreen(local, screen);
  
148148 double screenRatio, tabletRatio;
149149 int bottomx = common->wcmMaxX, bottomy = common->wcmMaxY;
150150
151 DBG(10, priv->debugLevel, ErrorF("xf86WcmInitArea\n"));
151 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitArea\n"));
152152
153153 if (IsTouch(priv))
154154 {
208208 tabletRatio = ((double)(bottomx - priv->topX) /
209209 (double)(bottomy - priv->topY));
210210
211 DBG(2, priv->debugLevel, ErrorF("screenRatio = %.3g, "
211 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "screenRatio = %.3g, "
212212 "tabletRatio = %.3g\n", screenRatio, tabletRatio));
213213
214214 if (screenRatio > tabletRatio)
296296 priv->topPadding = (int)((double)(priv->screenTopY[i] * priv->topPadding)
297297 / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5);
298298 }
299 DBG(10, priv->debugLevel, ErrorF("xf86WcmVirtualTabletPadding for \"%s\" "
299 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmVirtualTabletPadding for \"%s\" "
300300 "x=%d y=%d \n", local->name, priv->leftPadding, priv->topPadding));
301301 return;
302302}
336336 priv->sizeY += (int)((double)((priv->maxHeight - priv->screenBottomY[i])
337337 * tabletSize) / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5);
338338 }
339 DBG(10, priv->debugLevel, ErrorF("xf86WcmVirtualTabletSize for \"%s\" "
339 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmVirtualTabletSize for \"%s\" "
340340 "x=%d y=%d \n", local->name, priv->sizeX, priv->sizeY));
341341 return;
342342}
656656 * This is only a workaround.
657657 */
658658
659 DBG(10, priv->debugLevel, ErrorF("xf86WcmRegisterX11Devices "
659 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmRegisterX11Devices "
660660 "(%s) %d buttons, %d keys, %d axes\n",
661661 IsStylus(priv) ? "stylus" :
662662 IsCursor(priv) ? "cursor" :
976976 int rc;
977977 struct serial_struct ser;
978978
979 DBG(1, priv->debugLevel, ErrorF("opening %s\n", common->wcmDevice));
979 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "opening %s\n", common->wcmDevice));
980980
981981 local->fd = xf86OpenSerial(local->options);
982982 if (local->fd < 0)
10351035 WacomCommonPtr common = priv->common;
10361036 struct stat st;
10371037
1038 DBG(10, priv->debugLevel, ErrorF("xf86WcmDevOpen\n"));
1038 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevOpen\n"));
10391039
10401040 /* Device has been open and not autoprobed */
10411041 if (priv->wcmDevOpenCount)
10521052 if ((xf86WcmOpen (local) != Success) || (local->fd < 0) ||
10531053 !common->wcmDevice)
10541054 {
1055 DBG(1, priv->debugLevel, ErrorF("Failed to open "
1055 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "Failed to open "
10561056 "device (fd=%d)\n", local->fd));
10571057 if (local->fd >= 0)
10581058 {
1059 DBG(1, priv->debugLevel, ErrorF("Closing device\n"));
1059 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "Closing device\n"));
10601060 xf86CloseSerial(local->fd);
10611061 }
10621062 local->fd = -1;
10981098 WacomDevicePtr priv = (WacomDevicePtr)local->private;
10991099#endif
11001100 int n = xf86WaitForInput(local->fd, 0);
1101 DBG(10, priv->debugLevel, ErrorF("xf86WcmReady for %s with %d numbers of data\n", local->name, n));
1101 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmReady for %s with %d numbers of data\n", local->name, n));
11021102
11031103 if (n >= 0) return n ? 1 : 0;
11041104 xf86Msg(X_ERROR, "%s: select error: %s\n", local->name, strerror(errno));
11301130
11311131 /* report how well we're doing */
11321132 if (loop >= MAX_READ_LOOPS)
1133 DBG(1, priv->debugLevel, ErrorF("xf86WcmDevReadInput: Can't keep up!!!\n"));
1133 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevReadInput: Can't keep up!!!\n"));
11341134 else if (loop > 0)
1135 DBG(10, priv->debugLevel, ErrorF("xf86WcmDevReadInput: Read (%d)\n",loop));
1135 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevReadInput: Read (%d)\n",loop));
11361136}
11371137
11381138void xf86WcmReadPacket(LocalDevicePtr local)
11421142 int len, pos, cnt, remaining;
11431143 unsigned char * data;
11441144
1145 DBG(10, common->debugLevel, ErrorF("xf86WcmReadPacket: device=%s"
1145 DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmReadPacket: device=%s"
11461146 " fd=%d \n", common->wcmDevice, local->fd));
11471147
11481148 remaining = sizeof(common->buffer) - common->bufpos;
11491149
1150 DBG(1, common->debugLevel, ErrorF("xf86WcmReadPacket: pos=%d"
1150 DBG(1, common->debugLevel, xf86Msg(X_INFO, "xf86WcmReadPacket: pos=%d"
11511151 " remaining=%d\n", common->bufpos, remaining));
11521152
11531153 /* fill buffer with as much data as we can handle */
11711171
11721172 /* account for new data */
11731173 common->bufpos += len;
1174 DBG(10, common->debugLevel, ErrorF("xf86WcmReadPacket buffer has %d bytes\n",
1174 DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmReadPacket buffer has %d bytes\n",
11751175 common->bufpos));
11761176
11771177 pos = 0;
12031203 cnt = common->wcmModel->Parse(local, common->buffer + pos);
12041204 if (cnt <= 0)
12051205 {
1206 DBG(1, common->debugLevel, ErrorF("Misbehaving parser returned %d\n",cnt));
1206 DBG(1, common->debugLevel, xf86Msg(X_INFO, "Misbehaving parser returned %d\n",cnt));
12071207 break;
12081208 }
12091209 pos += cnt;
12141214 /* if half a packet remains, move it down */
12151215 if (pos < common->bufpos)
12161216 {
1217 DBG(7, common->debugLevel, ErrorF("MOVE %d bytes\n", common->bufpos - pos));
1217 DBG(7, common->debugLevel, xf86Msg(X_INFO, "MOVE %d bytes\n", common->bufpos - pos));
12181218 memmove(common->buffer,common->buffer+pos,
12191219 common->bufpos-pos);
12201220 common->bufpos -= pos;
12321232{
12331233#ifdef DEBUG
12341234 WacomDevicePtr priv = (WacomDevicePtr)local->private;
1235 DBG(3, priv->debugLevel, ErrorF("xf86WcmDevChangeControl called\n"));
1235 DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevChangeControl called\n"));
12361236#endif
12371237 return Success;
12381238}
12471247 LocalDevicePtr local = (LocalDevicePtr)device->public.devicePrivate;
12481248 WacomDevicePtr priv = (WacomDevicePtr)local->private;
12491249
1250 DBG(4, priv->debugLevel, ErrorF("Wacom Dev Control Proc called\n"));
1250 DBG(4, priv->debugLevel, xf86Msg(X_INFO, "Wacom Dev Control Proc called\n"));
12511251#endif
12521252 return;
12531253}
12611261 WacomDevicePtr priv = (WacomDevicePtr)local->private;
12621262 WacomCommonPtr common = priv->common;
12631263
1264 DBG(4, priv->debugLevel, ErrorF("Wacom number of open devices = %d\n", common->fd_refs));
1264 DBG(4, priv->debugLevel, xf86Msg(X_INFO, "Wacom number of open devices = %d\n", common->fd_refs));
12651265
12661266 if (local->fd >= 0)
12671267 {
12681268 local->fd = -1;
12691269 if (!--common->fd_refs)
12701270 {
1271 DBG(1, common->debugLevel, ErrorF("Closing device; uninitializing.\n"));
1271 DBG(1, common->debugLevel, xf86Msg(X_INFO, "Closing device; uninitializing.\n"));
12721272 xf86CloseSerial (common->fd);
12731273 }
12741274 }
12841284 LocalDevicePtr local = (LocalDevicePtr)pWcm->public.devicePrivate;
12851285 WacomDevicePtr priv = (WacomDevicePtr)local->private;
12861286
1287 DBG(2, priv->debugLevel, ErrorF("BEGIN xf86WcmProc dev=%p priv=%p "
1287 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "BEGIN xf86WcmProc dev=%p priv=%p "
12881288 "type=%s(%s) flags=%d fd=%d what=%s\n",
12891289 (void *)pWcm, (void *)priv,
12901290 IsStylus(priv) ? "stylus" :
13061306 priv->wcmInitKeyClassCount = 0;
13071307 if (!xf86WcmDevOpen(pWcm))
13081308 {
1309 DBG(1, priv->debugLevel, ErrorF("xf86WcmProc INIT FAILED\n"));
1309 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmProc INIT FAILED\n"));
13101310 return !Success;
13111311 }
13121312 priv->wcmInitKeyClassCount++;
13161316 case DEVICE_ON:
13171317 if (!xf86WcmDevOpen(pWcm))
13181318 {
1319 DBG(1, priv->debugLevel, ErrorF("xf86WcmProc ON FAILED\n"));
1319 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmProc ON FAILED\n"));
13201320 return !Success;
13211321 }
13221322 priv->wcmDevOpenCount++;
13411341 break;
13421342 } /* end switch */
13431343
1344 DBG(2, priv->debugLevel, ErrorF("END xf86WcmProc Success \n"));
1344 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "END xf86WcmProc Success \n"));
13451345 return Success;
13461346}
13471347
13561356{
13571357 WacomDevicePtr priv = (WacomDevicePtr) local->private;
13581358
1359 DBG(6, priv->debugLevel, ErrorF("xf86WcmDevConvert v0=%d v1=%d on screen %d \n",
1359 DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevConvert v0=%d v1=%d on screen %d \n",
13601360 v0, v1, priv->currentScreen));
13611361
13621362 if (first != 0 || num == 1)
13921392 if (*y < 0) *y = 0;
13931393
13941394 }
1395 DBG(6, priv->debugLevel, ErrorF("xf86WcmDevConvert v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y));
1395 DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevConvert v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y));
13961396 return TRUE;
13971397}
13981398
14091409 WacomDevicePtr priv = (WacomDevicePtr) local->private;
14101410 int i = 0;
14111411
1412 DBG(6, priv->debugLevel, ErrorF("xf86WcmDevReverseConvert x=%d y=%d \n", x, y));
1412 DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevReverseConvert x=%d y=%d \n", x, y));
14131413 priv->currentSX = x;
14141414 priv->currentSY = y;
14151415
14301430 priv->devReverseCount = 0;
14311431 }
14321432
1433 DBG(6, priv->debugLevel, ErrorF("Wacom converted x=%d y=%d"
1433 DBG(6, priv->debugLevel, xf86Msg(X_INFO, "Wacom converted x=%d y=%d"
14341434 " to v0=%d v1=%d v2=%d v3=%d v4=%d v5=%d\n", x, y,
14351435 valuators[0], valuators[1], valuators[2],
14361436 valuators[3], valuators[4], valuators[5]));