diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-20 13:15:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-20 13:15:30 -0400 |
commit | 43813f399c72aa22e01a680559c1cb5274bf2140 (patch) | |
tree | 933c0e7c445b9c3478b5a0db06a162d0d39f00f2 /drivers/gpu/drm/drm_memory.c | |
parent | a552f0af753eb4b5bbbe9eff205fe874b04c4583 (diff) | |
parent | 0b7af262aba912f52bc6ef76f1bc0960b01b8502 (diff) |
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (24 commits)
agp/intel: Make intel_i965_mask_memory use dma_addr_t for physical addresses
agp: add user mapping support to ATI AGP bridge.
drm/i915: enable GEM on PAE.
drm/radeon: fix unused variables warning
agp: switch AGP to use page array instead of unsigned long array
agpgart: detected ALi M???? chipset with M1621
drm/radeon: command stream checker for r3xx-r5xx hardware
drm/radeon: Fully initialize LVDS info also when we can't get it from the ROM.
radeon: Fix CP byte order on big endian architectures with KMS.
agp/uninorth: Handle user memory types.
drm/ttm: Add some powerpc cache flush code.
radeon: Enable modesetting on non-x86.
drm/radeon: Respect AGP cant_use_aperture flag.
drm: EDID endianness fixes.
drm/radeon: this VRAM vs aperture test is wrong, just remove it.
drm/ttm: fix an error path to exit function correctly
drm: Apply "Memory fragmentation from lost alignment blocks"
ttm: Return -ERESTART when a signal interrupts bo eviction.
drm: Remove memory debugging infrastructure.
drm/i915: Clear fence register on tiling stride change.
...
Diffstat (limited to 'drivers/gpu/drm/drm_memory.c')
-rw-r--r-- | drivers/gpu/drm/drm_memory.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c index 0c707f533eab..e4865f99989c 100644 --- a/drivers/gpu/drm/drm_memory.c +++ b/drivers/gpu/drm/drm_memory.c | |||
@@ -36,15 +36,6 @@ | |||
36 | #include <linux/highmem.h> | 36 | #include <linux/highmem.h> |
37 | #include "drmP.h" | 37 | #include "drmP.h" |
38 | 38 | ||
39 | #ifdef DEBUG_MEMORY | ||
40 | #include "drm_memory_debug.h" | ||
41 | #else | ||
42 | |||
43 | /** No-op. */ | ||
44 | void drm_mem_init(void) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | /** | 39 | /** |
49 | * Called when "/proc/dri/%dev%/mem" is read. | 40 | * Called when "/proc/dri/%dev%/mem" is read. |
50 | * | 41 | * |
@@ -64,28 +55,15 @@ int drm_mem_info(char *buf, char **start, off_t offset, | |||
64 | return 0; | 55 | return 0; |
65 | } | 56 | } |
66 | 57 | ||
67 | /** Wrapper around kmalloc() and kfree() */ | ||
68 | void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area) | ||
69 | { | ||
70 | void *pt; | ||
71 | |||
72 | if (!(pt = kmalloc(size, GFP_KERNEL))) | ||
73 | return NULL; | ||
74 | if (oldpt && oldsize) { | ||
75 | memcpy(pt, oldpt, oldsize); | ||
76 | kfree(oldpt); | ||
77 | } | ||
78 | return pt; | ||
79 | } | ||
80 | |||
81 | #if __OS_HAS_AGP | 58 | #if __OS_HAS_AGP |
82 | static void *agp_remap(unsigned long offset, unsigned long size, | 59 | static void *agp_remap(unsigned long offset, unsigned long size, |
83 | struct drm_device * dev) | 60 | struct drm_device * dev) |
84 | { | 61 | { |
85 | unsigned long *phys_addr_map, i, num_pages = | 62 | unsigned long i, num_pages = |
86 | PAGE_ALIGN(size) / PAGE_SIZE; | 63 | PAGE_ALIGN(size) / PAGE_SIZE; |
87 | struct drm_agp_mem *agpmem; | 64 | struct drm_agp_mem *agpmem; |
88 | struct page **page_map; | 65 | struct page **page_map; |
66 | struct page **phys_page_map; | ||
89 | void *addr; | 67 | void *addr; |
90 | 68 | ||
91 | size = PAGE_ALIGN(size); | 69 | size = PAGE_ALIGN(size); |
@@ -112,10 +90,9 @@ static void *agp_remap(unsigned long offset, unsigned long size, | |||
112 | if (!page_map) | 90 | if (!page_map) |
113 | return NULL; | 91 | return NULL; |
114 | 92 | ||
115 | phys_addr_map = | 93 | phys_page_map = (agpmem->memory->pages + (offset - agpmem->bound) / PAGE_SIZE); |
116 | agpmem->memory->memory + (offset - agpmem->bound) / PAGE_SIZE; | ||
117 | for (i = 0; i < num_pages; ++i) | 94 | for (i = 0; i < num_pages; ++i) |
118 | page_map[i] = pfn_to_page(phys_addr_map[i] >> PAGE_SHIFT); | 95 | page_map[i] = phys_page_map[i]; |
119 | addr = vmap(page_map, num_pages, VM_IOREMAP, PAGE_AGP); | 96 | addr = vmap(page_map, num_pages, VM_IOREMAP, PAGE_AGP); |
120 | vfree(page_map); | 97 | vfree(page_map); |
121 | 98 | ||
@@ -157,8 +134,6 @@ static inline void *agp_remap(unsigned long offset, unsigned long size, | |||
157 | 134 | ||
158 | #endif /* agp */ | 135 | #endif /* agp */ |
159 | 136 | ||
160 | #endif /* debug_memory */ | ||
161 | |||
162 | void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev) | 137 | void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev) |
163 | { | 138 | { |
164 | if (drm_core_has_AGP(dev) && | 139 | if (drm_core_has_AGP(dev) && |