Skip to contentSkip to conversation

install nvidia drvier into Dom0 successfully

PATCH Yong LIU 1 participant 1 message Mar 15, 2006 Kbuild

lore
Share & tools
lore

Yong LIU

author
#0 lore raw

I use xen-3.0-testing(downloaded with hg). My nvidia card is Quadro FX 3400. OS is Rocks 4.0(i386). The version of Nvidia driver is 1.0.8178, patched with 01-22-2006 patch. I can play 3D games now. Thank Jacob for help.

Yong

Makefile.kbuild 2006-03-15 12:18:16.000000000 +0100 renamed from usr/src/nv/Makefile.kbuild 2006-03-15 10:46:52.000000000 +0100 +0 -0
diff -Nur NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/Makefile.kbuild nv/Makefile.kbuild
@@ -262,7 +262,7 @@

# KBUILD build parameters.
#

-KBUILD_PARAMS += KBUILD_VERBOSE=1 -C $(KERNEL_SOURCES) SUBDIRS=$(PWD) +KBUILD_PARAMS += KBUILD_VERBOSE=1 -C $(KERNEL_SOURCES) SUBDIRS=$(PWD) ARCH=xen

#
# NVIDIA sanity checks.

nv.c 2006-03-15 11:06:11.000000000 +0100 renamed from usr/src/nv/nv.c 2006-03-15 10:46:52.000000000 +0100 +0 -1
diff -Nur NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/nv.c nv/nv.c
@@ -8,7 +8,6 @@
 * _NVRM_COPYRIGHT_END_
 */
 
-

#include "nv-misc.h"
#include "os-interface.h"
#include "nv-linux.h"
@@ -924,6 +923,10 @@

{
    unsigned long pat1, pat2;

+#ifdef CONFIG_XEN
+ nv_pat_enabled=1;
+#endif
+

    if (nv_pat_enabled)
        return 1;

@@ -952,6 +955,10 @@

{
    unsigned long pat1, pat2;

+#ifdef CONFIG_XEN
+ nv_pat_enabled=0;
+#endif
+

    if (!nv_pat_enabled)
        return;

@@ -2015,7 +2022,11 @@

            return -ENXIO;
        }

+#ifdef CONFIG_XEN
+ if (io_remap_page_range(vma, vma->vm_start,
+#else

        if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+#endif
                             NV_VMA_OFFSET(vma),
                             NV_VMA_SIZE(vma),
                             vma->vm_page_prot))
@@ -2039,8 +2050,11 @@
                return -ENXIO;
            }
        }

-
+#ifdef CONFIG_XEN
+ if (io_remap_page_range(vma, vma->vm_start,
+#else

        if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+#endif
                             NV_VMA_OFFSET(vma),
                             NV_VMA_SIZE(vma),
                             vma->vm_page_prot))
@@ -2078,7 +2092,11 @@
        NV_ATOMIC_INC(at->usage_count);
        nv_up(nvl->at_lock);

+#ifdef CONFIG_XEN
+ if (io_remap_page_range(vma, vma->vm_start,
+#else

        if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+#endif
                                NV_VMA_OFFSET(vma),
                                NV_VMA_SIZE(vma),
                                vma->vm_page_prot))
nv-linux.h 2006-03-15 10:58:08.000000000 +0100 renamed from usr/src/nv/nv-linux.h 2006-03-15 10:46:52.000000000 +0100 +0 -0
diff -Nur NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/nv-linux.h nv/nv-linux.h
@@ -202,9 +202,13 @@
 * tiny, and the kernel panics when it is exhausted. try to warn the 

user that
* they need to boost the size of their pool.
*/
+#ifdef CONFIG_XEN
+#undef CONFIG_SWIOTLB
+#else
#if defined(CONFIG_SWIOTLB)
#define NV_SWIOTLB 1
#endif
+#endif

/*
* early 2.6 kernels changed their swiotlb codepath, running into a

nv-vm.c 2006-03-15 10:59:04.000000000 +0100 renamed from usr/src/nv/nv-vm.c 2006-03-15 10:46:52.000000000 +0100 +4 -0
diff -Nur NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/nv-vm.c nv/nv-vm.c
@@ -544,7 +544,11 @@
        page_ptr = at->page_table[i];
        page_ptr->phys_addr = phys_addr;
        page_ptr->virt_addr = virt_addr;
+#ifdef CONFIG_XEN
+        page_ptr->dma_addr = phys_to_machine(page_ptr->phys_addr);
+#else
        page_ptr->dma_addr = page_ptr->phys_addr;
+#endif
 
        /* lock the page for dma purposes */
        nv_lock_page(page_ptr);
os-agp.c 2006-03-15 10:59:15.000000000 +0100 renamed from usr/src/nv/os-agp.c 2005-12-15 01:57:35.000000000 +0100 +4 -0
diff -Nur NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/os-agp.c nv/os-agp.c
@@ -303,7 +303,11 @@
 
         page_ptr->phys_addr = (ptr->memory[i] & PAGE_MASK);
         page_ptr->virt_addr = (unsigned long) __va(page_ptr->phys_addr);
+#ifdef CONFIG_XEN
+         page_ptr->dma_addr  = phys_to_machine(page_ptr->phys_addr);
+#else
         page_ptr->dma_addr  = page_ptr->phys_addr;
+#endif
    }
 
    return RM_OK;