Author: airlied
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32050
Modified Files:
kernel.spec
Added Files:
nvidia-agp.patch
Log Message:
- nvidia-agp support for TTM
nvidia-agp.patch:
--- NEW FILE nvidia-agp.patch ---
From bc59ca5540062fd296399281af2d6535fa7dbb1b Mon Sep 17 00:00:00 2001
From: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Wed, 10 Sep 2008 14:13:33 +0200
Subject: [PATCH] [agpgart] Support agp user-memory on nvidia agp.
Signed-off-by: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
---
drivers/char/agp/nvidia-agp.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index eaceb61..c7eaee1 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -201,10 +201,15 @@ extern int agp_memory_reserved;
static int nvidia_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
{
int i, j;
+ int mask_type;
- if ((type != 0) || (mem->type != 0))
+ mask_type = agp_generic_type_to_mask_type(mem->bridge, type);
+ if (mask_type != 0 || type != mem->type)
return -EINVAL;
+ if (mem->page_count == 0)
+ return 0;
+
if ((pg_start + mem->page_count) >
(nvidia_private.num_active_entries - agp_memory_reserved/PAGE_SIZE))
return -EINVAL;
@@ -220,10 +225,13 @@ static int nvidia_insert_memory(struct a
}
for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
writel(agp_bridge->driver->mask_memory(agp_bridge,
- mem->memory[i], mem->type),
+ mem->memory[i], mask_type),
agp_bridge->gatt_table+nvidia_private.pg_offset+j);
- readl(agp_bridge->gatt_table+nvidia_private.pg_offset+j); /* PCI Posting. */
}
+
+ /* PCI Posting. */
+ readl(agp_bridge->gatt_table+nvidia_private.pg_offset+j - 1);
+
agp_bridge->driver->tlb_flush(mem);
return 0;
}
@@ -233,9 +241,15 @@ static int nvidia_remove_memory(struct a
{
int i;
- if ((type != 0) || (mem->type != 0))
+ int mask_type;
+
+ mask_type = agp_generic_type_to_mask_type(mem->bridge, type);
+ if (mask_type != 0 || type != mem->type)
return -EINVAL;
+ if (mem->page_count == 0)
+ return 0;
+
for (i = pg_start; i < (mem->page_count + pg_start); i++)
writel(agp_bridge->scratch_page,
agp_bridge->gatt_table+nvidia_private.pg_offset+i);
--
1.4.1
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.999
retrieving revision 1.1000
diff -u -r1.999 -r1.1000
--- kernel.spec 1 Oct 2008 03:49:53 -0000 1.999
+++ kernel.spec 1 Oct 2008 08:55:36 -0000 1.1000
@@ -602,6 +602,7 @@
Patch1515: linux-2.6-lirc.patch
# nouveau + drm fixes
+Patch1800: nvidia-agp.patch
Patch1811: drm-modesetting-radeon.patch
Patch1812: drm-modesetting-i915.patch
Patch1813: drm-nouveau.patch
@@ -1143,6 +1144,7 @@
ApplyPatch linux-2.6-netdev-atl2.patch
# Nouveau DRM + drm fixes
+ApplyPatch nvidia-agp.patch
ApplyPatch drm-modesetting-radeon.patch
ApplyPatch drm-modesetting-i915.patch
ApplyPatch drm-nouveau.patch
@@ -1739,6 +1741,9 @@
%kernel_variant_files -k vmlinux %{with_kdump} kdump
%changelog
+* Wed Oct 01 2008 Dave Airlie <airlied(a)redhat.com>
+- nvidia-agp support for TTM
+
* Tue Sep 30 2008 Dave Jones <davej(a)redhat.com>
- Disable debugging options in default builds. Enable kernel-debug.