summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-04-24 09:35:20 +1000
committerBen Skeggs <bskeggs@redhat.com>2013-04-24 15:19:53 +1000
commit827425c23f3da10dc70dddce0ddba5562dd72d8b (patch)
tree5765441458aba994f521bee65bf08ec88ea9a6b5 /bin
parent63799b814e3d0b944ed02721297aca1681e5b710 (diff)
downloadnouveau-827425c23f3da10dc70dddce0ddba5562dd72d8b.tar.gz
nv_init: optional s/r test and wait flags
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'bin')
-rw-r--r--bin/nv_init.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/nv_init.c b/bin/nv_init.c
index 0f901a4c7..548e55150 100644
--- a/bin/nv_init.c
+++ b/bin/nv_init.c
@@ -14,10 +14,17 @@ struct nouveau_object *device;
int
main(int argc, char **argv)
{
+ bool suspend = false, wait = false;
int ret, c;
- while ((c = getopt(argc, argv, "-")) != -1) {
+ while ((c = getopt(argc, argv, "-sw")) != -1) {
switch (c) {
+ case 's':
+ suspend = true;
+ break;
+ case 'w':
+ wait = true;
+ break;
case 1:
return -EINVAL;
}
@@ -36,6 +43,15 @@ main(int argc, char **argv)
if (ret)
return ret;
+ if (suspend) {
+ os_suspend();
+ os_resume();
+ }
+
+ while (wait && (c = getchar()) == EOF) {
+ sched_yield();
+ }
+
os_client_del(&client);
nouveau_object_debug();
return ret;