summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-04-14 19:54:45 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-04-14 19:54:45 +0200
commitf307f145a88869730b4a94883a881eb21cfbe2c0 (patch)
treef67731b244670fda015c808ab5b23821776f5baf /tests
parent24f189a31ae9741069141df6c43187b868e2974f (diff)
test_output: always enable all outputs
Instead of accepting a list of outputs we now enable all outputs when testing the video subsystem. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_output.c43
1 files changed, 15 insertions, 28 deletions
diff --git a/tests/test_output.c b/tests/test_output.c
index 72bf663..66417a0 100644
--- a/tests/test_output.c
+++ b/tests/test_output.c
@@ -28,14 +28,13 @@
* Test KMS/DRI output subsystem
* This is an example how to use the output subsystem. Invoked without
* arguments it prints a list of all connected outputs and their modes.
- * If you pass numbers as arguments, it will enable these outputs and show an
- * image on the given monitors for 5 seconds.
+ * If you pass any argument it will enable all outputs for 5seconds.
*
* This lists all outputs:
* $ ./test_output
*
- * This would show a test screen on output 0 and 4:
- * $ ./test_output 0 4
+ * This would show a test screen:
+ * $ ./test_output something
* The test screen is a colored quad with 4 different colors in each corner.
*/
@@ -65,10 +64,10 @@ float d_col[] = { 1, 1, 0, 1,
0, 0, 1, 1,
0, 1, 1, 1 };
-static int set_outputs(struct uterm_video *video, int num, char **list)
+static int set_outputs(struct uterm_video *video)
{
struct uterm_display *iter;
- int i, j, val, ret;
+ int j, ret;
struct gl_shader *shader;
struct uterm_screen *screen;
@@ -81,28 +80,16 @@ static int set_outputs(struct uterm_video *video, int num, char **list)
j = 0;
iter = uterm_video_get_displays(video);
for ( ; iter; iter = uterm_display_next(iter)) {
- for (i = 0; i < num; ++i) {
- val = atoi(list[i]);
- if (val == j)
- break;
- }
+ log_notice("Activating display %d %p...", j, iter);
+ ret = uterm_display_activate(iter, NULL);
+ if (ret)
+ log_err("Cannot activate display %d: %d", j, ret);
+ else
+ log_notice("Successfully activated display %d", j);
- if (i == num) {
- log_notice("Ignoring display %d", j);
- } else {
- log_notice("Activating display %d %p...", j, iter);
- ret = uterm_display_activate(iter, NULL);
- if (ret)
- log_err("Cannot activate display %d: %d", j,
- ret);
- else
- log_notice("Successfully activated display %d",
- j);
-
- ret = uterm_display_set_dpms(iter, UTERM_DPMS_ON);
- if (ret)
- log_err("Cannot set DPMS to ON: %d", ret);
- }
+ ret = uterm_display_set_dpms(iter, UTERM_DPMS_ON);
+ if (ret)
+ log_err("Cannot set DPMS to ON: %d", ret);
++j;
}
@@ -211,7 +198,7 @@ int main(int argc, char **argv)
goto err_unref;
}
} else {
- ret = set_outputs(video, argc - 1, &argv[1]);
+ ret = set_outputs(video);
if (ret) {
log_err("Cannot set outputs: %d", ret);
goto err_unref;