From e81acf51013d5d4245417c46ee6b4055c26f1a91 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 14 Oct 2012 16:55:32 -0500 Subject: [PATCH] initialize width/height fields in drmModeCrtc If we have valid timings, we can at least set width/height to *something*, which is I think at least less confusing than always seeing width/height of zero. At least modeprint and modetest seem to expect width/height to mean something. Signed-off-by: Rob Clark --- xf86drmMode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xf86drmMode.c b/xf86drmMode.c index 04fdf1ff..f603ceb2 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -351,8 +351,11 @@ drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId) r->x = crtc.x; r->y = crtc.y; r->mode_valid = crtc.mode_valid; - if (r->mode_valid) + if (r->mode_valid) { memcpy(&r->mode, &crtc.mode, sizeof(struct drm_mode_modeinfo)); + r->width = crtc.mode.hdisplay; + r->height = crtc.mode.vdisplay; + } r->buffer_id = crtc.fb_id; r->gamma_size = crtc.gamma_size; return r;