Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 Red Hat |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | * copy of this software and associated documentation files (the "Software"), |
| 6 | * to deal in the Software without restriction, including without limitation |
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | * Software is furnished to do so, subject to the following conditions: |
| 10 | * |
| 11 | * The above copyright notice and this permission notice shall be included in |
| 12 | * all copies or substantial portions of the Software. |
| 13 | * |
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 | * OTHER DEALINGS IN THE SOFTWARE. |
| 21 | * |
| 22 | * Authors: |
| 23 | * Rob Clark <robdclark@gmail.com> |
| 24 | */ |
| 25 | |
| 26 | #ifndef DRM_PRINT_H_ |
| 27 | #define DRM_PRINT_H_ |
| 28 | |
Joe Perches | 3c6d6e0 | 2017-02-15 15:33:18 -0800 | [diff] [blame] | 29 | #include <linux/compiler.h> |
| 30 | #include <linux/printk.h> |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 31 | #include <linux/seq_file.h> |
| 32 | #include <linux/device.h> |
| 33 | |
| 34 | /** |
| 35 | * DOC: print |
| 36 | * |
| 37 | * A simple wrapper for dev_printk(), seq_printf(), etc. Allows same |
| 38 | * debug code to be used for both debugfs and printk logging. |
| 39 | * |
| 40 | * For example:: |
| 41 | * |
| 42 | * void log_some_info(struct drm_printer *p) |
| 43 | * { |
| 44 | * drm_printf(p, "foo=%d\n", foo); |
| 45 | * drm_printf(p, "bar=%d\n", bar); |
| 46 | * } |
| 47 | * |
| 48 | * #ifdef CONFIG_DEBUG_FS |
| 49 | * void debugfs_show(struct seq_file *f) |
| 50 | * { |
| 51 | * struct drm_printer p = drm_seq_file_printer(f); |
| 52 | * log_some_info(&p); |
| 53 | * } |
| 54 | * #endif |
| 55 | * |
| 56 | * void some_other_function(...) |
| 57 | * { |
| 58 | * struct drm_printer p = drm_info_printer(drm->dev); |
| 59 | * log_some_info(&p); |
| 60 | * } |
| 61 | */ |
| 62 | |
| 63 | /** |
| 64 | * struct drm_printer - drm output "stream" |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 65 | * |
| 66 | * Do not use struct members directly. Use drm_printer_seq_file(), |
| 67 | * drm_printer_info(), etc to initialize. And drm_printf() for output. |
| 68 | */ |
| 69 | struct drm_printer { |
Daniel Vetter | 3d387d9 | 2016-12-28 17:42:09 +0100 | [diff] [blame] | 70 | /* private: */ |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 71 | void (*printfn)(struct drm_printer *p, struct va_format *vaf); |
| 72 | void *arg; |
Daniel Vetter | 3d387d9 | 2016-12-28 17:42:09 +0100 | [diff] [blame] | 73 | const char *prefix; |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf); |
| 77 | void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf); |
Daniel Vetter | 3d387d9 | 2016-12-28 17:42:09 +0100 | [diff] [blame] | 78 | void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf); |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 79 | |
Joe Perches | 3c6d6e0 | 2017-02-15 15:33:18 -0800 | [diff] [blame] | 80 | __printf(2, 3) |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 81 | void drm_printf(struct drm_printer *p, const char *f, ...); |
| 82 | |
Daniel Vetter | 42f1b31 | 2017-12-14 21:30:51 +0100 | [diff] [blame] | 83 | __printf(2, 0) |
Noralf Trønnes | bf6234a | 2017-11-07 20:13:39 +0100 | [diff] [blame] | 84 | /** |
Chris Wilson | e2b155e | 2017-11-23 08:40:46 +0000 | [diff] [blame] | 85 | * drm_vprintf - print to a &drm_printer stream |
| 86 | * @p: the &drm_printer |
| 87 | * @fmt: format string |
| 88 | * @va: the va_list |
| 89 | */ |
Chris Wilson | e2b155e | 2017-11-23 08:40:46 +0000 | [diff] [blame] | 90 | static inline void |
| 91 | drm_vprintf(struct drm_printer *p, const char *fmt, va_list *va) |
| 92 | { |
| 93 | struct va_format vaf = { .fmt = fmt, .va = va }; |
| 94 | |
| 95 | p->printfn(p, &vaf); |
| 96 | } |
| 97 | |
| 98 | /** |
Noralf Trønnes | bf6234a | 2017-11-07 20:13:39 +0100 | [diff] [blame] | 99 | * drm_printf_indent - Print to a &drm_printer stream with indentation |
| 100 | * @printer: DRM printer |
| 101 | * @indent: Tab indentation level (max 5) |
| 102 | * @fmt: Format string |
| 103 | */ |
| 104 | #define drm_printf_indent(printer, indent, fmt, ...) \ |
| 105 | drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t\t\tX", ##__VA_ARGS__) |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 106 | |
| 107 | /** |
| 108 | * drm_seq_file_printer - construct a &drm_printer that outputs to &seq_file |
Daniel Vetter | ea0dd85 | 2016-12-29 21:48:26 +0100 | [diff] [blame] | 109 | * @f: the &struct seq_file to output to |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 110 | * |
| 111 | * RETURNS: |
| 112 | * The &drm_printer object |
| 113 | */ |
| 114 | static inline struct drm_printer drm_seq_file_printer(struct seq_file *f) |
| 115 | { |
| 116 | struct drm_printer p = { |
| 117 | .printfn = __drm_printfn_seq_file, |
| 118 | .arg = f, |
| 119 | }; |
| 120 | return p; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * drm_info_printer - construct a &drm_printer that outputs to dev_printk() |
Daniel Vetter | ea0dd85 | 2016-12-29 21:48:26 +0100 | [diff] [blame] | 125 | * @dev: the &struct device pointer |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 126 | * |
| 127 | * RETURNS: |
| 128 | * The &drm_printer object |
| 129 | */ |
| 130 | static inline struct drm_printer drm_info_printer(struct device *dev) |
| 131 | { |
| 132 | struct drm_printer p = { |
| 133 | .printfn = __drm_printfn_info, |
| 134 | .arg = dev, |
| 135 | }; |
| 136 | return p; |
| 137 | } |
| 138 | |
Daniel Vetter | 3d387d9 | 2016-12-28 17:42:09 +0100 | [diff] [blame] | 139 | /** |
| 140 | * drm_debug_printer - construct a &drm_printer that outputs to pr_debug() |
| 141 | * @prefix: debug output prefix |
| 142 | * |
| 143 | * RETURNS: |
| 144 | * The &drm_printer object |
| 145 | */ |
| 146 | static inline struct drm_printer drm_debug_printer(const char *prefix) |
| 147 | { |
| 148 | struct drm_printer p = { |
| 149 | .printfn = __drm_printfn_debug, |
| 150 | .prefix = prefix |
| 151 | }; |
| 152 | return p; |
| 153 | } |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 154 | |
| 155 | /* |
| 156 | * The following categories are defined: |
| 157 | * |
| 158 | * CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, ... |
| 159 | * This is the category used by the DRM_DEBUG() macro. |
| 160 | * |
| 161 | * DRIVER: Used in the vendor specific part of the driver: i915, radeon, ... |
| 162 | * This is the category used by the DRM_DEBUG_DRIVER() macro. |
| 163 | * |
| 164 | * KMS: used in the modesetting code. |
| 165 | * This is the category used by the DRM_DEBUG_KMS() macro. |
| 166 | * |
| 167 | * PRIME: used in the prime code. |
| 168 | * This is the category used by the DRM_DEBUG_PRIME() macro. |
| 169 | * |
| 170 | * ATOMIC: used in the atomic code. |
| 171 | * This is the category used by the DRM_DEBUG_ATOMIC() macro. |
| 172 | * |
| 173 | * VBL: used for verbose debug message in the vblank code |
| 174 | * This is the category used by the DRM_DEBUG_VBL() macro. |
| 175 | * |
| 176 | * Enabling verbose debug messages is done through the drm.debug parameter, |
| 177 | * each category being enabled by a bit. |
| 178 | * |
| 179 | * drm.debug=0x1 will enable CORE messages |
| 180 | * drm.debug=0x2 will enable DRIVER messages |
| 181 | * drm.debug=0x3 will enable CORE and DRIVER messages |
| 182 | * ... |
| 183 | * drm.debug=0x3f will enable all messages |
| 184 | * |
| 185 | * An interesting feature is that it's possible to enable verbose logging at |
| 186 | * run-time by echoing the debug value in its sysfs node: |
| 187 | * # echo 0xf > /sys/module/drm/parameters/debug |
| 188 | */ |
| 189 | #define DRM_UT_NONE 0x00 |
| 190 | #define DRM_UT_CORE 0x01 |
| 191 | #define DRM_UT_DRIVER 0x02 |
| 192 | #define DRM_UT_KMS 0x04 |
| 193 | #define DRM_UT_PRIME 0x08 |
| 194 | #define DRM_UT_ATOMIC 0x10 |
| 195 | #define DRM_UT_VBL 0x20 |
| 196 | #define DRM_UT_STATE 0x40 |
Daniel Vetter | 70c5f93 | 2017-11-21 11:33:10 +0100 | [diff] [blame] | 197 | #define DRM_UT_LEASE 0x80 |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 198 | |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 199 | __printf(3, 4) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 200 | void drm_dev_printk(const struct device *dev, const char *level, |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 201 | const char *format, ...); |
| 202 | __printf(3, 4) |
| 203 | void drm_dev_dbg(const struct device *dev, unsigned int category, |
| 204 | const char *format, ...); |
| 205 | |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 206 | __printf(2, 3) |
| 207 | void drm_dbg(unsigned int category, const char *format, ...); |
| 208 | __printf(1, 2) |
| 209 | void drm_err(const char *format, ...); |
Haneen Mohammed | 091756b | 2017-10-17 22:31:22 -0600 | [diff] [blame] | 210 | |
| 211 | /* Macros to make printk easier */ |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 212 | |
| 213 | #define _DRM_PRINTK(once, level, fmt, ...) \ |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 214 | printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 215 | |
| 216 | #define DRM_INFO(fmt, ...) \ |
| 217 | _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) |
| 218 | #define DRM_NOTE(fmt, ...) \ |
| 219 | _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) |
| 220 | #define DRM_WARN(fmt, ...) \ |
| 221 | _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) |
| 222 | |
| 223 | #define DRM_INFO_ONCE(fmt, ...) \ |
| 224 | _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) |
| 225 | #define DRM_NOTE_ONCE(fmt, ...) \ |
| 226 | _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) |
| 227 | #define DRM_WARN_ONCE(fmt, ...) \ |
| 228 | _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) |
| 229 | |
| 230 | /** |
| 231 | * Error output. |
| 232 | * |
Haneen Mohammed | 091756b | 2017-10-17 22:31:22 -0600 | [diff] [blame] | 233 | * @dev: device pointer |
| 234 | * @fmt: printf() like format string. |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 235 | */ |
| 236 | #define DRM_DEV_ERROR(dev, fmt, ...) \ |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 237 | drm_dev_printk(dev, KERN_ERR, "*ERROR* " fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 238 | #define DRM_ERROR(fmt, ...) \ |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 239 | drm_err(fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 240 | |
| 241 | /** |
| 242 | * Rate limited error output. Like DRM_ERROR() but won't flood the log. |
| 243 | * |
Haneen Mohammed | 091756b | 2017-10-17 22:31:22 -0600 | [diff] [blame] | 244 | * @dev: device pointer |
| 245 | * @fmt: printf() like format string. |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 246 | */ |
| 247 | #define DRM_DEV_ERROR_RATELIMITED(dev, fmt, ...) \ |
| 248 | ({ \ |
| 249 | static DEFINE_RATELIMIT_STATE(_rs, \ |
| 250 | DEFAULT_RATELIMIT_INTERVAL, \ |
| 251 | DEFAULT_RATELIMIT_BURST); \ |
| 252 | \ |
| 253 | if (__ratelimit(&_rs)) \ |
| 254 | DRM_DEV_ERROR(dev, fmt, ##__VA_ARGS__); \ |
| 255 | }) |
| 256 | #define DRM_ERROR_RATELIMITED(fmt, ...) \ |
| 257 | DRM_DEV_ERROR_RATELIMITED(NULL, fmt, ##__VA_ARGS__) |
| 258 | |
| 259 | #define DRM_DEV_INFO(dev, fmt, ...) \ |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 260 | drm_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 261 | |
| 262 | #define DRM_DEV_INFO_ONCE(dev, fmt, ...) \ |
| 263 | ({ \ |
| 264 | static bool __print_once __read_mostly; \ |
| 265 | if (!__print_once) { \ |
| 266 | __print_once = true; \ |
| 267 | DRM_DEV_INFO(dev, fmt, ##__VA_ARGS__); \ |
| 268 | } \ |
| 269 | }) |
| 270 | |
| 271 | /** |
| 272 | * Debug output. |
| 273 | * |
Haneen Mohammed | 091756b | 2017-10-17 22:31:22 -0600 | [diff] [blame] | 274 | * @dev: device pointer |
| 275 | * @fmt: printf() like format string. |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 276 | */ |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 277 | #define DRM_DEV_DEBUG(dev, fmt, ...) \ |
| 278 | drm_dev_dbg(dev, DRM_UT_CORE, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 279 | #define DRM_DEBUG(fmt, ...) \ |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 280 | drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 281 | |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 282 | #define DRM_DEV_DEBUG_DRIVER(dev, fmt, ...) \ |
| 283 | drm_dev_dbg(dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 284 | #define DRM_DEBUG_DRIVER(fmt, ...) \ |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 285 | drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 286 | |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 287 | #define DRM_DEV_DEBUG_KMS(dev, fmt, ...) \ |
| 288 | drm_dev_dbg(dev, DRM_UT_KMS, fmt, ##__VA_ARGS__) |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 289 | #define DRM_DEBUG_KMS(fmt, ...) \ |
| 290 | drm_dbg(DRM_UT_KMS, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 291 | |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 292 | #define DRM_DEV_DEBUG_PRIME(dev, fmt, ...) \ |
| 293 | drm_dev_dbg(dev, DRM_UT_PRIME, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 294 | #define DRM_DEBUG_PRIME(fmt, ...) \ |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 295 | drm_dbg(DRM_UT_PRIME, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 296 | |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 297 | #define DRM_DEV_DEBUG_ATOMIC(dev, fmt, ...) \ |
| 298 | drm_dev_dbg(dev, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 299 | #define DRM_DEBUG_ATOMIC(fmt, ...) \ |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 300 | drm_dbg(DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 301 | |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 302 | #define DRM_DEV_DEBUG_VBL(dev, fmt, ...) \ |
| 303 | drm_dev_dbg(dev, DRM_UT_VBL, fmt, ##__VA_ARGS__) |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 304 | #define DRM_DEBUG_VBL(fmt, ...) \ |
| 305 | drm_dbg(DRM_UT_VBL, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 306 | |
Daniel Vetter | 70c5f93 | 2017-11-21 11:33:10 +0100 | [diff] [blame] | 307 | #define DRM_DEBUG_LEASE(fmt, ...) \ |
Joe Perches | 99a9548 | 2018-03-13 15:02:15 -0700 | [diff] [blame] | 308 | drm_dbg(DRM_UT_LEASE, fmt, ##__VA_ARGS__) |
Daniel Vetter | 70c5f93 | 2017-11-21 11:33:10 +0100 | [diff] [blame] | 309 | |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 310 | #define _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, category, fmt, ...) \ |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 311 | ({ \ |
| 312 | static DEFINE_RATELIMIT_STATE(_rs, \ |
| 313 | DEFAULT_RATELIMIT_INTERVAL, \ |
| 314 | DEFAULT_RATELIMIT_BURST); \ |
| 315 | if (__ratelimit(&_rs)) \ |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 316 | drm_dev_dbg(dev, category, fmt, ##__VA_ARGS__); \ |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 317 | }) |
| 318 | |
| 319 | /** |
| 320 | * Rate limited debug output. Like DRM_DEBUG() but won't flood the log. |
| 321 | * |
Haneen Mohammed | 091756b | 2017-10-17 22:31:22 -0600 | [diff] [blame] | 322 | * @dev: device pointer |
| 323 | * @fmt: printf() like format string. |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 324 | */ |
Joe Perches | db87086 | 2018-03-16 13:56:27 -0700 | [diff] [blame] | 325 | #define DRM_DEV_DEBUG_RATELIMITED(dev, fmt, ...) \ |
| 326 | _DEV_DRM_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_CORE, \ |
| 327 | fmt, ##__VA_ARGS__) |
| 328 | #define DRM_DEBUG_RATELIMITED(fmt, ...) \ |
| 329 | DRM_DEV_DEBUG_RATELIMITED(NULL, fmt, ##__VA_ARGS__) |
| 330 | |
| 331 | #define DRM_DEV_DEBUG_DRIVER_RATELIMITED(dev, fmt, ...) \ |
| 332 | _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_DRIVER, \ |
| 333 | fmt, ##__VA_ARGS__) |
| 334 | #define DRM_DEBUG_DRIVER_RATELIMITED(fmt, ...) \ |
| 335 | DRM_DEV_DEBUG_DRIVER_RATELIMITED(NULL, fmt, ##__VA_ARGS__) |
| 336 | |
| 337 | #define DRM_DEV_DEBUG_KMS_RATELIMITED(dev, fmt, ...) \ |
| 338 | _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_KMS, \ |
| 339 | fmt, ##__VA_ARGS__) |
| 340 | #define DRM_DEBUG_KMS_RATELIMITED(fmt, ...) \ |
| 341 | DRM_DEV_DEBUG_KMS_RATELIMITED(NULL, fmt, ##__VA_ARGS__) |
| 342 | |
| 343 | #define DRM_DEV_DEBUG_PRIME_RATELIMITED(dev, fmt, ...) \ |
| 344 | _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_PRIME, \ |
| 345 | fmt, ##__VA_ARGS__) |
| 346 | #define DRM_DEBUG_PRIME_RATELIMITED(fmt, ...) \ |
| 347 | DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##__VA_ARGS__) |
Haneen Mohammed | 02c9656 | 2017-10-17 22:30:07 -0600 | [diff] [blame] | 348 | |
Rob Clark | d8187177 | 2016-11-05 11:08:07 -0400 | [diff] [blame] | 349 | #endif /* DRM_PRINT_H_ */ |