qxl: Allow resolution which are not multiple of 8
authorChristophe Fergeau <cfergeau@redhat.com>
Tue, 8 Nov 2016 09:12:09 +0000 (10:12 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 15 Nov 2016 08:45:33 +0000 (09:45 +0100)
The use of drm_cvt_mode() in qxl_add_monitors_config_modes() means that
the resolutions we are going to present to user-space are going to be
rounded down to a multiple of 8. In the QXL arbitrary resolution case,
this is not useful.
This commit forces the actual width/height that was requested by the
client in the drm_display_mode structure rather than keeping the
rounded version.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Message-id: 20161108091209.25568-8-cfergeau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/qxl/qxl_display.c

index eaea0d87cc9476d1210e7d1871edd254081178f9..4b5eab8a47b3edfc9a0cf2cc1a4aabc04c9bac9a 100644 (file)
@@ -199,6 +199,9 @@ static int qxl_add_monitors_config_modes(struct drm_connector *connector,
        mode = drm_cvt_mode(dev, head->width, head->height, 60, false, false,
                            false);
        mode->type |= DRM_MODE_TYPE_PREFERRED;
+       mode->hdisplay = head->width;
+       mode->vdisplay = head->height;
+       drm_mode_set_name(mode);
        *pwidth = head->width;
        *pheight = head->height;
        drm_mode_probed_add(connector, mode);