aboutsummaryrefslogtreecommitdiffstats
path: root/drmtools.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-05-17 08:02:15 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-05-17 08:02:15 +0200
commitda7f6e48f15a55f65326b1f71a58b4ab31a93a85 (patch)
treed786399d674caf19f8d8b23b146fde6f1b86a16f /drmtools.c
parent454ce362b8c1422d84883313bc2d3ef2d26c72d4 (diff)
downloadfbida-da7f6e48f15a55f65326b1f71a58b4ab31a93a85.tar.gz
fix drm_info() segfault (fbi -i)
Diffstat (limited to 'drmtools.c')
-rw-r--r--drmtools.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drmtools.c b/drmtools.c
index dee8150..df95468 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -292,24 +292,24 @@ void drm_info(const char *device)
conn = drmModeGetConnector(drm_fd, res->connectors[i]);
if (!conn)
continue;
- if (!drm_conn->count_encoders)
+ if (!conn->count_encoders)
return;
drm_conn_name(conn, name, sizeof(name));
enc = NULL;
crtc = NULL;
- if (drm_conn->encoder_id) {
- enc = drmModeGetEncoder(drm_fd, drm_conn->encoder_id);
+ if (conn->encoder_id) {
+ enc = drmModeGetEncoder(drm_fd, conn->encoder_id);
if (enc && enc->crtc_id) {
crtc = drmModeGetCrtc(drm_fd, enc->crtc_id);
}
}
- if (drm_conn->connection == DRM_MODE_CONNECTED && crtc) {
- fprintf(stdout, " %s, connected, %dx%d\n", name,
+ if (conn->connection == DRM_MODE_CONNECTED && crtc) {
+ fprintf(stdout, " %-10s: %dx%d\n", name,
crtc->width, crtc->height);
} else {
- fprintf(stdout, " %s, disconnected\n", name);
+ fprintf(stdout, " %-10s: disconnected\n", name);
}
drmModeFreeCrtc(crtc);