From c5168016cc028f59b417df77f1f169bf06e40271 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 12 Sep 2003 20:00:59 +0000 Subject: [PATCH] linux drm fixes --- libdrm/xf86drm.c | 2 +- libdrm/xf86drmCompat.c | 2 +- linux-core/Makefile.kernel | 2 +- linux-core/ati_pcigart.c | 2 +- linux-core/drm_vm.c | 4 ++-- linux/Makefile.kernel | 2 +- linux/Makefile.linux | 9 ++++++++- linux/ati_pcigart.h | 2 +- linux/drm_vm.h | 4 ++-- 9 files changed, 18 insertions(+), 11 deletions(-) diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 75a9082..6d5f4a6 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -31,7 +31,7 @@ * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.31 2003/02/04 03:01:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.36 2003/08/24 17:35:35 tsi Exp $ */ #ifdef XFree86Server # include "xf86.h" diff --git a/libdrm/xf86drmCompat.c b/libdrm/xf86drmCompat.c index 4e3ccf3..9263ec4 100644 --- a/libdrm/xf86drmCompat.c +++ b/libdrm/xf86drmCompat.c @@ -26,7 +26,7 @@ * Jens Owen * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.4 2001/08/27 17:40:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c,v 1.1 2002/10/30 12:52:33 alanh Exp $ */ #ifdef XFree86Server # include "xf86.h" diff --git a/linux-core/Makefile.kernel b/linux-core/Makefile.kernel index e5abd4d..fb39e63 100644 --- a/linux-core/Makefile.kernel +++ b/linux-core/Makefile.kernel @@ -4,7 +4,7 @@ # # Based on David Woodhouse's mtd build. # -# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.17 2003/04/12 17:18:17 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.18 2003/08/16 17:59:17 dawes Exp $ # gamma-objs := gamma_drv.o gamma_dma.o diff --git a/linux-core/ati_pcigart.c b/linux-core/ati_pcigart.c index 42233ff..221ceb6 100644 --- a/linux-core/ati_pcigart.c +++ b/linux-core/ati_pcigart.c @@ -158,7 +158,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev, ret = 1; -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__AMD64__) asm volatile ( "wbinvd" ::: "memory" ); #else mb(); diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 29cad56..8f4679f 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -511,7 +511,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) { vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE); -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__AMD64__) pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW; #else /* Ye gads this is ugly. With more thought @@ -542,7 +542,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) case _DRM_FRAME_BUFFER: case _DRM_REGISTERS: if (VM_OFFSET(vma) >= __pa(high_memory)) { -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__AMD64__) if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) { pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT; diff --git a/linux/Makefile.kernel b/linux/Makefile.kernel index e5abd4d..fb39e63 100644 --- a/linux/Makefile.kernel +++ b/linux/Makefile.kernel @@ -4,7 +4,7 @@ # # Based on David Woodhouse's mtd build. # -# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.17 2003/04/12 17:18:17 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.18 2003/08/16 17:59:17 dawes Exp $ # gamma-objs := gamma_drv.o gamma_dma.o diff --git a/linux/Makefile.linux b/linux/Makefile.linux index 9de6766..12e0e8c 100644 --- a/linux/Makefile.linux +++ b/linux/Makefile.linux @@ -11,7 +11,7 @@ # everything required for in-kernel source builds. It is included into # this file, so none of that should be duplicated here. # -# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.37 2003/04/23 01:48:57 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.40 2003/08/17 17:12:25 dawes Exp $ # # @@ -48,6 +48,7 @@ MODULE_LIST := gamma.o tdfx.o r128.o radeon.o mga.o sis.o # Modules only for ix86 architectures ifneq (,$(findstring 86,$(MACHINE))) +ARCHX86 := 1 MODULE_LIST += i830.o i810.o endif @@ -258,6 +259,12 @@ $(error Only 2.4.x and later kernels are supported \ ($(VERSION).$(PATCHLEVEL).$(SUBLEVEL))) endif +ifdef ARCHX86 +ifndef CONFIG_X86_CMPXCHG +$(error CONFIG_X86_CMPXCHG needs to be enabled in the kernel) +endif +endif + # This needs to go before all other include paths. CC += -I$(DRMSRCDIR) diff --git a/linux/ati_pcigart.h b/linux/ati_pcigart.h index 42233ff..221ceb6 100644 --- a/linux/ati_pcigart.h +++ b/linux/ati_pcigart.h @@ -158,7 +158,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev, ret = 1; -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__AMD64__) asm volatile ( "wbinvd" ::: "memory" ); #else mb(); diff --git a/linux/drm_vm.h b/linux/drm_vm.h index 29cad56..8f4679f 100644 --- a/linux/drm_vm.h +++ b/linux/drm_vm.h @@ -511,7 +511,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) { vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE); -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__AMD64__) pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW; #else /* Ye gads this is ugly. With more thought @@ -542,7 +542,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) case _DRM_FRAME_BUFFER: case _DRM_REGISTERS: if (VM_OFFSET(vma) >= __pa(high_memory)) { -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__AMD64__) if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) { pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT; -- 2.7.4