Commit c68fed3f13ca1335af548b88da72c27362d10ebd

  • avatar
  • Peter Hutterer <peter.hutterer @wh…t.net>
  • Thu Dec 24 00:01:05 CET 2009
Add "Wacom Debug Levels" property.

This property is only present if compiled with --enable-debug and allows for
run-time modification of the debug levels. Values supported are 0 to 10,
with 10 being the most verbose.

xsetwacom --set "device name" DebugLevel 10
xsetwacom --set "device name" CommonDBG 10

Since this is a driver-internal property clients are discouraged from using
this property for any purpose. It may disappear or change without warning in
future releases of the driver.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  
7878 */
7979#define WACOM_PROP_BUTTON_ACTIONS "Wacom Button Actions"
8080
81/* 8 bit, 2 values, priv->debugLevel and common->debugLevel. This property
82 * is for use in the driver only and only enabled if --enable-debug is
83 * given. No client may rely on this property being present or working.
84 */
85#define WACOM_PROP_DEBUGLEVELS "Wacom Debug Levels"
86
8187#endif
  
160160Atom prop_hover;
161161Atom prop_tooltype;
162162Atom prop_btnactions;
163#ifdef DEBUG
164Atom prop_debuglevels;
165#endif
163166
164167/* Special case: format -32 means type is XA_ATOM */
165168static Atom InitWcmAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values)
291291 /* default to no actions */
292292 memset(values, 0, sizeof(values));
293293 prop_btnactions = InitWcmAtom(local->dev, WACOM_PROP_BUTTON_ACTIONS, -32, WCM_MAX_MOUSE_BUTTONS, values);
294
295#ifdef DEBUG
296 values[0] = priv->debugLevel;
297 values[1] = common->debugLevel;
298 prop_debuglevels = InitWcmAtom(local->dev, WACOM_PROP_DEBUGLEVELS, 8, 2, values);
299#endif
294300}
295301
296302int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
608608 /* reset screen info */
609609 xf86WcmChangeScreen(local, priv->screen_no);
610610 }
611#ifdef DEBUG
612 } else if (property == prop_debuglevels)
613 {
614 CARD8 *values;
615
616 if (prop->size != 2 || prop->format != 8)
617 return BadMatch;
618
619 values = (CARD8*)prop->data;
620 if (values[0] > 10 || values[1] > 10)
621 return BadValue;
622
623 if (!checkonly)
624 {
625 priv->debugLevel = values[0];
626 common->debugLevel = values[1];
627 }
628#endif
611629 } else if (property == prop_btnactions)
612630 {
613631 Atom *values;
  
309309 .name = "DebugLevel",
310310 .desc = "Level of debugging trace for individual devices, "
311311 "default is 0 (off). ",
312 .set_func = not_implemented,
313 .get_func = not_implemented,
312 .prop_name = WACOM_PROP_DEBUGLEVELS,
313 .prop_format = 8,
314 .prop_offset = 0,
314315 },
315316 {
316317 .name = "CommonDBG",
317318 .desc = "Level of debugging statements applied to all devices "
318319 "associated with the same tablet. default is 0 (off). ",
319 .set_func = not_implemented,
320 .get_func = not_implemented,
320 .prop_name = WACOM_PROP_DEBUGLEVELS,
321 .prop_format = 8,
322 .prop_offset = 1,
321323 },
322324 {
323325 .name = "Suppress",