]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/vermilion/vermilion.c
Merge branch 'for-linus' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / drivers / video / vermilion / vermilion.c
index de531c907718945e9e2fe14bd94098f4f3bd5765..2aa71eb67c2bb048f5f80c29951cf24648dfb88c 100644 (file)
@@ -23,8 +23,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *
  * Authors:
- *   Thomas Hellström <thomas-at-tungstengraphics-dot-com>
- *   Michel Dänzer <michel-at-tungstengraphics-dot-com>
+ *   Thomas Hellström <thomas-at-tungstengraphics-dot-com>
+ *   Michel Dänzer <michel-at-tungstengraphics-dot-com>
  *   Alan Hourihane <alanh-at-tungstengraphics-dot-com>
  */
 
@@ -39,7 +39,6 @@
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <linux/mmzone.h>
-#include <asm/uaccess.h>
 
 /* #define VERMILION_DEBUG */
 
@@ -89,9 +88,7 @@ static int vmlfb_alloc_vram_area(struct vram_area *va, unsigned max_order,
 {
        gfp_t flags;
        unsigned long i;
-       pgprot_t wc_pageprot;
 
-       wc_pageprot = PAGE_KERNEL_NOCACHE;
        max_order++;
        do {
                /*
@@ -127,14 +124,8 @@ static int vmlfb_alloc_vram_area(struct vram_area *va, unsigned max_order,
        /*
         * Change caching policy of the linear kernel map to avoid
         * mapping type conflicts with user-space mappings.
-        * The first global_flush_tlb() is really only there to do a global
-        * wbinvd().
         */
-
-       global_flush_tlb();
-       change_page_attr(virt_to_page(va->logical), va->size >> PAGE_SHIFT,
-                        wc_pageprot);
-       global_flush_tlb();
+       set_pages_uc(virt_to_page(va->logical), va->size >> PAGE_SHIFT);
 
        printk(KERN_DEBUG MODULE_NAME
               ": Allocated %ld bytes vram area at 0x%08lx\n",
@@ -158,9 +149,8 @@ static void vmlfb_free_vram_area(struct vram_area *va)
                 * Reset the linear kernel map caching policy.
                 */
 
-               change_page_attr(virt_to_page(va->logical),
-                                va->size >> PAGE_SHIFT, PAGE_KERNEL);
-               global_flush_tlb();
+               set_pages_wb(virt_to_page(va->logical),
+                                va->size >> PAGE_SHIFT);
 
                /*
                 * Decrease the usage count on the pages we've used
@@ -661,7 +651,7 @@ static int vmlfb_check_var_locked(struct fb_var_screeninfo *var,
                return -EINVAL;
        }
 
-       pitch = __ALIGN_MASK((var->xres * var->bits_per_pixel) >> 3, 0x3F);
+       pitch = ALIGN((var->xres * var->bits_per_pixel) >> 3, 0x40);
        mem = pitch * var->yres_virtual;
        if (mem > vinfo->vram_contig_size) {
                return -ENOMEM;
@@ -795,8 +785,7 @@ static int vmlfb_set_par_locked(struct vml_info *vinfo)
        int clock;
 
        vinfo->bytes_per_pixel = var->bits_per_pixel >> 3;
-       vinfo->stride =
-           __ALIGN_MASK(var->xres_virtual * vinfo->bytes_per_pixel, 0x3F);
+       vinfo->stride = ALIGN(var->xres_virtual * vinfo->bytes_per_pixel, 0x40);
        info->fix.line_length = vinfo->stride;
 
        if (!subsys)