View | Details | Raw Unified | Return to bug 115800
Collapse All | Expand All

(-)NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv-linux.h (-6 / +18 lines)
Lines 118-123 Link Here
118
#define AGPGART
118
#define AGPGART
119
#include <linux/agp_backend.h>
119
#include <linux/agp_backend.h>
120
#include <linux/agpgart.h>
120
#include <linux/agpgart.h>
121
#include <asm/agp.h>
122
#endif
123
#ifndef phys_to_gart
124
#define phys_to_gart(x) virt_to_bus(phys_to_virt(x))
125
#define gart_to_phys(x) virt_to_phys(bus_to_virt(x))
126
#define virt_to_gart(x) virt_to_bus(x)
127
#define gart_to_virt(x) bus_to_virt(x)
128
#else
129
#ifndef virt_to_gart
130
#define virt_to_gart(x) (phys_to_gart(virt_to_phys(x)))
131
#define gart_to_virt(x) (phys_to_virt(gart_to_phys(x)))
132
#endif
121
#endif
133
#endif
122
134
123
#if defined(NVCPU_X86) || defined(NVCPU_X86_64)
135
#if defined(NVCPU_X86) || defined(NVCPU_X86_64)
Lines 637-650 typedef void irqreturn_t; Link Here
637
649
638
#if defined(NV_REMAP_PFN_RANGE_PRESENT)
650
#if defined(NV_REMAP_PFN_RANGE_PRESENT)
639
#define NV_REMAP_PAGE_RANGE(from, offset, x...) \
651
#define NV_REMAP_PAGE_RANGE(from, offset, x...) \
640
     remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x)
652
     io_remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x)
641
#elif defined(NV_REMAP_PAGE_RANGE_5_PRESENT)
653
#elif defined(NV_REMAP_PAGE_RANGE_5_PRESENT)
642
#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(vma, x)
654
#define NV_REMAP_PAGE_RANGE(x...) io_remap_page_range(vma, x)
643
#elif defined(NV_REMAP_PAGE_RANGE_4_PRESENT)
655
#elif defined(NV_REMAP_PAGE_RANGE_4_PRESENT)
644
#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(x)
656
#define NV_REMAP_PAGE_RANGE(x...) io_remap_page_range(x)
645
#else
657
#else
646
#warning "conftest.sh failed, assuming remap_page_range(4)!"
658
#warning "conftest.sh failed, assuming remap_page_range(4)!"
647
#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(x)
659
#define NV_REMAP_PAGE_RANGE(x...) io_remap_page_range(x)
648
#endif
660
#endif
649
661
650
662
Lines 1054-1060 static inline int nv_sg_map_buffer( Link Here
1054
    sg_ptr->offset = (unsigned long)base & ~PAGE_MASK;
1066
    sg_ptr->offset = (unsigned long)base & ~PAGE_MASK;
1055
    sg_ptr->length  = num_pages * PAGE_SIZE;
1067
    sg_ptr->length  = num_pages * PAGE_SIZE;
1056
1068
1057
    if (virt_to_phys(base) & ~dev->dma_mask)
1069
    if (virt_to_gart(base) & ~dev->dma_mask)
1058
    {
1070
    {
1059
        if (nv_remap_count + sg_ptr->length > nv_remap_limit)
1071
        if (nv_remap_count + sg_ptr->length > nv_remap_limit)
1060
        {
1072
        {
Lines 1135-1141 static inline int nv_sg_load( Link Here
1135
        page_ptr->orig_phys_addr = page_ptr->phys_addr;
1147
        page_ptr->orig_phys_addr = page_ptr->phys_addr;
1136
        page_ptr->phys_addr      = page_ptr->dma_addr;
1148
        page_ptr->phys_addr      = page_ptr->dma_addr;
1137
        page_ptr->orig_virt_addr = page_ptr->virt_addr;
1149
        page_ptr->orig_virt_addr = page_ptr->virt_addr;
1138
        page_ptr->virt_addr      = (unsigned long) __va(page_ptr->dma_addr);
1150
        page_ptr->virt_addr      = gart_to_virt(page_ptr->dma_addr);
1139
    }
1151
    }
1140
#endif
1152
#endif
1141
1153
(-)NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv-vm.c (-2 / +3 lines)
Lines 151-157 int nv_vm_malloc_pages( Link Here
151
    /* point page_ptr at the start of the actual page list */
151
    /* point page_ptr at the start of the actual page list */
152
    nv_pte_t *page_ptr = *at->page_table;
152
    nv_pte_t *page_ptr = *at->page_table;
153
    unsigned int i, j;
153
    unsigned int i, j;
154
    unsigned long virt_addr = 0, phys_addr;
154
    unsigned long virt_addr = 0, phys_addr, gart_addr;
155
#if defined(NV_SG_MAP_BUFFERS)
155
#if defined(NV_SG_MAP_BUFFERS)
156
    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
156
    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
157
    struct pci_dev *dev = nvl->dev;
157
    struct pci_dev *dev = nvl->dev;
Lines 238-243 int nv_vm_malloc_pages( Link Here
238
        }
238
        }
239
239
240
        phys_addr = nv_get_kern_phys_address(virt_addr);
240
        phys_addr = nv_get_kern_phys_address(virt_addr);
241
        gart_addr = phys_to_gart(phys_addr);
241
        if (phys_addr == 0)
242
        if (phys_addr == 0)
242
        {
243
        {
243
            nv_printf(NV_DBG_ERRORS,
244
            nv_printf(NV_DBG_ERRORS,
Lines 251-257 int nv_vm_malloc_pages( Link Here
251
        page_ptr = at->page_table[i];
252
        page_ptr = at->page_table[i];
252
        page_ptr->phys_addr = phys_addr;
253
        page_ptr->phys_addr = phys_addr;
253
        page_ptr->virt_addr = virt_addr;
254
        page_ptr->virt_addr = virt_addr;
254
        page_ptr->dma_addr = page_ptr->phys_addr;
255
        page_ptr->dma_addr = gart_addr;
255
256
256
#if defined(NV_SG_MAP_BUFFERS)
257
#if defined(NV_SG_MAP_BUFFERS)
257
        if (!NV_ALLOC_MAPPING_CONTIG(at->flags))
258
        if (!NV_ALLOC_MAPPING_CONTIG(at->flags))
(-)NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv.c (+15 lines)
Lines 35-41 static struct pm_dev *apm_nv_dev[NV_MAX_ Link Here
35
35
36
int nv_pat_enabled = 0;
36
int nv_pat_enabled = 0;
37
37
38
#ifdef CONFIG_XEN
39
static int nv_enable_xen=0;
40
NV_MODULE_PARAMETER(nv_enable_xen);
41
static int nv_disable_pat = 1;
42
#else
38
static int nv_disable_pat = 0;
43
static int nv_disable_pat = 0;
44
#endif
39
NV_MODULE_PARAMETER(nv_disable_pat);
45
NV_MODULE_PARAMETER(nv_disable_pat);
40
46
41
/*
47
/*
Lines 751-758 static inline void __nv_disable_caches(u Link Here
751
    unsigned long cr0 = read_cr0();
757
    unsigned long cr0 = read_cr0();
752
    write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
758
    write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
753
    wbinvd();
759
    wbinvd();
760
#ifndef CONFIG_XEN
754
    *cr4 = read_cr4();
761
    *cr4 = read_cr4();
755
    if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
762
    if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
763
#endif
756
    __flush_tlb();
764
    __flush_tlb();
757
}
765
}
758
766
Lines 762-768 static inline void __nv_enable_caches(un Link Here
762
    wbinvd();
770
    wbinvd();
763
    __flush_tlb();
771
    __flush_tlb();
764
    write_cr0((cr0 & 0x9fffffff));
772
    write_cr0((cr0 & 0x9fffffff));
773
#ifndef CONFIG_XEN
765
    if (cr4 & 0x80) write_cr4(cr4);
774
    if (cr4 & 0x80) write_cr4(cr4);
775
#endif
766
}
776
}
767
777
768
static int __check_pat_support()
778
static int __check_pat_support()
Lines 993-998 static int __init nvidia_init_module(voi Link Here
993
        nv_printf(NV_DBG_ERRORS, "NVRM: No NVIDIA graphics adapter found!\n");
1003
        nv_printf(NV_DBG_ERRORS, "NVRM: No NVIDIA graphics adapter found!\n");
994
        return -ENODEV;
1004
        return -ENODEV;
995
    }
1005
    }
1006
#ifdef CONFIG_XEN
1007
    printk("NVIDIA driver not yet supported on xen, override with nv_enable_xen=1\n");
1008
    if (!nv_enable_xen)
1009
	    return -ENODEV;
1010
#endif
996
1011
997
    memset(nv_linux_devices, 0, sizeof(nv_linux_devices));
1012
    memset(nv_linux_devices, 0, sizeof(nv_linux_devices));
998
1013

Return to bug 115800