aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_dma.c')
-rw-r--r--drivers/gpu/drm/drm_dma.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/drivers/gpu/drm/drm_dma.c b/drivers/gpu/drm/drm_dma.c
index 7a8e2fba4678..13f1537413fb 100644
--- a/drivers/gpu/drm/drm_dma.c
+++ b/drivers/gpu/drm/drm_dma.c
@@ -47,7 +47,7 @@ int drm_dma_setup(struct drm_device *dev)
47{ 47{
48 int i; 48 int i;
49 49
50 dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER); 50 dev->dma = kmalloc(sizeof(*dev->dma), GFP_KERNEL);
51 if (!dev->dma) 51 if (!dev->dma)
52 return -ENOMEM; 52 return -ENOMEM;
53 53
@@ -88,36 +88,19 @@ void drm_dma_takedown(struct drm_device *dev)
88 drm_pci_free(dev, dma->bufs[i].seglist[j]); 88 drm_pci_free(dev, dma->bufs[i].seglist[j]);
89 } 89 }
90 } 90 }
91 drm_free(dma->bufs[i].seglist, 91 kfree(dma->bufs[i].seglist);
92 dma->bufs[i].seg_count
93 * sizeof(*dma->bufs[0].seglist), DRM_MEM_SEGS);
94 } 92 }
95 if (dma->bufs[i].buf_count) { 93 if (dma->bufs[i].buf_count) {
96 for (j = 0; j < dma->bufs[i].buf_count; j++) { 94 for (j = 0; j < dma->bufs[i].buf_count; j++) {
97 if (dma->bufs[i].buflist[j].dev_private) { 95 kfree(dma->bufs[i].buflist[j].dev_private);
98 drm_free(dma->bufs[i].buflist[j].
99 dev_private,
100 dma->bufs[i].buflist[j].
101 dev_priv_size, DRM_MEM_BUFS);
102 }
103 } 96 }
104 drm_free(dma->bufs[i].buflist, 97 kfree(dma->bufs[i].buflist);
105 dma->bufs[i].buf_count *
106 sizeof(*dma->bufs[0].buflist), DRM_MEM_BUFS);
107 } 98 }
108 } 99 }
109 100
110 if (dma->buflist) { 101 kfree(dma->buflist);
111 drm_free(dma->buflist, 102 kfree(dma->pagelist);
112 dma->buf_count * sizeof(*dma->buflist), DRM_MEM_BUFS); 103 kfree(dev->dma);
113 }
114
115 if (dma->pagelist) {
116 drm_free(dma->pagelist,
117 dma->page_count * sizeof(*dma->pagelist),
118 DRM_MEM_PAGES);
119 }
120 drm_free(dev->dma, sizeof(*dev->dma), DRM_MEM_DRIVER);
121 dev->dma = NULL; 104 dev->dma = NULL;
122} 105}
123 106