summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2007-11-28 15:18:25 +1000
committerDave Airlie <airlied@redhat.com>2007-12-03 15:30:05 +1000
commit91cd3e3c097d581ea75ec4bcbc1ba8d23b471a2e (patch)
treed8688a8e5e97345d5c465a3c68591fc28765f256 /tests
parent617cbeed2ae71c5560f597db49637df10edd8a52 (diff)
modesetting API change for removing mode ids and making modes per output.
so really want to get a list of modes per output not the global hammer list. also we remove the mode ids and let the user pass back the full mode description need to fix up add/remove mode for user modes now
Diffstat (limited to 'tests')
-rw-r--r--tests/mode/modetest.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/tests/mode/modetest.c b/tests/mode/modetest.c
index 50271af9..2871fde4 100644
--- a/tests/mode/modetest.c
+++ b/tests/mode/modetest.c
@@ -20,20 +20,9 @@ const char* getConnectionText(drmModeConnection conn)
}
-struct drm_mode_modeinfo* findMode(drmModeResPtr res, uint32_t id)
-{
- int i;
- for (i = 0; i < res->count_modes; i++) {
- if (res->modes[i].id == id)
- return &res->modes[i];
- }
-
- return 0;
-}
-
int printMode(struct drm_mode_modeinfo *mode)
{
-#if 0
+#if 1
printf("Mode: %s\n", mode->name);
printf("\tclock : %i\n", mode->clock);
printf("\thdisplay : %i\n", mode->hdisplay);
@@ -49,7 +38,7 @@ int printMode(struct drm_mode_modeinfo *mode)
printf("\tvrefresh : %i\n", mode->vrefresh);
printf("\tflags : %i\n", mode->flags);
#else
- printf("Mode: %i \"%s\" %ix%i %.0f\n", mode->id, mode->name,
+ printf("Mode: \"%s\" %ix%i %.0f\n", mode->name,
mode->hdisplay, mode->vdisplay, mode->vrefresh / 1000.0);
#endif
return 0;
@@ -104,11 +93,9 @@ int printOutput(int fd, drmModeResPtr res, drmModeOutputPtr output, uint32_t id)
}
for (i = 0; i < output->count_modes; i++) {
- mode = findMode(res, output->modes[i]);
-
+ mode = &output->modes[i];
if (mode)
- printf("\t\tmode: %i \"%s\" %ix%i %.0f\n", mode->id, mode->name,
- mode->hdisplay, mode->vdisplay, mode->vrefresh / 1000.0);
+ printMode(mode);
else
printf("\t\tmode: Invalid mode %i\n", output->modes[i]);
}
@@ -154,10 +141,6 @@ int printRes(int fd, drmModeResPtr res)
drmModeCrtcPtr crtc;
drmModeFBPtr fb;
- for (i = 0; i < res->count_modes; i++) {
- printMode(&res->modes[i]);
- }
-
for (i = 0; i < res->count_outputs; i++) {
output = drmModeGetOutput(fd, res->outputs[i]);
@@ -218,6 +201,7 @@ int testMode(int fd, drmModeResPtr res)
int ret = 0;
int error = 0;
+#if 0
printf("Test: adding mode to output %i\n", output);
/* printMode(&mode); */
@@ -255,7 +239,7 @@ err:
if (error)
printf("\tFailed to delete mode %i\n", newMode);
-
+#endif
return 1;
}