nouveau: make debug features accessible in normal builds

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Karol Herbst 2021-05-05 14:01:29 +02:00
parent 2f04bd2d89
commit c0ae9cfa00
2 changed files with 0 additions and 9 deletions

View file

@ -46,7 +46,6 @@
#include "nvif/ioctl.h" #include "nvif/ioctl.h"
#include "nvif/unpack.h" #include "nvif/unpack.h"
#ifdef DEBUG
drm_private uint32_t nouveau_debug = 0; drm_private uint32_t nouveau_debug = 0;
static void static void
@ -58,7 +57,6 @@ debug_init(char *args)
nouveau_debug = n; nouveau_debug = n;
} }
} }
#endif
static int static int
nouveau_object_ioctl(struct nouveau_object *obj, void *data, uint32_t size) nouveau_object_ioctl(struct nouveau_object *obj, void *data, uint32_t size)
@ -327,9 +325,7 @@ nouveau_drm_new(int fd, struct nouveau_drm **pdrm)
struct nouveau_drm *drm; struct nouveau_drm *drm;
drmVersionPtr ver; drmVersionPtr ver;
#ifdef DEBUG
debug_init(getenv("NOUVEAU_LIBDRM_DEBUG")); debug_init(getenv("NOUVEAU_LIBDRM_DEBUG"));
#endif
if (!(drm = calloc(1, sizeof(*drm)))) if (!(drm = calloc(1, sizeof(*drm))))
return -ENOMEM; return -ENOMEM;

View file

@ -9,17 +9,12 @@
#include "nouveau.h" #include "nouveau.h"
#ifdef DEBUG
drm_private extern uint32_t nouveau_debug; drm_private extern uint32_t nouveau_debug;
#define dbg_on(lvl) (nouveau_debug & (1 << lvl)) #define dbg_on(lvl) (nouveau_debug & (1 << lvl))
#define dbg(lvl, fmt, args...) do { \ #define dbg(lvl, fmt, args...) do { \
if (dbg_on((lvl))) \ if (dbg_on((lvl))) \
fprintf(stderr, "nouveau: "fmt, ##args); \ fprintf(stderr, "nouveau: "fmt, ##args); \
} while(0) } while(0)
#else
#define dbg_on(lvl) (0)
#define dbg(lvl, fmt, args...)
#endif
#define err(fmt, args...) fprintf(stderr, "nouveau: "fmt, ##args) #define err(fmt, args...) fprintf(stderr, "nouveau: "fmt, ##args)
struct nouveau_client_kref { struct nouveau_client_kref {