]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm: drop DRM_DEBUG_CODE
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 29 Aug 2014 10:12:38 +0000 (12:12 +0200)
committerDave Airlie <airlied@redhat.com>
Wed, 10 Sep 2014 07:41:20 +0000 (17:41 +1000)
DRM_DEBUG_CODE is currently always set, so distributions enable it. The
only reason to keep support in code is if developers wanted to disable
debug support. Sounds unlikely.

All the DRM_DEBUG() printks are still guarded by a drm_debug read. So if
its cacheline is read once, they're discarded pretty fast.. There should
hardly be any performance penalty, it's even guarded by unlikely().

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_debugfs.c
drivers/gpu/drm/drm_vm.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_ring.c
include/drm/drmP.h

index 13bd42923dd4e2b4ca018e3ee2b1cb09a30b4677..4491dbda653ea09915c2a660f9ba4f89b0408f2d 100644 (file)
@@ -49,9 +49,7 @@ static const struct drm_info_list drm_debugfs_list[] = {
        {"clients", drm_clients_info, 0},
        {"bufs", drm_bufs_info, 0},
        {"gem_names", drm_gem_name_info, DRIVER_GEM},
-#if DRM_DEBUG_CODE
        {"vma", drm_vma_info, 0},
-#endif
 };
 #define DRM_DEBUGFS_ENTRIES ARRAY_SIZE(drm_debugfs_list)
 
index 967e570bb0d16597fd2c1a6c22e8d37df7dc2d64..4b3e9c4754d18b628c325aa0ffc7202660bed4fc 100644 (file)
@@ -683,8 +683,6 @@ void drm_legacy_vma_flush(struct drm_device *dev)
        }
 }
 
-#if DRM_DEBUG_CODE
-
 int drm_vma_info(struct seq_file *m, void *data)
 {
        struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -738,5 +736,3 @@ int drm_vma_info(struct seq_file *m, void *data)
        mutex_unlock(&dev->struct_mutex);
        return 0;
 }
-
-#endif
index d80dc547a105041bdbb88ffdce65b578fb542779..79c988db79ad15810ce74a5616e2c971d3e6d86c 100644 (file)
@@ -2776,18 +2776,25 @@ void radeon_atombios_fini(struct radeon_device *rdev);
 /*
  * RING helpers.
  */
-#if DRM_DEBUG_CODE == 0
+
+/**
+ * radeon_ring_write - write a value to the ring
+ *
+ * @ring: radeon_ring structure holding ring information
+ * @v: dword (dw) value to write
+ *
+ * Write a value to the requested ring buffer (all asics).
+ */
 static inline void radeon_ring_write(struct radeon_ring *ring, uint32_t v)
 {
+       if (ring->count_dw <= 0)
+               DRM_ERROR("radeon: writing more dwords to the ring than expected!\n");
+
        ring->ring[ring->wptr++] = v;
        ring->wptr &= ring->ptr_mask;
        ring->count_dw--;
        ring->ring_free_dw--;
 }
-#else
-/* With debugging this is just too big to inline */
-void radeon_ring_write(struct radeon_ring *ring, uint32_t v);
-#endif
 
 /*
  * ASICs macro.
index d65607902537f41a7ede21261eb111ddbf257e63..6f2a9bd6bb5404808b5dbb675d2849b7ba33240d 100644 (file)
  */
 static int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring);
 
-/**
- * radeon_ring_write - write a value to the ring
- *
- * @ring: radeon_ring structure holding ring information
- * @v: dword (dw) value to write
- *
- * Write a value to the requested ring buffer (all asics).
- */
-void radeon_ring_write(struct radeon_ring *ring, uint32_t v)
-{
-#if DRM_DEBUG_CODE
-       if (ring->count_dw <= 0) {
-               DRM_ERROR("radeon: writing more dwords to the ring than expected!\n");
-       }
-#endif
-       ring->ring[ring->wptr++] = v;
-       ring->wptr &= ring->ptr_mask;
-       ring->count_dw--;
-       ring->ring_free_dw--;
-}
-
 /**
  * radeon_ring_supports_scratch_reg - check if the ring supports
  * writing to scratch registers
index 8b3f3b7dc2f206f4ba429aea9e73c6866d0b9d2f..8f55875dafbb608b58cb670ce812389909e323cb 100644 (file)
@@ -140,9 +140,6 @@ int drm_err(const char *func, const char *format, ...);
 /** \name Begin the DRM... */
 /*@{*/
 
-#define DRM_DEBUG_CODE 2         /**< Include debugging code if > 1, then
-                                    also include looping detection. */
-
 #define DRM_MAGIC_HASH_ORDER  4  /**< Size of key hash table. Must be power of 2. */
 
 /*@}*/
@@ -188,7 +185,6 @@ int drm_err(const char *func, const char *format, ...);
  * \param fmt printf() like format string.
  * \param arg arguments
  */
-#if DRM_DEBUG_CODE
 #define DRM_DEBUG(fmt, args...)                                                \
        do {                                                            \
                if (unlikely(drm_debug & DRM_UT_CORE))                  \
@@ -210,12 +206,6 @@ int drm_err(const char *func, const char *format, ...);
                if (unlikely(drm_debug & DRM_UT_PRIME))                 \
                        drm_ut_debug_printk(__func__, fmt, ##args);     \
        } while (0)
-#else
-#define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0)
-#define DRM_DEBUG_KMS(fmt, args...)    do { } while (0)
-#define DRM_DEBUG_PRIME(fmt, args...)  do { } while (0)
-#define DRM_DEBUG(fmt, arg...)          do { } while (0)
-#endif
 
 /*@}*/
 
@@ -1348,9 +1338,7 @@ void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv);
 void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv);
 void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf);
 
-#if DRM_DEBUG_CODE
 extern int drm_vma_info(struct seq_file *m, void *data);
-#endif
 
                                /* Scatter Gather Support (drm_scatter.h) */
 extern void drm_legacy_sg_cleanup(struct drm_device *dev);