diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-08-29 06:12:38 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-09-10 03:41:20 -0400 |
commit | edf0ac7c67ce596f43d66a781660889bbdcc9505 (patch) | |
tree | 3dc84b9857549790628b9173c4f5d120507f6298 | |
parent | 969939087da7aca386ff166a1c67ee9707215feb (diff) |
drm: drop DRM_DEBUG_CODE
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>
-rw-r--r-- | drivers/gpu/drm/drm_debugfs.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_vm.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_ring.c | 21 | ||||
-rw-r--r-- | include/drm/drmP.h | 12 |
5 files changed, 12 insertions, 44 deletions
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 13bd42923dd4..4491dbda653e 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c | |||
@@ -49,9 +49,7 @@ static const struct drm_info_list drm_debugfs_list[] = { | |||
49 | {"clients", drm_clients_info, 0}, | 49 | {"clients", drm_clients_info, 0}, |
50 | {"bufs", drm_bufs_info, 0}, | 50 | {"bufs", drm_bufs_info, 0}, |
51 | {"gem_names", drm_gem_name_info, DRIVER_GEM}, | 51 | {"gem_names", drm_gem_name_info, DRIVER_GEM}, |
52 | #if DRM_DEBUG_CODE | ||
53 | {"vma", drm_vma_info, 0}, | 52 | {"vma", drm_vma_info, 0}, |
54 | #endif | ||
55 | }; | 53 | }; |
56 | #define DRM_DEBUGFS_ENTRIES ARRAY_SIZE(drm_debugfs_list) | 54 | #define DRM_DEBUGFS_ENTRIES ARRAY_SIZE(drm_debugfs_list) |
57 | 55 | ||
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index 967e570bb0d1..4b3e9c4754d1 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c | |||
@@ -683,8 +683,6 @@ void drm_legacy_vma_flush(struct drm_device *dev) | |||
683 | } | 683 | } |
684 | } | 684 | } |
685 | 685 | ||
686 | #if DRM_DEBUG_CODE | ||
687 | |||
688 | int drm_vma_info(struct seq_file *m, void *data) | 686 | int drm_vma_info(struct seq_file *m, void *data) |
689 | { | 687 | { |
690 | struct drm_info_node *node = (struct drm_info_node *) m->private; | 688 | 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) | |||
738 | mutex_unlock(&dev->struct_mutex); | 736 | mutex_unlock(&dev->struct_mutex); |
739 | return 0; | 737 | return 0; |
740 | } | 738 | } |
741 | |||
742 | #endif | ||
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index d80dc547a105..79c988db79ad 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -2776,18 +2776,25 @@ void radeon_atombios_fini(struct radeon_device *rdev); | |||
2776 | /* | 2776 | /* |
2777 | * RING helpers. | 2777 | * RING helpers. |
2778 | */ | 2778 | */ |
2779 | #if DRM_DEBUG_CODE == 0 | 2779 | |
2780 | /** | ||
2781 | * radeon_ring_write - write a value to the ring | ||
2782 | * | ||
2783 | * @ring: radeon_ring structure holding ring information | ||
2784 | * @v: dword (dw) value to write | ||
2785 | * | ||
2786 | * Write a value to the requested ring buffer (all asics). | ||
2787 | */ | ||
2780 | static inline void radeon_ring_write(struct radeon_ring *ring, uint32_t v) | 2788 | static inline void radeon_ring_write(struct radeon_ring *ring, uint32_t v) |
2781 | { | 2789 | { |
2790 | if (ring->count_dw <= 0) | ||
2791 | DRM_ERROR("radeon: writing more dwords to the ring than expected!\n"); | ||
2792 | |||
2782 | ring->ring[ring->wptr++] = v; | 2793 | ring->ring[ring->wptr++] = v; |
2783 | ring->wptr &= ring->ptr_mask; | 2794 | ring->wptr &= ring->ptr_mask; |
2784 | ring->count_dw--; | 2795 | ring->count_dw--; |
2785 | ring->ring_free_dw--; | 2796 | ring->ring_free_dw--; |
2786 | } | 2797 | } |
2787 | #else | ||
2788 | /* With debugging this is just too big to inline */ | ||
2789 | void radeon_ring_write(struct radeon_ring *ring, uint32_t v); | ||
2790 | #endif | ||
2791 | 2798 | ||
2792 | /* | 2799 | /* |
2793 | * ASICs macro. | 2800 | * ASICs macro. |
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index d65607902537..6f2a9bd6bb54 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c | |||
@@ -45,27 +45,6 @@ | |||
45 | static int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring); | 45 | static int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring); |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * radeon_ring_write - write a value to the ring | ||
49 | * | ||
50 | * @ring: radeon_ring structure holding ring information | ||
51 | * @v: dword (dw) value to write | ||
52 | * | ||
53 | * Write a value to the requested ring buffer (all asics). | ||
54 | */ | ||
55 | void radeon_ring_write(struct radeon_ring *ring, uint32_t v) | ||
56 | { | ||
57 | #if DRM_DEBUG_CODE | ||
58 | if (ring->count_dw <= 0) { | ||
59 | DRM_ERROR("radeon: writing more dwords to the ring than expected!\n"); | ||
60 | } | ||
61 | #endif | ||
62 | ring->ring[ring->wptr++] = v; | ||
63 | ring->wptr &= ring->ptr_mask; | ||
64 | ring->count_dw--; | ||
65 | ring->ring_free_dw--; | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * radeon_ring_supports_scratch_reg - check if the ring supports | 48 | * radeon_ring_supports_scratch_reg - check if the ring supports |
70 | * writing to scratch registers | 49 | * writing to scratch registers |
71 | * | 50 | * |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 8b3f3b7dc2f2..8f55875dafbb 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -140,9 +140,6 @@ int drm_err(const char *func, const char *format, ...); | |||
140 | /** \name Begin the DRM... */ | 140 | /** \name Begin the DRM... */ |
141 | /*@{*/ | 141 | /*@{*/ |
142 | 142 | ||
143 | #define DRM_DEBUG_CODE 2 /**< Include debugging code if > 1, then | ||
144 | also include looping detection. */ | ||
145 | |||
146 | #define DRM_MAGIC_HASH_ORDER 4 /**< Size of key hash table. Must be power of 2. */ | 143 | #define DRM_MAGIC_HASH_ORDER 4 /**< Size of key hash table. Must be power of 2. */ |
147 | 144 | ||
148 | /*@}*/ | 145 | /*@}*/ |
@@ -188,7 +185,6 @@ int drm_err(const char *func, const char *format, ...); | |||
188 | * \param fmt printf() like format string. | 185 | * \param fmt printf() like format string. |
189 | * \param arg arguments | 186 | * \param arg arguments |
190 | */ | 187 | */ |
191 | #if DRM_DEBUG_CODE | ||
192 | #define DRM_DEBUG(fmt, args...) \ | 188 | #define DRM_DEBUG(fmt, args...) \ |
193 | do { \ | 189 | do { \ |
194 | if (unlikely(drm_debug & DRM_UT_CORE)) \ | 190 | if (unlikely(drm_debug & DRM_UT_CORE)) \ |
@@ -210,12 +206,6 @@ int drm_err(const char *func, const char *format, ...); | |||
210 | if (unlikely(drm_debug & DRM_UT_PRIME)) \ | 206 | if (unlikely(drm_debug & DRM_UT_PRIME)) \ |
211 | drm_ut_debug_printk(__func__, fmt, ##args); \ | 207 | drm_ut_debug_printk(__func__, fmt, ##args); \ |
212 | } while (0) | 208 | } while (0) |
213 | #else | ||
214 | #define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0) | ||
215 | #define DRM_DEBUG_KMS(fmt, args...) do { } while (0) | ||
216 | #define DRM_DEBUG_PRIME(fmt, args...) do { } while (0) | ||
217 | #define DRM_DEBUG(fmt, arg...) do { } while (0) | ||
218 | #endif | ||
219 | 209 | ||
220 | /*@}*/ | 210 | /*@}*/ |
221 | 211 | ||
@@ -1348,9 +1338,7 @@ void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv); | |||
1348 | void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); | 1338 | void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); |
1349 | void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf); | 1339 | void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf); |
1350 | 1340 | ||
1351 | #if DRM_DEBUG_CODE | ||
1352 | extern int drm_vma_info(struct seq_file *m, void *data); | 1341 | extern int drm_vma_info(struct seq_file *m, void *data); |
1353 | #endif | ||
1354 | 1342 | ||
1355 | /* Scatter Gather Support (drm_scatter.h) */ | 1343 | /* Scatter Gather Support (drm_scatter.h) */ |
1356 | extern void drm_legacy_sg_cleanup(struct drm_device *dev); | 1344 | extern void drm_legacy_sg_cleanup(struct drm_device *dev); |