]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/kms/fb: check for depth changes from userspace for resizing.
authorDave Airlie <airlied@redhat.com>
Thu, 7 Jan 2010 23:27:08 +0000 (09:27 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 8 Jan 2010 03:18:19 +0000 (13:18 +1000)
If userspace (plymouth in this case) asks for a deeper depth,
refuse it as well due to lack of resizing.

This fixes an issue since < 32MB cards went to 8bpp and plymouth
crashes on startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_fb_helper.c

index 100ee48760b7a0b320b8dd8f0047b848e8f006ce..1c2b7d44ec05c90bb295e35448b97c3cbda02a6f 100644 (file)
@@ -606,11 +606,10 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
                return -EINVAL;
 
        /* Need to resize the fb object !!! */
-       if (var->xres > fb->width || var->yres > fb->height) {
-               DRM_ERROR("Requested width/height is greater than current fb "
-                          "object %dx%d > %dx%d\n", var->xres, var->yres,
-                          fb->width, fb->height);
-               DRM_ERROR("Need resizing code.\n");
+       if (var->bits_per_pixel > fb->bits_per_pixel || var->xres > fb->width || var->yres > fb->height) {
+               DRM_DEBUG("fb userspace requested width/height/bpp is greater than current fb "
+                         "object %dx%d-%d > %dx%d-%d\n", var->xres, var->yres, var->bits_per_pixel,
+                         fb->width, fb->height, fb->bits_per_pixel);
                return -EINVAL;
        }