diff options
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d3778652e462..f8e87fde611b 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -146,6 +146,7 @@ void drm_err(const char *format, ...); | |||
146 | 146 | ||
147 | /* driver capabilities and requirements mask */ | 147 | /* driver capabilities and requirements mask */ |
148 | #define DRIVER_USE_AGP 0x1 | 148 | #define DRIVER_USE_AGP 0x1 |
149 | #define DRIVER_LEGACY 0x2 | ||
149 | #define DRIVER_PCI_DMA 0x8 | 150 | #define DRIVER_PCI_DMA 0x8 |
150 | #define DRIVER_SG 0x10 | 151 | #define DRIVER_SG 0x10 |
151 | #define DRIVER_HAVE_DMA 0x20 | 152 | #define DRIVER_HAVE_DMA 0x20 |
@@ -231,6 +232,36 @@ void drm_err(const char *format, ...); | |||
231 | drm_ut_debug_printk(__func__, fmt, ##args); \ | 232 | drm_ut_debug_printk(__func__, fmt, ##args); \ |
232 | } while (0) | 233 | } while (0) |
233 | 234 | ||
235 | #define _DRM_DEFINE_DEBUG_RATELIMITED(level, fmt, args...) \ | ||
236 | do { \ | ||
237 | if (unlikely(drm_debug & DRM_UT_ ## level)) { \ | ||
238 | static DEFINE_RATELIMIT_STATE( \ | ||
239 | _rs, \ | ||
240 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
241 | DEFAULT_RATELIMIT_BURST); \ | ||
242 | \ | ||
243 | if (__ratelimit(&_rs)) { \ | ||
244 | drm_ut_debug_printk(__func__, fmt, \ | ||
245 | ##args); \ | ||
246 | } \ | ||
247 | } \ | ||
248 | } while (0) | ||
249 | |||
250 | /** | ||
251 | * Rate limited debug output. Like DRM_DEBUG() but won't flood the log. | ||
252 | * | ||
253 | * \param fmt printf() like format string. | ||
254 | * \param arg arguments | ||
255 | */ | ||
256 | #define DRM_DEBUG_RATELIMITED(fmt, args...) \ | ||
257 | _DRM_DEFINE_DEBUG_RATELIMITED(CORE, fmt, ##args) | ||
258 | #define DRM_DEBUG_DRIVER_RATELIMITED(fmt, args...) \ | ||
259 | _DRM_DEFINE_DEBUG_RATELIMITED(DRIVER, fmt, ##args) | ||
260 | #define DRM_DEBUG_KMS_RATELIMITED(fmt, args...) \ | ||
261 | _DRM_DEFINE_DEBUG_RATELIMITED(KMS, fmt, ##args) | ||
262 | #define DRM_DEBUG_PRIME_RATELIMITED(fmt, args...) \ | ||
263 | _DRM_DEFINE_DEBUG_RATELIMITED(PRIME, fmt, ##args) | ||
264 | |||
234 | /*@}*/ | 265 | /*@}*/ |
235 | 266 | ||
236 | /***********************************************************************/ | 267 | /***********************************************************************/ |
@@ -642,7 +673,7 @@ struct drm_driver { | |||
642 | }; | 673 | }; |
643 | 674 | ||
644 | enum drm_minor_type { | 675 | enum drm_minor_type { |
645 | DRM_MINOR_LEGACY, | 676 | DRM_MINOR_PRIMARY, |
646 | DRM_MINOR_CONTROL, | 677 | DRM_MINOR_CONTROL, |
647 | DRM_MINOR_RENDER, | 678 | DRM_MINOR_RENDER, |
648 | DRM_MINOR_CNT, | 679 | DRM_MINOR_CNT, |
@@ -856,7 +887,7 @@ static inline bool drm_is_control_client(const struct drm_file *file_priv) | |||
856 | 887 | ||
857 | static inline bool drm_is_primary_client(const struct drm_file *file_priv) | 888 | static inline bool drm_is_primary_client(const struct drm_file *file_priv) |
858 | { | 889 | { |
859 | return file_priv->minor->type == DRM_MINOR_LEGACY; | 890 | return file_priv->minor->type == DRM_MINOR_PRIMARY; |
860 | } | 891 | } |
861 | 892 | ||
862 | /******************************************************************/ | 893 | /******************************************************************/ |