diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-05-17 08:02:15 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-05-17 08:02:15 +0200 |
commit | da7f6e48f15a55f65326b1f71a58b4ab31a93a85 (patch) | |
tree | d786399d674caf19f8d8b23b146fde6f1b86a16f /drmtools.c | |
parent | 454ce362b8c1422d84883313bc2d3ef2d26c72d4 (diff) | |
download | fbida-da7f6e48f15a55f65326b1f71a58b4ab31a93a85.tar.gz |
fix drm_info() segfault (fbi -i)
Diffstat (limited to 'drmtools.c')
-rw-r--r-- | drmtools.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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); |