diff options
author | Gabriel Laskar <gabriel@lse.epita.fr> | 2014-11-04 15:12:07 +0100 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-11-04 17:10:13 -0500 |
commit | 4b9e31deeb184d028e95b26f5375e96ccdd17130 (patch) | |
tree | b5322b8005aad3d8f948ca8a541b497903b2bc4a /kmscube.c | |
parent | cdcfc7b4959542e7095e56353906d03f4be49a1c (diff) | |
download | kmscube-4b9e31deeb184d028e95b26f5375e96ccdd17130.tar.gz |
Prefer mode of type "DRM_MODE_TYPE_PREFERED"
On screen with native resolution of 1440x900, there is sometime a
compatibility mode for 1280x1024, with shrinked output and vertical
bands to maintain ratio. If we select the resolution with the
higher area, we select the compatibility mode and not the native
resolution.
When using mode_type == DRM_MODE_TYPE_PREFERED, we avoid that issue.
Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Diffstat (limited to 'kmscube.c')
-rw-r--r-- | kmscube.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -121,9 +121,14 @@ static int init_drm(void) return -1; } - /* find highest resolution mode: */ + /* find prefered mode or the highest resolution mode: */ for (i = 0, area = 0; i < connector->count_modes; i++) { drmModeModeInfo *current_mode = &connector->modes[i]; + + if (current_mode->type & DRM_MODE_TYPE_PREFERRED) { + drm.mode = current_mode; + } + int current_area = current_mode->hdisplay * current_mode->vdisplay; if (current_area > area) { drm.mode = current_mode; |