aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark2012-10-14 16:55:32 -0500
committerRob Clark2012-10-14 16:56:53 -0500
commite81acf51013d5d4245417c46ee6b4055c26f1a91 (patch)
treef87fe5b7dbe27d857aaeac2a6eeebab49dbab8e3 /xf86drmMode.c
parent844d75e5a0b3b8f3466a24256955e886275fb298 (diff)
downloadlibdrm-e81acf51013d5d4245417c46ee6b4055c26f1a91.tar.gz
libdrm-e81acf51013d5d4245417c46ee6b4055c26f1a91.tar.xz
libdrm-e81acf51013d5d4245417c46ee6b4055c26f1a91.zip
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 <rob@ti.com>
Diffstat (limited to 'xf86drmMode.c')
-rw-r--r--xf86drmMode.c5
1 files changed, 4 insertions, 1 deletions
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)
351 r->x = crtc.x; 351 r->x = crtc.x;
352 r->y = crtc.y; 352 r->y = crtc.y;
353 r->mode_valid = crtc.mode_valid; 353 r->mode_valid = crtc.mode_valid;
354 if (r->mode_valid) 354 if (r->mode_valid) {
355 memcpy(&r->mode, &crtc.mode, sizeof(struct drm_mode_modeinfo)); 355 memcpy(&r->mode, &crtc.mode, sizeof(struct drm_mode_modeinfo));
356 r->width = crtc.mode.hdisplay;
357 r->height = crtc.mode.vdisplay;
358 }
356 r->buffer_id = crtc.fb_id; 359 r->buffer_id = crtc.fb_id;
357 r->gamma_size = crtc.gamma_size; 360 r->gamma_size = crtc.gamma_size;
358 return r; 361 return r;