Skip to contentSkip to conversation

initialize width/height fields in drmModeCrtc

PATCH New Rob Clark 1 participant 1 message Oct 14, 2012

lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 initialize width/height fields in drmModeCrtc

From: Rob Clark <[email protected]>

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.

---
 xf86drmMode.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
xf86drmMode.c +4 -1
index 04fdf1f..f603ceb 100644
@@ -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;
Signature · 1 line
1.7.9.5