drm/udl: limit modes to the sku pixel limits.
authorDave Airlie <airlied@redhat.com>
Tue, 25 Sep 2012 06:17:43 +0000 (16:17 +1000)
committerDave Airlie <airlied@gmail.com>
Wed, 26 Sep 2012 08:40:21 +0000 (18:40 +1000)
Otherwise when X starts we commonly get a black screen scanning
out nothing, its wierd dpms on/off from userspace brings it back,

With this on F18, multi-seat works again with my 1920x1200 monitor
which is above the sku limit for the device I have.

Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/udl/udl_connector.c

index ba055e9ca0077875a3a49d3533d729a95ccf98fd..8d9dc44f1f94f56c32234fdb527576f7817433ad 100644 (file)
@@ -69,6 +69,13 @@ static int udl_get_modes(struct drm_connector *connector)
 static int udl_mode_valid(struct drm_connector *connector,
                          struct drm_display_mode *mode)
 {
+       struct udl_device *udl = connector->dev->dev_private;
+       if (!udl->sku_pixel_limit)
+               return 0;
+
+       if (mode->vdisplay * mode->hdisplay > udl->sku_pixel_limit)
+               return MODE_VIRTUAL_Y;
+
        return 0;
 }