diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_mem.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mem.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_mem.c b/drivers/gpu/drm/radeon/radeon_mem.c index 4af5286a36fb..ed95155c4b1d 100644 --- a/drivers/gpu/drm/radeon/radeon_mem.c +++ b/drivers/gpu/drm/radeon/radeon_mem.c | |||
@@ -43,8 +43,8 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, | |||
43 | { | 43 | { |
44 | /* Maybe cut off the start of an existing block */ | 44 | /* Maybe cut off the start of an existing block */ |
45 | if (start > p->start) { | 45 | if (start > p->start) { |
46 | struct mem_block *newblock = | 46 | struct mem_block *newblock = kmalloc(sizeof(*newblock), |
47 | drm_alloc(sizeof(*newblock), DRM_MEM_BUFS); | 47 | GFP_KERNEL); |
48 | if (!newblock) | 48 | if (!newblock) |
49 | goto out; | 49 | goto out; |
50 | newblock->start = start; | 50 | newblock->start = start; |
@@ -60,8 +60,8 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, | |||
60 | 60 | ||
61 | /* Maybe cut off the end of an existing block */ | 61 | /* Maybe cut off the end of an existing block */ |
62 | if (size < p->size) { | 62 | if (size < p->size) { |
63 | struct mem_block *newblock = | 63 | struct mem_block *newblock = kmalloc(sizeof(*newblock), |
64 | drm_alloc(sizeof(*newblock), DRM_MEM_BUFS); | 64 | GFP_KERNEL); |
65 | if (!newblock) | 65 | if (!newblock) |
66 | goto out; | 66 | goto out; |
67 | newblock->start = start + size; | 67 | newblock->start = start + size; |
@@ -118,7 +118,7 @@ static void free_block(struct mem_block *p) | |||
118 | p->size += q->size; | 118 | p->size += q->size; |
119 | p->next = q->next; | 119 | p->next = q->next; |
120 | p->next->prev = p; | 120 | p->next->prev = p; |
121 | drm_free(q, sizeof(*q), DRM_MEM_BUFS); | 121 | kfree(q); |
122 | } | 122 | } |
123 | 123 | ||
124 | if (p->prev->file_priv == NULL) { | 124 | if (p->prev->file_priv == NULL) { |
@@ -126,7 +126,7 @@ static void free_block(struct mem_block *p) | |||
126 | q->size += p->size; | 126 | q->size += p->size; |
127 | q->next = p->next; | 127 | q->next = p->next; |
128 | q->next->prev = q; | 128 | q->next->prev = q; |
129 | drm_free(p, sizeof(*q), DRM_MEM_BUFS); | 129 | kfree(p); |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 | ||
@@ -134,14 +134,14 @@ static void free_block(struct mem_block *p) | |||
134 | */ | 134 | */ |
135 | static int init_heap(struct mem_block **heap, int start, int size) | 135 | static int init_heap(struct mem_block **heap, int start, int size) |
136 | { | 136 | { |
137 | struct mem_block *blocks = drm_alloc(sizeof(*blocks), DRM_MEM_BUFS); | 137 | struct mem_block *blocks = kmalloc(sizeof(*blocks), GFP_KERNEL); |
138 | 138 | ||
139 | if (!blocks) | 139 | if (!blocks) |
140 | return -ENOMEM; | 140 | return -ENOMEM; |
141 | 141 | ||
142 | *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFS); | 142 | *heap = kmalloc(sizeof(**heap), GFP_KERNEL); |
143 | if (!*heap) { | 143 | if (!*heap) { |
144 | drm_free(blocks, sizeof(*blocks), DRM_MEM_BUFS); | 144 | kfree(blocks); |
145 | return -ENOMEM; | 145 | return -ENOMEM; |
146 | } | 146 | } |
147 | 147 | ||
@@ -179,7 +179,7 @@ void radeon_mem_release(struct drm_file *file_priv, struct mem_block *heap) | |||
179 | p->size += q->size; | 179 | p->size += q->size; |
180 | p->next = q->next; | 180 | p->next = q->next; |
181 | p->next->prev = p; | 181 | p->next->prev = p; |
182 | drm_free(q, sizeof(*q), DRM_MEM_DRIVER); | 182 | kfree(q); |
183 | } | 183 | } |
184 | } | 184 | } |
185 | } | 185 | } |
@@ -196,10 +196,10 @@ void radeon_mem_takedown(struct mem_block **heap) | |||
196 | for (p = (*heap)->next; p != *heap;) { | 196 | for (p = (*heap)->next; p != *heap;) { |
197 | struct mem_block *q = p; | 197 | struct mem_block *q = p; |
198 | p = p->next; | 198 | p = p->next; |
199 | drm_free(q, sizeof(*q), DRM_MEM_DRIVER); | 199 | kfree(q); |
200 | } | 200 | } |
201 | 201 | ||
202 | drm_free(*heap, sizeof(**heap), DRM_MEM_DRIVER); | 202 | kfree(*heap); |
203 | *heap = NULL; | 203 | *heap = NULL; |
204 | } | 204 | } |
205 | 205 | ||