nouveau: make debug features accessible in normal builds

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
main
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/unpack.h"
#ifdef DEBUG
drm_private uint32_t nouveau_debug = 0;
static void
@ -58,7 +57,6 @@ debug_init(char *args)
nouveau_debug = n;
}
}
#endif
static int
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;
drmVersionPtr ver;
#ifdef DEBUG
debug_init(getenv("NOUVEAU_LIBDRM_DEBUG"));
#endif
if (!(drm = calloc(1, sizeof(*drm))))
return -ENOMEM;

View File

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