Skip to contentSkip to conversation

drm/nouveau: NV_DEBUG and NV_ATOMIC should call __drm_debug_enabled

PATCH New Timur Tabi 1 participant 1 message Feb 17, 2023

Subsystems (3)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 drm/nouveau: NV_DEBUG and NV_ATOMIC should call __drm_debug_enabled

Commit 6ce6fae84536 ("drm_print: optimize drm_debug_enabled for jump-label") changed drm_debug_enabled() to print a warning debug message every time it's called:

todo: is this frequent enough to optimize ?

Because the Nouveau macros NV_DEBUG and NV_ATOMIC call drm_debug_enabled(), this message can appear hundreds of times when the driver is loaded with debug messages enabled.

To avoid this, these macros should call __drm_debug_enabled() instead.

---
 drivers/gpu/drm/nouveau/nouveau_drv.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_drv.h +2 -2
index d6dd07bfa64a..5b4f87055202 100644
@@ -260,11 +260,11 @@ void nouveau_drm_device_remove(struct drm_device *dev);
 #define NV_INFO(drm,f,a...) NV_PRINTK(info, &(drm)->client, f, ##a)
 
 #define NV_DEBUG(drm,f,a...) do {                                              \
-	if (drm_debug_enabled(DRM_UT_DRIVER))                                  \
+	if (__drm_debug_enabled(DRM_UT_DRIVER))                                  \
 		NV_PRINTK(info, &(drm)->client, f, ##a);                       \
 } while(0)
 #define NV_ATOMIC(drm,f,a...) do {                                             \
-	if (drm_debug_enabled(DRM_UT_ATOMIC))                                  \
+	if (__drm_debug_enabled(DRM_UT_ATOMIC))                                  \
 		NV_PRINTK(info, &(drm)->client, f, ##a);                       \
 } while(0)
 
Signature · 1 line
2.34.1