diff options
author | Eric Anholt <eric@anholt.net> | 2009-03-24 15:23:04 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-06-18 16:00:33 -0400 |
commit | 9a298b2acd771d8a5c0004d8f8e4156c65b11f6b (patch) | |
tree | f8bf6cfe675492cb881abb50d9aa9aa8f38733d6 /drivers/gpu/drm/drm_scatter.c | |
parent | 52dc7d32b88156248167864f77a9026abe27b432 (diff) |
drm: Remove memory debugging infrastructure.
It hasn't been used in ages, and having the user tell your how much
memory is being freed at free time is a recipe for disaster even if it
was ever used.
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/drm_scatter.c')
-rw-r--r-- | drivers/gpu/drm/drm_scatter.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c index b2b0f3d41714..c7823c863d4f 100644 --- a/drivers/gpu/drm/drm_scatter.c +++ b/drivers/gpu/drm/drm_scatter.c | |||
@@ -58,11 +58,9 @@ void drm_sg_cleanup(struct drm_sg_mem * entry) | |||
58 | 58 | ||
59 | vfree(entry->virtual); | 59 | vfree(entry->virtual); |
60 | 60 | ||
61 | drm_free(entry->busaddr, | 61 | kfree(entry->busaddr); |
62 | entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES); | 62 | kfree(entry->pagelist); |
63 | drm_free(entry->pagelist, | 63 | kfree(entry); |
64 | entry->pages * sizeof(*entry->pagelist), DRM_MEM_PAGES); | ||
65 | drm_free(entry, sizeof(*entry), DRM_MEM_SGLISTS); | ||
66 | } | 64 | } |
67 | 65 | ||
68 | #ifdef _LP64 | 66 | #ifdef _LP64 |
@@ -84,7 +82,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request) | |||
84 | if (dev->sg) | 82 | if (dev->sg) |
85 | return -EINVAL; | 83 | return -EINVAL; |
86 | 84 | ||
87 | entry = drm_alloc(sizeof(*entry), DRM_MEM_SGLISTS); | 85 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); |
88 | if (!entry) | 86 | if (!entry) |
89 | return -ENOMEM; | 87 | return -ENOMEM; |
90 | 88 | ||
@@ -93,34 +91,27 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request) | |||
93 | DRM_DEBUG("size=%ld pages=%ld\n", request->size, pages); | 91 | DRM_DEBUG("size=%ld pages=%ld\n", request->size, pages); |
94 | 92 | ||
95 | entry->pages = pages; | 93 | entry->pages = pages; |
96 | entry->pagelist = drm_alloc(pages * sizeof(*entry->pagelist), | 94 | entry->pagelist = kmalloc(pages * sizeof(*entry->pagelist), GFP_KERNEL); |
97 | DRM_MEM_PAGES); | ||
98 | if (!entry->pagelist) { | 95 | if (!entry->pagelist) { |
99 | drm_free(entry, sizeof(*entry), DRM_MEM_SGLISTS); | 96 | kfree(entry); |
100 | return -ENOMEM; | 97 | return -ENOMEM; |
101 | } | 98 | } |
102 | 99 | ||
103 | memset(entry->pagelist, 0, pages * sizeof(*entry->pagelist)); | 100 | memset(entry->pagelist, 0, pages * sizeof(*entry->pagelist)); |
104 | 101 | ||
105 | entry->busaddr = drm_alloc(pages * sizeof(*entry->busaddr), | 102 | entry->busaddr = kmalloc(pages * sizeof(*entry->busaddr), GFP_KERNEL); |
106 | DRM_MEM_PAGES); | ||
107 | if (!entry->busaddr) { | 103 | if (!entry->busaddr) { |
108 | drm_free(entry->pagelist, | 104 | kfree(entry->pagelist); |
109 | entry->pages * sizeof(*entry->pagelist), | 105 | kfree(entry); |
110 | DRM_MEM_PAGES); | ||
111 | drm_free(entry, sizeof(*entry), DRM_MEM_SGLISTS); | ||
112 | return -ENOMEM; | 106 | return -ENOMEM; |
113 | } | 107 | } |
114 | memset((void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr)); | 108 | memset((void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr)); |
115 | 109 | ||
116 | entry->virtual = drm_vmalloc_dma(pages << PAGE_SHIFT); | 110 | entry->virtual = drm_vmalloc_dma(pages << PAGE_SHIFT); |
117 | if (!entry->virtual) { | 111 | if (!entry->virtual) { |
118 | drm_free(entry->busaddr, | 112 | kfree(entry->busaddr); |
119 | entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES); | 113 | kfree(entry->pagelist); |
120 | drm_free(entry->pagelist, | 114 | kfree(entry); |
121 | entry->pages * sizeof(*entry->pagelist), | ||
122 | DRM_MEM_PAGES); | ||
123 | drm_free(entry, sizeof(*entry), DRM_MEM_SGLISTS); | ||
124 | return -ENOMEM; | 115 | return -ENOMEM; |
125 | } | 116 | } |
126 | 117 | ||