summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/gentoo-sources/files/2.6.24-loongson-drm.patch')
-rw-r--r--sys-kernel/gentoo-sources/files/2.6.24-loongson-drm.patch186
1 files changed, 0 insertions, 186 deletions
diff --git a/sys-kernel/gentoo-sources/files/2.6.24-loongson-drm.patch b/sys-kernel/gentoo-sources/files/2.6.24-loongson-drm.patch
deleted file mode 100644
index c3d4e02..0000000
--- a/sys-kernel/gentoo-sources/files/2.6.24-loongson-drm.patch
+++ /dev/null
@@ -1,186 +0,0 @@
-diff --git linux/drivers/char/drm/ati_pcigart.c linux/drivers/char/drm/ati_pcigart.c
-index 3345641..524ef44 100644
---- linux/drivers/char/drm/ati_pcigart.c
-+++ linux/drivers/char/drm/ati_pcigart.c
-@@ -173,7 +173,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
- bus_address, (unsigned long)address);
- }
-
-- pci_gart = (u32 *) address;
-+ pci_gart = (u32 *) UNCAC_ADDR(address);
-
- max_pages = (gart_info->table_size / sizeof(u32));
- pages = (entry->pages <= max_pages)
-diff --git linux/drivers/char/drm/drm_bufs.c linux/drivers/char/drm/drm_bufs.c
-index d24a6c2..3354b04 100644
---- linux/drivers/char/drm/drm_bufs.c
-+++ linux/drivers/char/drm/drm_bufs.c
-@@ -200,7 +200,7 @@ static int drm_addmap_core(struct drm_device * dev, unsigned int offset,
- *maplist = list;
- return 0;
- }
-- map->handle = vmalloc_user(map->size);
-+ map->handle = __vmalloc(map->size, GFP_KERNEL | __GFP_HIGHMEM , pgprot_noncached(PAGE_KERNEL));
- DRM_DEBUG("%lu %d %p\n",
- map->size, drm_order(map->size), map->handle);
- if (!map->handle) {
-diff --git linux/drivers/char/drm/drm_pci.c linux/drivers/char/drm/drm_pci.c
-index b55d5bc..826f0f0 100644
---- linux/drivers/char/drm/drm_pci.c
-+++ linux/drivers/char/drm/drm_pci.c
-@@ -113,7 +113,7 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
- /* Reserve */
- for (addr = (unsigned long)dmah->vaddr, sz = size;
- sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) {
-- SetPageReserved(virt_to_page(addr));
-+ SetPageReserved(virt_to_page(CAC_ADDR(addr)));
- }
-
- return dmah;
-@@ -147,7 +147,7 @@ void __drm_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah)
- /* Unreserve */
- for (addr = (unsigned long)dmah->vaddr, sz = dmah->size;
- sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) {
-- ClearPageReserved(virt_to_page(addr));
-+ ClearPageReserved(virt_to_page(CAC_ADDR(addr)));
- }
- dma_free_coherent(&dev->pdev->dev, dmah->size, dmah->vaddr,
- dmah->busaddr);
-diff --git linux/drivers/char/drm/drm_sarea.h linux/drivers/char/drm/drm_sarea.h
-index e040f47..a85bb0e 100644
---- linux/drivers/char/drm/drm_sarea.h
-+++ linux/drivers/char/drm/drm_sarea.h
-@@ -37,6 +37,8 @@
- /* SAREA area needs to be at least a page */
- #if defined(__alpha__)
- #define SAREA_MAX 0x2000
-+#elif defined(__mips__)
-+#define SAREA_MAX 0x4000
- #elif defined(__ia64__)
- #define SAREA_MAX 0x10000 /* 64kB */
- #else
-diff --git linux/drivers/char/drm/drm_scatter.c linux/drivers/char/drm/drm_scatter.c
-index eb7fa43..4f97c71 100644
---- linux/drivers/char/drm/drm_scatter.c
-+++ linux/drivers/char/drm/drm_scatter.c
-@@ -104,7 +104,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)
- }
- memset((void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr));
-
-- entry->virtual = vmalloc_32(pages << PAGE_SHIFT);
-+ entry->virtual = __vmalloc(pages << PAGE_SHIFT, GFP_KERNEL | __GFP_HIGHMEM , pgprot_noncached(PAGE_KERNEL));
- if (!entry->virtual) {
- drm_free(entry->busaddr,
- entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES);
-@@ -148,6 +148,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)
- unsigned long *tmp;
-
- tmp = page_address(entry->pagelist[i]);
-+ tmp = (unsigned long*)UNCAC_ADDR((unsigned long)tmp);
- for (j = 0;
- j < PAGE_SIZE / sizeof(unsigned long);
- j++, tmp++) {
-@@ -166,6 +167,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)
- }
- }
- tmp = page_address(entry->pagelist[i]);
-+ tmp = (unsigned long*)UNCAC_ADDR((unsigned long)tmp);
- for (j = 0;
- j < PAGE_SIZE / sizeof(unsigned long);
- j++, tmp++) {
-diff --git linux/drivers/char/drm/drm_vm.c linux/drivers/char/drm/drm_vm.c
-index ef5e6b1..6deb847 100644
---- linux/drivers/char/drm/drm_vm.c
-+++ linux/drivers/char/drm/drm_vm.c
-@@ -290,7 +290,7 @@ static __inline__ struct page *drm_do_vm_dma_nopage(struct vm_area_struct *vma,
-
- offset = address - vma->vm_start; /* vm_[pg]off[set] should be 0 */
- page_nr = offset >> PAGE_SHIFT;
-- page = virt_to_page((dma->pagelist[page_nr] + (offset & (~PAGE_MASK))));
-+ page = virt_to_page(CAC_ADDR(dma->pagelist[page_nr] + (offset & (~PAGE_MASK))));
-
- get_page(page);
-
-@@ -492,6 +492,8 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
- vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
- #if defined(__i386__) || defined(__x86_64__)
- pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
-+#elif defined(__mips__)
-+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- #else
- /* Ye gads this is ugly. With more thought
- we could move this up higher and use
-@@ -531,6 +533,17 @@ unsigned long drm_core_get_reg_ofs(struct drm_device *dev)
-
- EXPORT_SYMBOL(drm_core_get_reg_ofs);
-
-+#ifdef __mips__
-+static inline pgprot_t pgprot_noncached_accelerated(pgprot_t _prot)
-+{
-+ unsigned long prot = pgprot_val(_prot);
-+
-+ prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED_ACCELERATED;
-+
-+ return __pgprot(prot);
-+}
-+#endif
-+
- /**
- * mmap DMA memory.
- *
-@@ -620,6 +633,11 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
- vma->vm_page_prot = drm_io_prot(map->type, vma);
- #ifdef __sparc__
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-+#elif defined(__mips__)
-+ if (map->type == _DRM_FRAME_BUFFER)
-+ vma->vm_page_prot = pgprot_noncached_accelerated(vma->vm_page_prot);
-+ else
-+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- #endif
- if (io_remap_pfn_range(vma, vma->vm_start,
- (map->offset + offset) >> PAGE_SHIFT,
-@@ -636,7 +654,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
- /* Consistent memory is really like shared memory. But
- * it's allocated in a different way, so avoid nopage */
- if (remap_pfn_range(vma, vma->vm_start,
-- page_to_pfn(virt_to_page(map->handle)),
-+ page_to_pfn(virt_to_page(CAC_ADDR(map->handle))),
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
- return -EAGAIN;
- /* fall through to _DRM_SHM */
-@@ -646,11 +664,17 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
- /* Don't let this area swap. Change when
- DRM_KERNEL advisory is supported. */
- vma->vm_flags |= VM_RESERVED;
-+#ifdef __mips__
-+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-+#endif
- break;
- case _DRM_SCATTER_GATHER:
- vma->vm_ops = &drm_vm_sg_ops;
- vma->vm_private_data = (void *)map;
- vma->vm_flags |= VM_RESERVED;
-+#ifdef __mips__
-+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-+#endif
- break;
- default:
- return -EINVAL; /* This should never happen. */
-diff --git linux/drivers/char/drm/radeon_cp.c linux/drivers/char/drm/radeon_cp.c
-index 24fca8e..8592ec4 100644
---- linux/drivers/char/drm/radeon_cp.c
-+++ linux/drivers/char/drm/radeon_cp.c
-@@ -2276,9 +2276,9 @@ int radeon_driver_firstopen(struct drm_device *dev)
- return ret;
-
- dev_priv->fb_aper_offset = drm_get_resource_start(dev, 0);
-- ret = drm_addmap(dev, dev_priv->fb_aper_offset,
-- drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER,
-- _DRM_WRITE_COMBINING, &map);
-+ ret = drm_addmap(dev, drm_get_resource_start(dev, 0),
-+ 0x1000000, _DRM_FRAME_BUFFER,
-+ _DRM_WRITE_COMBINING, &map);
- if (ret != 0)
- return ret;
-