diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-02-27 08:28:22 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-04-15 16:10:30 +1000 |
commit | 4b51cf538b02ba133fcfc1bbda99dbbd40bfcf9a (patch) | |
tree | 39ae633464e4fbe4d422b322c7a6da6e90d405ab /bin | |
parent | 786786065974e29125a509f40e6d5217686ecdf0 (diff) | |
download | nouveau-4b51cf538b02ba133fcfc1bbda99dbbd40bfcf9a.tar.gz |
nv_init: tool to run full init/takedown sequence
Useful for debugging.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/Makefile.am | 2 | ||||
-rw-r--r-- | bin/nv_init.c | 42 |
2 files changed, 43 insertions, 1 deletions
diff --git a/bin/Makefile.am b/bin/Makefile.am index 39e246b00..082fe9724 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -4,7 +4,7 @@ bin_PROGRAMS = \ nv_ri08 nv_ri16 nv_ri32 nv_wi08 nv_wi16 nv_wi32 \ nv_rv08 nv_rv16 nv_rv32 nv_wv08 nv_wv16 nv_wv32 \ nv_rs08 nv_rs16 nv_rs32 nv_ws08 nv_ws16 nv_ws32 \ - nv_disp nv_i2c nv_aux + nv_disp nv_i2c nv_aux nv_init AM_CPPFLAGS = -I$(top_srcdir)/nvkm/include \ -I$(top_srcdir)/nvkm \ diff --git a/bin/nv_init.c b/bin/nv_init.c new file mode 100644 index 000000000..0f901a4c7 --- /dev/null +++ b/bin/nv_init.c @@ -0,0 +1,42 @@ +#include <stdlib.h> +#include <limits.h> +#include <unistd.h> + +#include <core/os.h> +#include <core/object.h> +#include <core/class.h> + +#include <core/device.h> + +struct nouveau_object *client; +struct nouveau_object *device; + +int +main(int argc, char **argv) +{ + int ret, c; + + while ((c = getopt(argc, argv, "-")) != -1) { + switch (c) { + case 1: + return -EINVAL; + } + } + + ret = os_client_new(NULL, "trace", argc, argv, &client); + if (ret) + return ret; + + ret = nouveau_object_new(client, ~0, 0, 0x0080, + &(struct nv_device_class) { + .device = ~0ULL, + .disable = 0ULL, + .debug0 = 0ULL, + }, sizeof(struct nv_device_class), &device); + if (ret) + return ret; + + os_client_del(&client); + nouveau_object_debug(); + return ret; +} |