Merge branch 'glamor-add-pixmap-alloc-debug' into 'master'

Draft: glamor: Add debug for pixmap allocations

See merge request xorg/xserver!1704
This commit is contained in:
Olivier Fourdan 2025-12-22 17:39:01 +01:00
commit ef05ce6373
2 changed files with 11 additions and 0 deletions

View file

@ -237,6 +237,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
if (usage == GLAMOR_CREATE_PIXMAP_NO_TEXTURE) {
glamor_init_pixmap_private_small(pixmap, pixmap_priv);
glamor_debug_pixmap_alloc("pixmap %p\n", pixmap);
return pixmap;
}
else if (usage == GLAMOR_CREATE_NO_LARGE ||
@ -258,6 +259,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
}
glamor_pixmap_attach_fbo(pixmap, fbo);
glamor_debug_pixmap_alloc("pixmap %p\n", pixmap);
return pixmap;
}
@ -266,6 +268,7 @@ Bool
glamor_destroy_pixmap(PixmapPtr pixmap)
{
if (pixmap->refcnt == 1) {
glamor_debug_pixmap_alloc("pixmap %p\n", pixmap);
glamor_pixmap_destroy_fbo(pixmap);
}

View file

@ -34,6 +34,7 @@
#define GLAMOR_DEBUG_FALLBACK 1
#define GLAMOR_DEBUG_TEXTURE_DOWNLOAD 2
#define GLAMOR_DEBUG_TEXTURE_DYNAMIC_UPLOAD 3
#define GLAMOR_DEBUG_PIXMAP_ALLOC 4
#define GLAMOR_PANIC(_format_, ...) \
do { \
@ -66,6 +67,13 @@
"Glamor fallback", \
##__VA_ARGS__);} while(0)
#define glamor_debug_pixmap_alloc(_format_,...) \
do { \
if (glamor_debug_level >= GLAMOR_DEBUG_PIXMAP_ALLOC) \
__debug_output_message(_format_, \
"Glamor pixmap alloc", \
##__VA_ARGS__);} while(0)
#define DEBUGF(str, ...) do {} while(0)
//#define DEBUGF(str, ...) ErrorF(str, ##__VA_ARGS__)
#define DEBUGRegionPrint(x) do {} while (0)