modetest: Print names of properties.

main
Kristian Høgsberg 2009-02-23 15:08:03 -05:00
parent 4a0d19ef4f
commit 9fc85b4084
1 changed files with 18 additions and 2 deletions

View File

@ -138,7 +138,7 @@ void dump_encoders(void)
printf("\n");
}
void dump_mode(struct drm_mode_modeinfo *mode)
void dump_mode(drmModeModeInfo *mode)
{
printf(" %s %.02f %d %d %d %d %d %d %d %d\n",
mode->name,
@ -153,6 +153,19 @@ void dump_mode(struct drm_mode_modeinfo *mode)
mode->vtotal);
}
static void
dump_props(drmModeConnector *connector)
{
drmModePropertyPtr props;
int i;
for (i = 0; i < connector->count_props; i++) {
props = drmModeGetProperty(fd, connector->props[i]);
printf("\t%s, flags %d\n", props->name, props->flags);
drmModeFreeProperty(props);
}
}
void dump_connectors(void)
{
drmModeConnector *connector;
@ -187,6 +200,9 @@ void dump_connectors(void)
dump_mode(&connector->modes[j]);
drmModeFreeConnector(connector);
printf(" props:\n");
dump_props(connector);
}
printf("\n");
}
@ -252,7 +268,7 @@ void dump_framebuffers(void)
struct connector {
int id;
char mode_str[64];
struct drm_mode_modeinfo *mode;
drmModeModeInfo *mode;
drmModeEncoder *encoder;
int crtc;
};