From 89ef1b5483bb234278fe40e193643fc9777f50d4 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 27 Oct 2008 21:21:15 +0200 Subject: drm: missing init_mm symbol, compatibility fix The drm_compat.c version of kmap_atomic_prot_pfn() uses the macro pgd_offset_k(), which references the symbol init_mm. Starting in 2.6.25, init_mm is no longer exported by default. The only user of kmap_atomic_prot_pfn() is i915, so this should not hurt anyone, and it allows people to load drm.ko. Signed-off-by: Pekka Paalanen --- linux-core/drm_compat.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'linux-core') diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h index c7f72e33..e09be479 100644 --- a/linux-core/drm_compat.h +++ b/linux-core/drm_compat.h @@ -333,9 +333,24 @@ typedef _Bool bool; #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) -- cgit v1.2.3 From e47ab7a5081e178bad385ce2e75b01474ea7aa4c Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 28 Oct 2008 12:00:08 +1100 Subject: nv50: symlink nv50_grctx.h to linux-core... --- linux-core/nv50_grctx.h | 1 + 1 file changed, 1 insertion(+) create mode 120000 linux-core/nv50_grctx.h (limited to 'linux-core') 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 -- cgit v1.2.3 From 87e90c73620b88005fcca5fd40aaaad0b08932e1 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Sun, 2 Nov 2008 13:48:32 +0200 Subject: nouveau: compat fix for set_page_locked(). The set_page_locked() function has changed its name again. 2.6.28 offers __set_page_locked() instead, which uses non-atomic __set_bit() to do the work. In this case, offer our own set_page_locked() using the atomic set_bit(), because I do not know if atomic access is really necessary. Atomic behaviour is the one previously expected. Signed-off-by: Pekka Paalanen --- linux-core/drm_compat.h | 13 +++++++++++++ linux-core/nouveau_sgdma.c | 4 ---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'linux-core') diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h index e09be479..bc4d2e58 100644 --- a/linux-core/drm_compat.h +++ b/linux-core/drm_compat.h @@ -392,4 +392,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); -- cgit v1.2.3