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, ...); /* driver capabilities and requirements mask */ #define DRIVER_USE_AGP 0x1 +#define DRIVER_LEGACY 0x2 #define DRIVER_PCI_DMA 0x8 #define DRIVER_SG 0x10 #define DRIVER_HAVE_DMA 0x20 @@ -231,6 +232,36 @@ void drm_err(const char *format, ...); drm_ut_debug_printk(__func__, fmt, ##args); \ } while (0) +#define _DRM_DEFINE_DEBUG_RATELIMITED(level, fmt, args...) \ + do { \ + if (unlikely(drm_debug & DRM_UT_ ## level)) { \ + static DEFINE_RATELIMIT_STATE( \ + _rs, \ + DEFAULT_RATELIMIT_INTERVAL, \ + DEFAULT_RATELIMIT_BURST); \ + \ + if (__ratelimit(&_rs)) { \ + drm_ut_debug_printk(__func__, fmt, \ + ##args); \ + } \ + } \ + } while (0) + +/** + * Rate limited debug output. Like DRM_DEBUG() but won't flood the log. + * + * \param fmt printf() like format string. + * \param arg arguments + */ +#define DRM_DEBUG_RATELIMITED(fmt, args...) \ + _DRM_DEFINE_DEBUG_RATELIMITED(CORE, fmt, ##args) +#define DRM_DEBUG_DRIVER_RATELIMITED(fmt, args...) \ + _DRM_DEFINE_DEBUG_RATELIMITED(DRIVER, fmt, ##args) +#define DRM_DEBUG_KMS_RATELIMITED(fmt, args...) \ + _DRM_DEFINE_DEBUG_RATELIMITED(KMS, fmt, ##args) +#define DRM_DEBUG_PRIME_RATELIMITED(fmt, args...) \ + _DRM_DEFINE_DEBUG_RATELIMITED(PRIME, fmt, ##args) + /*@}*/ /***********************************************************************/ @@ -642,7 +673,7 @@ struct drm_driver { }; enum drm_minor_type { - DRM_MINOR_LEGACY, + DRM_MINOR_PRIMARY, DRM_MINOR_CONTROL, DRM_MINOR_RENDER, DRM_MINOR_CNT, @@ -856,7 +887,7 @@ static inline bool drm_is_control_client(const struct drm_file *file_priv) static inline bool drm_is_primary_client(const struct drm_file *file_priv) { - return file_priv->minor->type == DRM_MINOR_LEGACY; + return file_priv->minor->type == DRM_MINOR_PRIMARY; } /******************************************************************/ |