ACPI: EC: Don't trust ECDT tables from ASUS
[safe/jmp/linux-2.6] / drivers / video / atafb.c
index 0038a05..77eb8b3 100644 (file)
@@ -58,7 +58,7 @@
 #include <linux/interrupt.h>
 
 #include <asm/setup.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/irq.h>
 #include <asm/io.h>
@@ -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);