Lines Matching defs:dma
50 dev->dma = drm_calloc(1, sizeof (*dev->dma), DRM_MEM_DMA);
51 if (dev->dma == NULL)
55 pbuf = &(dev->dma->bufs[0]);
65 drm_device_dma_t *dma = dev->dma;
68 if (dma == NULL)
71 /* Clear dma buffers */
73 if (dma->bufs[i].seg_count) {
74 drm_free(dma->bufs[i].seglist,
75 dma->bufs[i].seg_count *
76 sizeof (*dma->bufs[0].seglist), DRM_MEM_SEGS);
79 for (j = 0; j < dma->bufs[i].buf_count; j++) {
80 if (dma->bufs[i].buflist[j].dev_private) {
81 drm_free(dma->bufs[i].buflist[j].dev_private,
82 dma->bufs[i].buflist[j].dev_priv_size,
86 if (dma->bufs[i].buf_count)
87 drm_free(dma->bufs[i].buflist,
88 dma->bufs[i].buf_count *
89 sizeof (*dma->bufs[0].buflist), DRM_MEM_BUFS);
91 if (dma->buflist) {
92 drm_free(dma->buflist,
93 dma->buf_count *sizeof (*dma->buflist),
97 if (dma->pagelist) {
98 drm_free(dma->pagelist,
99 dma->page_count *sizeof (*dma->pagelist),
103 drm_free(dev->dma, sizeof (*dev->dma), DRM_MEM_DRIVER);
104 dev->dma = NULL;
124 drm_device_dma_t *dma = dev->dma;
127 if (!dma)
129 for (i = 0; i < dma->buf_count; i++) {
130 if (dma->buflist[i]->filp == fpriv) {
131 switch (dma->buflist[i]->list) {
133 drm_free_buffer(dev, dma->buflist[i]);
136 dma->buflist[i]->list = DRM_LIST_RECLAIM;