summaryrefslogtreecommitdiff
path: root/tests/modetest
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-12-18 00:02:43 -0500
committerKristian Høgsberg <krh@redhat.com>2008-12-18 00:02:43 -0500
commit0243c9f801a35de3465a0321c02f18a4d07ce5b8 (patch)
tree1b687766a84fb5f210e7e0f067c3dd68c71cc146 /tests/modetest
parent06ab2f6436e26f77292d53e3ce2fe547d4a79fe3 (diff)
modetest: Print more stuff. Prettier.
Diffstat (limited to 'tests/modetest')
-rw-r--r--tests/modetest/modetest.c51
1 files changed, 36 insertions, 15 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index e5a16e1a..193057ca 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -128,6 +128,22 @@ void dump_encoders(void)
encoder->possible_clones);
drmModeFreeEncoder(encoder);
}
+ printf("\n");
+}
+
+void dump_mode(struct drm_mode_modeinfo *mode)
+{
+ printf(" %s %.02f %d %d %d %d %d %d %d %d\n",
+ mode->name,
+ (float)mode->vrefresh / 1000,
+ mode->hdisplay,
+ mode->hsync_start,
+ mode->hsync_end,
+ mode->htotal,
+ mode->vdisplay,
+ mode->vsync_start,
+ mode->vsync_end,
+ mode->vtotal);
}
void dump_connectors(void)
@@ -160,24 +176,12 @@ void dump_connectors(void)
printf(" modes:\n");
printf(" name refresh (Hz) hdisp hss hse htot vdisp "
"vss vse vtot)\n");
- for (j = 0; j < connector->count_modes; j++) {
- struct drm_mode_modeinfo *mode;
+ for (j = 0; j < connector->count_modes; j++)
+ dump_mode(&connector->modes[j]);
- mode = &connector->modes[j];
- printf(" %s %.02f %d %d %d %d %d %d %d %d\n",
- mode->name,
- (float)mode->vrefresh / 1000,
- mode->hdisplay,
- mode->hsync_start,
- mode->hsync_end,
- mode->htotal,
- mode->vdisplay,
- mode->vsync_start,
- mode->vsync_end,
- mode->vtotal);
- }
drmModeFreeConnector(connector);
}
+ printf("\n");
}
void dump_crtcs(void)
@@ -185,6 +189,8 @@ void dump_crtcs(void)
drmModeCrtc *crtc;
int i;
+ printf("CRTCs:\n");
+ printf("id\tfb\tpos\tsize\n");
for (i = 0; i < resources->count_crtcs; i++) {
crtc = drmModeGetCrtc(fd, resources->crtcs[i]);
@@ -193,8 +199,16 @@ void dump_crtcs(void)
resources->crtcs[i], strerror(errno));
continue;
}
+ printf("%d\t%d\t(%d,%d)\t(%dx%d)\n",
+ crtc->crtc_id,
+ crtc->buffer_id,
+ crtc->x, crtc->y,
+ crtc->width, crtc->height);
+ dump_mode(&crtc->mode);
+
drmModeFreeCrtc(crtc);
}
+ printf("\n");
}
void dump_framebuffers(void)
@@ -202,6 +216,8 @@ void dump_framebuffers(void)
drmModeFB *fb;
int i;
+ printf("Frame buffers:\n");
+ printf("id\tsize\tpitch\n");
for (i = 0; i < resources->count_fbs; i++) {
fb = drmModeGetFB(fd, resources->fbs[i]);
@@ -210,8 +226,13 @@ void dump_framebuffers(void)
resources->fbs[i], strerror(errno));
continue;
}
+ printf("%d\t(%dx%d)\t%d\n",
+ fb->fb_id,
+ fb->width, fb->height);
+
drmModeFreeFB(fb);
}
+ printf("\n");
}
/*