summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/Makefile.am7
-rw-r--r--src/sna/blt.c5
-rw-r--r--src/sna/fb/fbbitmap.c2
-rw-r--r--src/sna/gen2_render.c5
-rw-r--r--src/sna/gen3_render.c5
-rw-r--r--src/sna/gen4_render.c5
-rw-r--r--src/sna/gen5_render.c5
-rw-r--r--src/sna/gen6_render.c5
-rw-r--r--src/sna/gen7_render.c5
-rw-r--r--src/sna/kgem.c16
-rw-r--r--src/sna/kgem.h26
-rw-r--r--src/sna/sna.h24
-rw-r--r--src/sna/sna_accel.c7
-rw-r--r--src/sna/sna_blt.c5
-rw-r--r--src/sna/sna_composite.c7
-rw-r--r--src/sna/sna_damage.c30
-rw-r--r--src/sna/sna_damage.h2
-rw-r--r--src/sna/sna_display.c5
-rw-r--r--src/sna/sna_dri.c5
-rw-r--r--src/sna/sna_driver.c5
-rw-r--r--src/sna/sna_glyphs.c7
-rw-r--r--src/sna/sna_gradient.c5
-rw-r--r--src/sna/sna_io.c5
-rw-r--r--src/sna/sna_render.c5
-rw-r--r--src/sna/sna_stream.c5
-rw-r--r--src/sna/sna_tiling.c5
-rw-r--r--src/sna/sna_trapezoids.c9
-rw-r--r--src/sna/sna_video.c5
-rw-r--r--src/sna/sna_video_overlay.c5
-rw-r--r--src/sna/sna_video_sprite.c5
-rw-r--r--src/sna/sna_video_textured.c5
31 files changed, 47 insertions, 190 deletions
diff --git a/src/sna/Makefile.am b/src/sna/Makefile.am
index 8cd3c451..604a5db0 100644
--- a/src/sna/Makefile.am
+++ b/src/sna/Makefile.am
@@ -30,6 +30,10 @@ AM_CFLAGS = \
@DRI_CFLAGS@ \
$(NULL)
+if DEBUG
+AM_CFLAGS += @VALGRIND_CFLAGS@
+endif
+
noinst_LTLIBRARIES = libsna.la
libsna_la_LIBADD = @UDEV_LIBS@ -lm @DRM_LIBS@ fb/libfb.la
@@ -94,8 +98,7 @@ libsna_la_SOURCES += \
$(NULL)
endif
-if DEBUG
-AM_CFLAGS += @VALGRIND_CFLAGS@
+if FULL_DEBUG
libsna_la_SOURCES += \
kgem_debug.c \
kgem_debug.h \
diff --git a/src/sna/blt.c b/src/sna/blt.c
index c0922b5b..1ad5eeeb 100644
--- a/src/sna/blt.c
+++ b/src/sna/blt.c
@@ -35,11 +35,6 @@
#define USE_SSE2 1
#endif
-#if DEBUG_BLT
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#if USE_SSE2
#include <xmmintrin.h>
diff --git a/src/sna/fb/fbbitmap.c b/src/sna/fb/fbbitmap.c
index 075d6ccd..bad0c511 100644
--- a/src/sna/fb/fbbitmap.c
+++ b/src/sna/fb/fbbitmap.c
@@ -83,7 +83,7 @@ fbBitmapToRegion(PixmapPtr pixmap)
if (READ(bits) & mask0)
x1 = 0;
else
- x1 =-1;
+ x1 = -1;
/* Process all words which are fully in the pixmap */
end = bits + (width >> FB_SHIFT);
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index b41c3865..93880a89 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -38,11 +38,6 @@
#include "gen2_render.h"
-#if DEBUG_RENDER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define NO_COMPOSITE 0
#define NO_COMPOSITE_SPANS 0
#define NO_COPY 0
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index cfc8c63e..20286fc4 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -37,11 +37,6 @@
#include "gen3_render.h"
-#if DEBUG_RENDER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define NO_COMPOSITE 0
#define NO_COMPOSITE_SPANS 0
#define NO_COPY 0
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index c5775360..ed85554d 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -42,11 +42,6 @@
#include "gen4_render.h"
-#if DEBUG_RENDER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
/* gen4 has a serious issue with its shaders that we need to flush
* after every rectangle... So until that is resolved, prefer
* the BLT engine.
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 49cc17ed..7a203037 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -42,11 +42,6 @@
#include "gen5_render.h"
-#if DEBUG_RENDER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define NO_COMPOSITE_SPANS 0
#define PREFER_BLT_FILL 1
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 778a0722..6d8fbfdc 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -42,11 +42,6 @@
#include "gen6_render.h"
-#if DEBUG_RENDER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define NO_COMPOSITE 0
#define NO_COMPOSITE_SPANS 0
#define NO_COPY 0
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index f9b2e9e5..afb4b9b9 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -42,11 +42,6 @@
#include "gen7_render.h"
-#if DEBUG_RENDER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define NO_COMPOSITE 0
#define NO_COMPOSITE_SPANS 0
#define NO_COPY 0
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 2578ff9e..4fd4d1f7 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -55,6 +55,7 @@ search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags);
#define DBG_NO_HW 0
#define DBG_NO_TILING 0
+#define DBG_NO_CACHE 0
#define DBG_NO_CACHE_LEVEL 0
#define DBG_NO_VMAP 0
#define DBG_NO_LLC 0
@@ -66,12 +67,7 @@ search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags);
#define DBG_NO_RELAXED_FENCING 0
#define DBG_DUMP 0
-#define NO_CACHE 0
-
-#if DEBUG_KGEM
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
+#define SHOW_BATCH 0
/* Worst case seems to be 965gm where we cannot write within a cacheline that
* is being simultaneously being read by the GPU, or within the sampler
@@ -1256,7 +1252,7 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
bo->binding.offset = 0;
kgem_bo_clear_scanout(kgem, bo);
- if (NO_CACHE)
+ if (DBG_NO_CACHE)
goto destroy;
if (bo->vmap) {
@@ -1446,7 +1442,7 @@ static bool kgem_retire__flushing(struct kgem *kgem)
kgem_bo_free(kgem, bo);
}
}
-#if DEBUG_KGEM
+#if HAS_DEBUG_FULL
{
int count = 0;
list_for_each_entry(bo, &kgem->flushing, request)
@@ -1543,7 +1539,7 @@ static bool kgem_retire__requests(struct kgem *kgem)
free(rq);
}
-#if DEBUG_KGEM
+#if HAS_DEBUG_FULL
{
int count = 0;
@@ -1941,7 +1937,7 @@ void _kgem_submit(struct kgem *kgem)
kgem_finish_partials(kgem);
-#if DEBUG_BATCH
+#if HAS_DEBUG_FULL && SHOW_BATCH
__kgem_batch_debug(kgem, batch_end);
#endif
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 22ae4019..8d01807b 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -36,10 +36,10 @@
#include "compiler.h"
-#if DEBUG_KGEM
-#define DBG_HDR(x) ErrorF x
+#if HAS_DEBUG_FULL
+#define DBG(x) ErrorF x
#else
-#define DBG_HDR(x)
+#define DBG(x)
#endif
struct kgem_bo {
@@ -455,8 +455,8 @@ static inline bool kgem_bo_can_blt(struct kgem *kgem,
static inline bool kgem_bo_is_mappable(struct kgem *kgem,
struct kgem_bo *bo)
{
- DBG_HDR(("%s: domain=%d, offset: %d size: %d\n",
- __FUNCTION__, bo->domain, bo->presumed_offset, kgem_bo_size(bo)));
+ DBG(("%s: domain=%d, offset: %d size: %d\n",
+ __FUNCTION__, bo->domain, bo->presumed_offset, kgem_bo_size(bo)));
if (bo->domain == DOMAIN_GTT)
return true;
@@ -473,8 +473,8 @@ static inline bool kgem_bo_is_mappable(struct kgem *kgem,
static inline bool kgem_bo_mapped(struct kgem_bo *bo)
{
- DBG_HDR(("%s: map=%p, tiling=%d, domain=%d\n",
- __FUNCTION__, bo->map, bo->tiling, bo->domain));
+ DBG(("%s: map=%p, tiling=%d, domain=%d\n",
+ __FUNCTION__, bo->map, bo->tiling, bo->domain));
if (bo->map == NULL)
return bo->tiling == I915_TILING_NONE && bo->domain == DOMAIN_CPU;
@@ -496,15 +496,15 @@ static inline bool kgem_bo_can_map(struct kgem *kgem, struct kgem_bo *bo)
static inline bool kgem_bo_is_busy(struct kgem_bo *bo)
{
- DBG_HDR(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__,
- bo->handle, bo->domain, bo->exec != NULL, bo->rq != NULL));
+ DBG(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__,
+ bo->handle, bo->domain, bo->exec != NULL, bo->rq != NULL));
return bo->rq;
}
static inline bool __kgem_bo_is_busy(struct kgem *kgem, struct kgem_bo *bo)
{
- DBG_HDR(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__,
- bo->handle, bo->domain, bo->exec != NULL, bo->rq != NULL));
+ DBG(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__,
+ bo->handle, bo->domain, bo->exec != NULL, bo->rq != NULL));
if (bo->rq && !bo->exec)
kgem_retire(kgem);
return kgem_bo_is_busy(bo);
@@ -520,7 +520,7 @@ static inline bool kgem_bo_is_dirty(struct kgem_bo *bo)
static inline void kgem_bo_mark_dirty(struct kgem_bo *bo)
{
- DBG_HDR(("%s: handle=%d\n", __FUNCTION__, bo->handle));
+ DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
bo->dirty = true;
}
@@ -558,6 +558,4 @@ static inline void __kgem_batch_debug(struct kgem *kgem, uint32_t nbatch)
}
#endif
-#undef DBG_HDR
-
#endif /* KGEM_H */
diff --git a/src/sna/sna.h b/src/sna/sna.h
index f62cfbc3..64758630 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -67,27 +67,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <libudev.h>
#endif
+#if HAS_DEBUG_FULL
+#define DBG(x) ErrorF x
+#else
#define DBG(x)
-
-#define DEBUG_ALL (HAS_DEBUG_FULL || 0)
-#define DEBUG_ACCEL (DEBUG_ALL || 0)
-#define DEBUG_BATCH (DEBUG_ALL || 0)
-#define DEBUG_BLT (DEBUG_ALL || 0)
-#define DEBUG_COMPOSITE (DEBUG_ALL || 0)
-#define DEBUG_DAMAGE (DEBUG_ALL || 0)
-#define DEBUG_DISPLAY (DEBUG_ALL || 0)
-#define DEBUG_DRI (DEBUG_ALL || 0)
-#define DEBUG_DRIVER (DEBUG_ALL || 0)
-#define DEBUG_GRADIENT (DEBUG_ALL || 0)
-#define DEBUG_GLYPHS (DEBUG_ALL || 0)
-#define DEBUG_IO (DEBUG_ALL || 0)
-#define DEBUG_KGEM (DEBUG_ALL || 0)
-#define DEBUG_RENDER (DEBUG_ALL || 0)
-#define DEBUG_STREAM (DEBUG_ALL || 0)
-#define DEBUG_TRAPEZOIDS (DEBUG_ALL || 0)
-#define DEBUG_VIDEO (DEBUG_ALL || 0)
-#define DEBUG_VIDEO_TEXTURED (DEBUG_ALL || 0)
-#define DEBUG_VIDEO_OVERLAY (DEBUG_ALL || 0)
+#endif
#define DEBUG_NO_RENDER 0
#define DEBUG_NO_BLT 0
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 973ac32f..6567de15 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -51,11 +51,6 @@
#include <sys/mman.h>
#include <unistd.h>
-#if DEBUG_ACCEL
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define FORCE_INPLACE 0
#define FORCE_FALLBACK 0
#define FORCE_FLUSH 0
@@ -12441,7 +12436,7 @@ static void sna_accel_inactive(struct sna *sna)
DBG(("%s (time=%ld)\n", __FUNCTION__, (long)TIME));
-#if DEBUG_ACCEL
+#if HAS_FULL_DEBUG
{
unsigned count, bytes;
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 0b0471ec..1d2678ac 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -38,11 +38,6 @@
#include "sna_reg.h"
#include "rop.h"
-#if DEBUG_BLT
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define NO_BLT_COMPOSITE 0
#define NO_BLT_COPY 0
#define NO_BLT_COPY_BOXES 0
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 606acb64..2fcc0d9d 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -36,11 +36,6 @@
#include <mipict.h>
-#if DEBUG_COMPOSITE
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define NO_COMPOSITE 0
#define NO_COMPOSITE_RECTANGLES 0
@@ -372,7 +367,7 @@ sna_compute_composite_extents(BoxPtr extents,
return extents->x1 < extents->x2 && extents->y1 < extents->y2;
}
-#if DEBUG_COMPOSITE
+#if HAS_DEBUG_FULL
static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char *function)
{
if (box->x1 < 0 || box->y1 < 0 ||
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c
index 745e2d12..4bd4b9b5 100644
--- a/src/sna/sna_damage.c
+++ b/src/sna/sna_damage.c
@@ -60,10 +60,7 @@ static inline bool region_is_singular(RegionRec *r)
return r->data == NULL;
}
-#if DEBUG_DAMAGE
-#undef DBG
-#define DBG(x) ErrorF x
-
+#if HAS_DEBUG_FULL
static const char *_debug_describe_region(char *buf, int max,
RegionPtr region)
{
@@ -151,7 +148,6 @@ static const char *_debug_describe_damage(char *buf, int max,
return buf;
}
-
#endif
static void
@@ -634,7 +630,7 @@ inline static struct sna_damage *__sna_damage_add(struct sna_damage *damage,
REGION_NUM_RECTS(region));
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
fastcall struct sna_damage *_sna_damage_add(struct sna_damage *damage,
RegionPtr region)
{
@@ -715,7 +711,7 @@ __sna_damage_add_boxes(struct sna_damage *damage,
return _sna_damage_create_elt_from_boxes(damage, box, n, dx, dy);
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
struct sna_damage *_sna_damage_add_boxes(struct sna_damage *damage,
const BoxRec *b, int n,
int16_t dx, int16_t dy)
@@ -800,7 +796,7 @@ __sna_damage_add_rectangles(struct sna_damage *damage,
return _sna_damage_create_elt_from_rectangles(damage, r, n, dx, dy);
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
struct sna_damage *_sna_damage_add_rectangles(struct sna_damage *damage,
const xRectangle *r, int n,
int16_t dx, int16_t dy)
@@ -882,7 +878,7 @@ __sna_damage_add_points(struct sna_damage *damage,
return damage;
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
struct sna_damage *_sna_damage_add_points(struct sna_damage *damage,
const DDXPointRec *p, int n,
int16_t dx, int16_t dy)
@@ -909,7 +905,7 @@ struct sna_damage *_sna_damage_add_points(struct sna_damage *damage,
}
#endif
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
fastcall struct sna_damage *_sna_damage_add_box(struct sna_damage *damage,
const BoxRec *box)
{
@@ -1060,7 +1056,7 @@ static struct sna_damage *__sna_damage_subtract(struct sna_damage *damage,
REGION_NUM_RECTS(region));
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
fastcall struct sna_damage *_sna_damage_subtract(struct sna_damage *damage,
RegionPtr region)
{
@@ -1131,7 +1127,7 @@ inline static struct sna_damage *__sna_damage_subtract_box(struct sna_damage *da
return _sna_damage_create_elt(damage, box, 1);
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
fastcall struct sna_damage *_sna_damage_subtract_box(struct sna_damage *damage,
const BoxRec *box)
{
@@ -1212,7 +1208,7 @@ static struct sna_damage *__sna_damage_subtract_boxes(struct sna_damage *damage,
return _sna_damage_create_elt_from_boxes(damage, box, n, dx, dy);
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
fastcall struct sna_damage *_sna_damage_subtract_boxes(struct sna_damage *damage,
const BoxRec *box, int n,
int dx, int dy)
@@ -1272,7 +1268,7 @@ static int __sna_damage_contains_box(struct sna_damage *damage,
return pixman_region_contains_rectangle(&damage->region, (BoxPtr)box);
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
int _sna_damage_contains_box(struct sna_damage *damage,
const BoxRec *box)
{
@@ -1338,7 +1334,7 @@ static Bool __sna_damage_intersect(struct sna_damage *damage,
return RegionNotEmpty(result);
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
Bool _sna_damage_intersect(struct sna_damage *damage,
RegionPtr region, RegionPtr result)
{
@@ -1391,7 +1387,7 @@ struct sna_damage *_sna_damage_reduce(struct sna_damage *damage)
return damage;
}
-#if DEBUG_DAMAGE
+#if HAS_DEBUG_FULL
int _sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes)
{
char damage_buf[1000];
@@ -1436,7 +1432,7 @@ void __sna_damage_destroy(struct sna_damage *damage)
__freed_damage = damage;
}
-#if DEBUG_DAMAGE && TEST_DAMAGE
+#if TEST_DAMAGE && HAS_DEBUG_FULL
struct sna_damage_selftest{
int width, height;
};
diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h
index a006adee..21db3e3f 100644
--- a/src/sna/sna_damage.h
+++ b/src/sna/sna_damage.h
@@ -287,7 +287,7 @@ static inline void sna_damage_destroy(struct sna_damage **damage)
void _sna_damage_debug_get_region(struct sna_damage *damage, RegionRec *r);
-#if DEBUG_DAMAGE && TEST_DAMAGE
+#if HAS_DEBUG_FULL && TEST_DAMAGE
void sna_damage_selftest(void);
#else
static inline void sna_damage_selftest(void) {}
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 12a6bac8..1c808d1e 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -51,11 +51,6 @@
#include "intel_options.h"
-#if DEBUG_DISPLAY
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#if 0
#define __DBG DBG
#else
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 75c66b7a..405a7cd2 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -46,11 +46,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <i915_drm.h>
#include <dri2.h>
-#if DEBUG_DRI
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#if DRI2INFOREC_VERSION <= 2
#error DRI2 version supported by the Xserver is too old
#endif
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index bbbcb637..e645ee63 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -75,11 +75,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "git_version.h"
#endif
-#if DEBUG_DRIVER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
static DevPrivateKeyRec sna_pixmap_key;
static DevPrivateKeyRec sna_gc_key;
static DevPrivateKeyRec sna_glyph_key;
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 01795207..dbacaa85 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -69,11 +69,6 @@
#include <mipict.h>
-#if DEBUG_GLYPHS
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define FALLBACK 0
#define NO_GLYPH_CACHE 0
#define NO_GLYPHS_TO_DST 0
@@ -86,7 +81,7 @@
#define GLYPH_MAX_SIZE 64
#define GLYPH_CACHE_SIZE (CACHE_PICTURE_SIZE * CACHE_PICTURE_SIZE / (GLYPH_MIN_SIZE * GLYPH_MIN_SIZE))
-#if DEBUG_GLYPHS
+#if HAS_DEBUG_FULL
static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char *function)
{
if (box->x1 < 0 || box->y1 < 0 ||
diff --git a/src/sna/sna_gradient.c b/src/sna/sna_gradient.c
index 9ac03288..d9f62934 100644
--- a/src/sna/sna_gradient.c
+++ b/src/sna/sna_gradient.c
@@ -32,11 +32,6 @@
#include "sna.h"
#include "sna_render.h"
-#if DEBUG_GRADIENT
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define xFixedToDouble(f) pixman_fixed_to_double(f)
static int
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index ffa86b10..2baee4c1 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -35,11 +35,6 @@
#include <sys/mman.h>
-#if DEBUG_IO
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define PITCH(x, y) ALIGN((x)*(y), 4)
#define FORCE_INPLACE 0 /* 1 upload directly, -1 force indirect */
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index f6a562b0..24922b36 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -30,11 +30,6 @@
#include "sna_render_inline.h"
#include "fb/fbpict.h"
-#if DEBUG_RENDER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define NO_REDIRECT 0
#define NO_CONVERT 0
#define NO_FIXUP 0
diff --git a/src/sna/sna_stream.c b/src/sna/sna_stream.c
index 7f05d210..aab15498 100644
--- a/src/sna/sna_stream.c
+++ b/src/sna/sna_stream.c
@@ -28,11 +28,6 @@
#include "sna.h"
#include "sna_render.h"
-#if DEBUG_STREAM
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
int sna_static_stream_init(struct sna_static_stream *stream)
{
stream->used = 0;
diff --git a/src/sna/sna_tiling.c b/src/sna/sna_tiling.c
index ae14d796..fdc297aa 100644
--- a/src/sna/sna_tiling.c
+++ b/src/sna/sna_tiling.c
@@ -33,11 +33,6 @@
#include "sna_render.h"
#include "fb/fbpict.h"
-#if DEBUG_RENDER
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
struct sna_tile_span {
BoxRec box;
float opacity;
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 56c6a3e9..744818f5 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -38,11 +38,6 @@
#include <mipict.h>
-#if DEBUG_TRAPEZOIDS
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#if 0
#define __DBG(x) ErrorF x
#else
@@ -79,7 +74,7 @@ typedef void (*span_func_t)(struct sna *sna,
const BoxRec *box,
int coverage);
-#if DEBUG_TRAPEZOIDS
+#if HAS_DEBUG_FULL
static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char *function)
{
if (box->x1 < 0 || box->y1 < 0 ||
@@ -2000,7 +1995,7 @@ mono_merge_unsorted_edges(struct mono_edge *head, struct mono_edge *unsorted)
return mono_merge_sorted_edges(head, unsorted);
}
-#if DEBUG_TRAPEZOIDS
+#if 0
static inline void
__dbg_mono_edges(const char *function, struct mono_edge *edges)
{
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index 6ad81c36..71d1bbc4 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -74,11 +74,6 @@ static inline Bool sna_video_xvmc_setup(struct sna *sna,
}
#endif
-#if DEBUG_VIDEO_TEXTURED
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
void sna_video_free_buffers(struct sna *sna, struct sna_video *video)
{
unsigned int i;
diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c
index d47f7458..99f9ca58 100644
--- a/src/sna/sna_video_overlay.c
+++ b/src/sna/sna_video_overlay.c
@@ -39,11 +39,6 @@
#include "intel_options.h"
-#if DEBUG_VIDEO_OVERLAY
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
#define HAS_GAMMA(sna) ((sna)->kgem.gen >= 30)
diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index 8c3cdaa9..d0a4808c 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -40,11 +40,6 @@
#include <drm_fourcc.h>
#include <i915_drm.h>
-#if DEBUG_VIDEO_OVERLAY
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define IMAGE_MAX_WIDTH 2048
#define IMAGE_MAX_HEIGHT 2048
diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c
index 1b3b3af2..805aee76 100644
--- a/src/sna/sna_video_textured.c
+++ b/src/sna/sna_video_textured.c
@@ -39,11 +39,6 @@
#include "sna_video_hwmc.h"
#endif
-#if DEBUG_VIDEO_TEXTURED
-#undef DBG
-#define DBG(x) ErrorF x
-#endif
-
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
static Atom xvBrightness, xvContrast, xvSyncToVblank;