]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/fbmem.c
[PATCH] md: tidyup some issues with raid1 resync and prepare for catching read errors
[linux-2.6-omap-h63xx.git] / drivers / video / fbmem.c
index 9f180096c896f6330678adc74c78316aef458b0e..10dfdf0352644d296247f3a18f17c3302f615189 100644 (file)
@@ -452,13 +452,17 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
 
        /* Return if no suitable logo was found */
        fb_logo.logo = fb_find_logo(depth);
+
+       if (!fb_logo.logo) {
+               return 0;
+       }
        
        if (rotate == FB_ROTATE_UR || rotate == FB_ROTATE_UD)
                yres = info->var.yres;
        else
                yres = info->var.xres;
 
-       if (fb_logo.logo && fb_logo.logo->height > yres) {
+       if (fb_logo.logo->height > yres) {
                fb_logo.logo = NULL;
                return 0;
        }
@@ -718,14 +722,30 @@ static void try_to_load(int fb)
 int
 fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
 {
+       struct fb_fix_screeninfo *fix = &info->fix;
         int xoffset = var->xoffset;
         int yoffset = var->yoffset;
-        int err;
+        int err = 0, yres = info->var.yres;
+
+       if (var->yoffset > 0) {
+               if (var->vmode & FB_VMODE_YWRAP) {
+                       if (!fix->ywrapstep || (var->yoffset % fix->ywrapstep))
+                               err = -EINVAL;
+                       else
+                               yres = 0;
+               } else if (!fix->ypanstep || (var->yoffset % fix->ypanstep))
+                       err = -EINVAL;
+       }
+
+       if (var->xoffset > 0 && (!fix->xpanstep ||
+                                (var->xoffset % fix->xpanstep)))
+               err = -EINVAL;
+
+        if (err || !info->fbops->fb_pan_display || xoffset < 0 ||
+           yoffset < 0 || var->yoffset + yres > info->var.yres_virtual ||
+           var->xoffset + info->var.xres > info->var.xres_virtual)
+               return -EINVAL;
 
-        if (xoffset < 0 || yoffset < 0 || !info->fbops->fb_pan_display ||
-            xoffset + info->var.xres > info->var.xres_virtual ||
-            yoffset + info->var.yres > info->var.yres_virtual)
-                return -EINVAL;
        if ((err = info->fbops->fb_pan_display(var, info)))
                return err;
         info->var.xoffset = var->xoffset;