]> Git Repo - linux.git/commitdiff
Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6
authorPaul Mundt <[email protected]>
Thu, 21 Jul 2011 06:21:51 +0000 (15:21 +0900)
committerPaul Mundt <[email protected]>
Thu, 21 Jul 2011 06:21:51 +0000 (15:21 +0900)
1  2 
drivers/video/via/viafbdev.c

index cf43c80d27f6e47659d3add9aac2c22c2bc02e36,bddae58ecd8a5aece7130b3fbfe33da7bdba88d2..dd1276e886f3ceb942b40fe545c1d8092f955d4f
@@@ -151,7 -151,8 +151,8 @@@ static void viafb_update_fix(struct fb_
  
        info->fix.visual =
                bpp == 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
-       info->fix.line_length = (info->var.xres_virtual * bpp / 8 + 7) & ~7;
+       info->fix.line_length = ALIGN(info->var.xres_virtual * bpp / 8,
+               VIA_PITCH_SIZE);
  }
  
  static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix,
@@@ -238,8 -239,12 +239,12 @@@ static int viafb_check_var(struct fb_va
                depth = 24;
  
        viafb_fill_var_color_info(var, depth);
-       line = (var->xres_virtual * var->bits_per_pixel / 8 + 7) & ~7;
-       if (line * var->yres_virtual > ppar->memsize)
+       if (var->xres_virtual < var->xres)
+               var->xres_virtual = var->xres;
+       line = ALIGN(var->xres_virtual * var->bits_per_pixel / 8,
+               VIA_PITCH_SIZE);
+       if (line > VIA_PITCH_MAX || line * var->yres_virtual > ppar->memsize)
                return -EINVAL;
  
        /* Based on var passed in to calculate the refresh,
@@@ -348,8 -353,9 +353,9 @@@ static int viafb_pan_display(struct fb_
        struct fb_info *info)
  {
        struct viafb_par *viapar = info->par;
-       u32 vram_addr = (var->yoffset * var->xres_virtual + var->xoffset)
-               * (var->bits_per_pixel / 8) + viapar->vram_addr;
+       u32 vram_addr = viapar->vram_addr
+               + var->yoffset * info->fix.line_length
+               + var->xoffset * info->var.bits_per_pixel / 8;
  
        DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr);
        if (!viafb_dual_fb) {
@@@ -2037,7 -2043,7 +2043,7 @@@ int __init viafb_init(void
                return -EINVAL;
  
        printk(KERN_INFO
 -       "VIA Graphics Intergration Chipset framebuffer %d.%d initializing\n",
 +       "VIA Graphics Integration Chipset framebuffer %d.%d initializing\n",
               VERSION_MAJOR, VERSION_MINOR);
        return 0;
  }
This page took 0.052422 seconds and 4 git commands to generate.