]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/atafb.c
Merge commit 'jk/jk-merge'
[linux-2.6-omap-h63xx.git] / drivers / video / atafb.c
index 5d4fbaa53a6cefd6fc69a9676987c77de7f5b732..77eb8b34fbfaee0e478ce39eef506dd605826212 100644 (file)
@@ -1270,7 +1270,7 @@ again:
 
        gstart = (prescale / 2 + plen * left_margin) / prescale;
        /* gend1 is for hde (gend-gstart multiple of align), shifter's xres */
-       gend1 = gstart + ((xres + align - 1) / align) * align * plen / prescale;
+       gend1 = gstart + roundup(xres, align) * plen / prescale;
        /* gend2 is for hbb, visible xres (rest to gend1 is cut off by hblank) */
        gend2 = gstart + xres * plen / prescale;
        par->HHT = plen * (left_margin + xres + right_margin) /
@@ -2593,13 +2593,16 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
        width = x2 - dx;
        height = y2 - dy;
 
+       if (area->sx + dx < area->dx || area->sy + dy < area->dy)
+               return;
+
        /* update sx,sy */
        sx = area->sx + (dx - area->dx);
        sy = area->sy + (dy - area->dy);
 
        /* the source must be completely inside the virtual screen */
-       if (sx < 0 || sy < 0 || (sx + width) > info->var.xres_virtual ||
-           (sy + height) > info->var.yres_virtual)
+       if (sx + width > info->var.xres_virtual ||
+                       sy + height > info->var.yres_virtual)
                return;
 
        if (dy > sy || (dy == sy && dx > sx)) {
@@ -3110,7 +3113,7 @@ int __init atafb_init(void)
        printk("atafb_init: start\n");
 
        if (!MACH_IS_ATARI)
-               return -ENXIO;
+               return -ENODEV;
 
        do {
 #ifdef ATAFB_EXT
@@ -3230,6 +3233,9 @@ int __init atafb_init(void)
                return -EINVAL;
        }
 
+       fb_videomode_to_modelist(atafb_modedb, NUM_TOTAL_MODES,
+                                &fb_info.modelist);
+
        atafb_set_disp(&fb_info);
 
        fb_alloc_cmap(&(fb_info.cmap), 1 << fb_info.var.bits_per_pixel, 0);