summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-11-13 15:30:06 -0800
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-11-13 15:30:06 -0800
commit965b4d662a5236ee5aeb94a70f62565b6ed5644c (patch)
tree7645e5130046e3952c2a490d5561bafe67cbff89 /linux-core
parent9a4cb7eab4f74747cc777a3fef31dbb46e1191e5 (diff)
parent7e27b3ba88f0c40680380636a436c18e3220c7ce (diff)
Merge branch 'master' into modesetting-gem
Conflicts: libdrm/Makefile.am libdrm/intel/intel_bufmgr.h libdrm/intel/intel_bufmgr_fake.c libdrm/intel/intel_bufmgr_gem.c shared-core/drm.h shared-core/i915_dma.c shared-core/i915_irq.c shared-core/radeon_cp.c shared-core/radeon_drv.h
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_compat.h28
-rw-r--r--linux-core/nouveau_sgdma.c4
l---------linux-core/nv50_grctx.h1
3 files changed, 29 insertions, 4 deletions
diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h
index 88c5bb1d..585350f4 100644
--- a/linux-core/drm_compat.h
+++ b/linux-core/drm_compat.h
@@ -357,9 +357,24 @@ static inline int kobject_uevent_env(struct kobject *kobj,
#if (defined(CONFIG_X86) && defined(CONFIG_X86_32) && defined(CONFIG_HIGHMEM))
+/*
+ * pgd_offset_k() is a macro that uses the symbol init_mm,
+ * check that it is available.
+ */
+# if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) || \
+ defined(CONFIG_UNUSED_SYMBOLS))
#define DRM_KMAP_ATOMIC_PROT_PFN
extern void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type,
pgprot_t protection);
+# else
+#warning "init_mm is not available on this kernel!"
+static inline void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type,
+ pgprot_t protection)
+{
+ /* stub */
+ return NULL;
+}
+# endif /* no init_mm */
#endif
#if !defined(flush_agp_mappings)
@@ -409,4 +424,17 @@ extern struct page *drm_vm_sg_nopage(struct vm_area_struct *vma,
#endif
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
+#define set_page_locked SetPageLocked
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
+/*
+ * The kernel provides __set_page_locked, which uses the non-atomic
+ * __set_bit function. Let's use the atomic set_bit just in case.
+ */
+static inline void set_page_locked(struct page *page)
+{
+ set_bit(PG_locked, &page->flags);
+}
+#endif
+
#endif
diff --git a/linux-core/nouveau_sgdma.c b/linux-core/nouveau_sgdma.c
index 739e0252..1163baf9 100644
--- a/linux-core/nouveau_sgdma.c
+++ b/linux-core/nouveau_sgdma.c
@@ -227,11 +227,7 @@ nouveau_sgdma_init(struct drm_device *dev)
dev_priv->gart_info.sg_dummy_page =
alloc_page(GFP_KERNEL|__GFP_DMA32);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
set_page_locked(dev_priv->gart_info.sg_dummy_page);
-#else
- SetPageLocked(dev_priv->gart_info.sg_dummy_page);
-#endif
dev_priv->gart_info.sg_dummy_bus =
pci_map_page(dev->pdev, dev_priv->gart_info.sg_dummy_page, 0,
PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
diff --git a/linux-core/nv50_grctx.h b/linux-core/nv50_grctx.h
new file mode 120000
index 00000000..d40b9a86
--- /dev/null
+++ b/linux-core/nv50_grctx.h
@@ -0,0 +1 @@
+../shared-core/nv50_grctx.h \ No newline at end of file