diff options
author | Dave Airlie <airlied@redhat.com> | 2010-01-08 09:27:08 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-11 14:36:09 +1000 |
commit | 509c7d83c3b18a50a0bd02afa43c8ee3c7605bc9 (patch) | |
tree | 3fe1ad92723491907bb4d39d9c392ec8f228dd9c /drivers | |
parent | 89347bb8ef2d0af1ae8d847b7df91e9f04eccf2a (diff) | |
download | linux-509c7d83c3b18a50a0bd02afa43c8ee3c7605bc9.tar.bz2 |
drm/kms/fb: check for depth changes from userspace for resizing.
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 100ee48760b7..1c2b7d44ec05 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -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; } |