Package: nvidia-graphics-kernels
Version: 169.09-1
Tags: patch

The changelog for version 100.14.11-1 says "Disable Xen patch until it
compiles again".

I got that patch to compile again. In fact, I've even installed the
result on a 2.6.18-6-xen-amd64 dom0 with a Quadro NVS 290 (0x042f)
card, and got apparently normal graphics functionality. Enjoy.
#! /bin/sh /usr/share/dpatch/dpatch-run
## 05_xenrt by  <[EMAIL PROTECTED]>
##
## DP: This patch will allow nvidia to be compile and run on Xen or
## DP: Realtime Preemption enabled kernels.

@DPATCH@
--- usr/src/nv/conftest.sh      2008-01-12 00:32:30.000000000 +0100
+++ usr/src/nv/conftest.sh      2008-03-12 23:43:23.675130402 +0100
@@ -1114,7 +1114,8 @@
         # Check if the target kernel is a Xen kernel. If so, then exit, since
         # the driver doesn't currently work with Xen.
         #
-        RET=1
+        ##MNENCIA## Switched to 0 because we have the xenrt patch :-)
+        RET=0
         VERBOSE=$6
         FILE="linux/autoconf.h"
 
--- usr/src/nv/nv-linux.h       2008-01-12 00:32:30.000000000 +0100
+++ usr/src/nv/nv-linux.h       2008-03-12 23:43:23.671129287 +0100
@@ -274,7 +274,7 @@
  * tiny, and the kernel panics when it is exhausted. try to warn the user that
  * they need to boost the size of their pool.
  */
-#if defined(CONFIG_SWIOTLB) && !defined(GFP_DMA32)
+#if defined(CONFIG_SWIOTLB) && !defined(GFP_DMA32) && !defined(CONFIG_XEN)
 #define NV_SWIOTLB 1
 #endif
 
@@ -847,7 +847,10 @@
 #define NV_VM_INSERT_PAGE(vma, addr, page) \
     vm_insert_page(vma, addr, page)
 #endif
-#if defined(NV_REMAP_PFN_RANGE_PRESENT)
+#if defined(CONFIG_XEN)
+#define NV_REMAP_PAGE_RANGE(from, offset, x...) \
+    io_remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x)
+#elif defined(NV_REMAP_PFN_RANGE_PRESENT)
 #define NV_REMAP_PAGE_RANGE(from, offset, x...) \
     remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x)
 #elif defined(NV_REMAP_PAGE_RANGE_PRESENT)
@@ -970,6 +973,9 @@
         __pte_value;                                    \
     })
 
+#if !defined(CONFIG_XEN)
+#define phys_to_machine(x) x
+#endif
 
 #define NV_PAGE_ALIGN(addr)             ( ((addr) + PAGE_SIZE - 1) / PAGE_SIZE)
 #define NV_MASK_OFFSET(addr)            ( (addr) & (PAGE_SIZE - 1) )
--- usr/src/nv/nv-vm.c  2008-01-12 00:32:30.000000000 +0100
+++ usr/src/nv/nv-vm.c  2008-03-12 23:43:23.671129287 +0100
@@ -352,6 +352,9 @@
 
 static void nv_flush_caches(void)
 {
+#if defined(CONFIG_PREEMPT_RT)
+    if(!nv_pat_enabled) return;
+#endif
 #if defined(KERNEL_2_4)
     // for 2.4 kernels, just automatically flush the caches and invalidate tlbs
     nv_execute_on_all_cpus(cache_flush, NULL);
--- usr/src/nv/os-agp.c 2008-01-12 00:32:30.000000000 +0100
+++ usr/src/nv/os-agp.c 2008-03-12 23:43:23.675130402 +0100
@@ -295,7 +295,7 @@
 
          page_ptr->phys_addr = (ptr->memory[i] & PAGE_MASK);
          page_ptr->virt_addr = (unsigned long) __va(page_ptr->phys_addr);
-         page_ptr->dma_addr  = page_ptr->phys_addr;
+         page_ptr->dma_addr  = phys_to_machine(page_ptr->phys_addr);
     }
 
     return RM_OK;
--- usr/src/nv/os-interface.c   2008-01-12 00:32:30.000000000 +0100
+++ usr/src/nv/os-interface.c   2008-03-12 23:43:23.675130402 +0100
@@ -590,6 +590,7 @@
     MicroSeconds = MilliSeconds * 1000;
     tm_end.tv_usec = MicroSeconds;
     tm_end.tv_sec = 0;
+#if !defined(CONFIG_XEN)
     NV_TIMERADD(&tm_aux, &tm_end, &tm_end);
 
     /* do we have a full jiffie to wait? */
@@ -637,6 +638,7 @@
                 MicroSeconds = 0;
         } while ((jiffies = NV_USECS_TO_JIFFIES(MicroSeconds)) != 0);
     }
+#endif
 
     if (MicroSeconds > 1000)
     {

Reply via email to