[patch 05/11] PAT x86: drm driver changes for PAT
From: venkatesh . pallipadi
Date: Thu Jan 10 2008 - 14:14:29 EST
Straight forward port of pat-drivers.patch to x86 tree
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
Signed-off-by: Suresh Siddha <suresh.b.siddha@xxxxxxxxx>
Index: linux-2.6.24-rc/drivers/char/drm/drm_proc.c
===================================================================
--- linux-2.6.24-rc.orig/drivers/char/drm/drm_proc.c
+++ linux-2.6.24-rc/drivers/char/drm/drm_proc.c
@@ -480,7 +480,7 @@ static int drm__vma_info(char *buf, char
int len = 0;
struct drm_vma_entry *pt;
struct vm_area_struct *vma;
-#if defined(__i386__)
+#ifdef CONFIG_X86
unsigned int pgprot;
#endif
@@ -510,13 +510,13 @@ static int drm__vma_info(char *buf, char
vma->vm_flags & VM_IO ? 'i' : '-',
vma->vm_pgoff);
-#if defined(__i386__)
+#ifdef CONFIG_X86
pgprot = pgprot_val(vma->vm_page_prot);
DRM_PROC_PRINT(" %c%c%c%c%c%c%c%c%c",
pgprot & _PAGE_PRESENT ? 'p' : '-',
pgprot & _PAGE_RW ? 'w' : 'r',
pgprot & _PAGE_USER ? 'u' : 's',
- pgprot & _PAGE_PWT ? 't' : 'b',
+ ((pgprot & _PAGE_CACHE_MASK) == _PAGE_WC) ? 'w' : 'b',
pgprot & _PAGE_PCD ? 'u' : 'c',
pgprot & _PAGE_ACCESSED ? 'a' : '-',
pgprot & _PAGE_DIRTY ? 'd' : '-',
Index: linux-2.6.24-rc/drivers/char/drm/drm_vm.c
===================================================================
--- linux-2.6.24-rc.orig/drivers/char/drm/drm_vm.c
+++ linux-2.6.24-rc/drivers/char/drm/drm_vm.c
@@ -45,11 +45,8 @@ static pgprot_t drm_io_prot(uint32_t map
{
pgprot_t tmp = vm_get_page_prot(vma->vm_flags);
-#if defined(__i386__) || defined(__x86_64__)
- if (boot_cpu_data.x86 > 3 && map_type != _DRM_AGP) {
- pgprot_val(tmp) |= _PAGE_PCD;
- pgprot_val(tmp) &= ~_PAGE_PWT;
- }
+#ifdef CONFIG_X86
+ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
#elif defined(__powerpc__)
pgprot_val(tmp) |= _PAGE_NO_CACHE;
if (map_type == _DRM_REGISTERS)
Index: linux-2.6.24-rc/drivers/video/gbefb.c
===================================================================
--- linux-2.6.24-rc.orig/drivers/video/gbefb.c
+++ linux-2.6.24-rc/drivers/video/gbefb.c
@@ -57,7 +57,7 @@ struct gbefb_par {
#endif
#endif
#ifdef CONFIG_X86
-#define pgprot_fb(_prot) ((_prot) | _PAGE_PCD)
+#define pgprot_fb(_prot) pgprot_writecombine(_prot)
#endif
/*
Index: linux-2.6.24-rc/drivers/video/sgivwfb.c
===================================================================
--- linux-2.6.24-rc.orig/drivers/video/sgivwfb.c
+++ linux-2.6.24-rc/drivers/video/sgivwfb.c
@@ -714,8 +714,7 @@ static int sgivwfb_mmap(struct fb_info *
if (offset + size > sgivwfb_mem_size)
return -EINVAL;
offset += sgivwfb_mem_phys;
- pgprot_val(vma->vm_page_prot) =
- pgprot_val(vma->vm_page_prot) | _PAGE_PCD;
+ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
vma->vm_flags |= VM_IO;
if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT,
size, vma->vm_page_prot))
Index: linux-2.6.24-rc/include/asm-x86/fb.h
===================================================================
--- linux-2.6.24-rc.orig/include/asm-x86/fb.h
+++ linux-2.6.24-rc/include/asm-x86/fb.h
@@ -8,8 +8,7 @@
static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
unsigned long off)
{
- if (boot_cpu_data.x86 > 3)
- pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
+ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
}
#ifdef CONFIG_X86_32
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/