Home | History | Annotate | Download | only in drm

Lines Matching defs:dma

5  * DMA IOCTL and function support
50 * Initialize the DMA data.
68 dev->dma = kzalloc(sizeof(*dev->dma), GFP_KERNEL);
69 if (!dev->dma)
73 memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0]));
79 * Cleanup the DMA resources.
83 * Free all pages associated with DMA buffers, the buffers and pages lists, and
84 * finally the drm_device::dma structure itself.
88 struct drm_device_dma *dma = dev->dma;
95 if (!dma)
98 /* Clear dma buffers */
100 if (dma->bufs[i].seg_count) {
104 dma->bufs[i].buf_count,
105 dma->bufs[i].seg_count);
106 for (j = 0; j < dma->bufs[i].seg_count; j++) {
107 if (dma->bufs[i].seglist[j]) {
108 drm_pci_free(dev, dma->bufs[i].seglist[j]);
111 kfree(dma->bufs[i].seglist);
113 if (dma->bufs[i].buf_count) {
114 for (j = 0; j < dma->bufs[i].buf_count; j++) {
115 kfree(dma->bufs[i].buflist[j].dev_private);
117 kfree(dma->bufs[i].buflist);
121 kfree(dma->buflist);
122 kfree(dma->pagelist);
123 kfree(dev->dma);
124 dev->dma = NULL;
156 struct drm_device_dma *dma = dev->dma;
159 if (!dma)
161 for (i = 0; i < dma->buf_count; i++) {
162 if (dma->buflist[i]->file_priv == file_priv) {
163 switch (dma->buflist[i]->list) {
165 drm_legacy_free_buffer(dev, dma->buflist[i]);
168 dma->buflist[i]->list = DRM_LIST_RECLAIM;