pm3fb: 3 small fixes
authorKrzysztof Helt <krzysztof.h1@wp.pl>
Tue, 16 Oct 2007 08:28:32 +0000 (01:28 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:14 +0000 (09:43 -0700)
This patch contains 3 small improvements:
- it corrects scan line width calculation in pm3fb_imageblit()
- it corrects mmio mapping for big endian machines
- it enables panning acceleration constants

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/pm3fb.c

index 280d108f18d1627c1cb985b71ffa98e8a2a2265a..fb91b641aefe06caf16d0c488d352a3b74c789f7 100644 (file)
@@ -558,7 +558,8 @@ static void pm3fb_imageblit(struct fb_info *info, const struct fb_image *image)
 
 
        while (height--) {
-               int width = ((image->width + 7) >> 3) + info->pixmap.scan_align;
+               int width = ((image->width + 7) >> 3)
+                               + info->pixmap.scan_align - 1;
                width >>= 2;
 
                while (width >= PM3_FIFO_SIZE) {
@@ -1194,6 +1195,10 @@ static int __devinit pm3fb_probe(struct pci_dev *dev,
         */
        pm3fb_fix.mmio_start = pci_resource_start(dev, 0);
        pm3fb_fix.mmio_len = PM3_REGS_SIZE;
+#if defined(__BIG_ENDIAN)
+       pm3fb_fix.mmio_start += PM3_REGS_SIZE;
+       DPRINTK("Adjusting register base for big-endian.\n");
+#endif
 
        /* Registers - request region and map it. */
        if (!request_mem_region(pm3fb_fix.mmio_start, pm3fb_fix.mmio_len,
@@ -1210,10 +1215,6 @@ static int __devinit pm3fb_probe(struct pci_dev *dev,
                goto err_exit_neither;
        }
 
-#if defined(__BIG_ENDIAN)
-       pm3fb_fix.mmio_start += PM3_REGS_SIZE;
-       DPRINTK("Adjusting register base for big-endian.\n");
-#endif
        /* Linear frame buffer - request region and map it. */
        pm3fb_fix.smem_start = pci_resource_start(dev, 1);
        pm3fb_fix.smem_len = pm3fb_size_memory(par);
@@ -1243,7 +1244,8 @@ static int __devinit pm3fb_probe(struct pci_dev *dev,
        info->fix = pm3fb_fix;
        info->pseudo_palette = par->palette;
        info->flags = FBINFO_DEFAULT |
-/*                     FBINFO_HWACCEL_YPAN |*/
+                       FBINFO_HWACCEL_XPAN |
+                       FBINFO_HWACCEL_YPAN |
                        FBINFO_HWACCEL_COPYAREA |
                        FBINFO_HWACCEL_IMAGEBLIT |
                        FBINFO_HWACCEL_FILLRECT;