Lines Matching defs:dma
47 dev->dma = drm_calloc(1, sizeof (*dev->dma), DRM_MEM_DMA);
48 if (dev->dma == NULL)
52 pbuf = &(dev->dma->bufs[0]);
62 drm_device_dma_t *dma = dev->dma;
65 if (dma == NULL)
68 /* Clear dma buffers */
70 if (dma->bufs[i].seg_count) {
71 drm_free(dma->bufs[i].seglist,
72 dma->bufs[i].seg_count *
73 sizeof (*dma->bufs[0].seglist), DRM_MEM_SEGS);
76 for (j = 0; j < dma->bufs[i].buf_count; j++) {
77 if (dma->bufs[i].buflist[j].dev_private) {
78 drm_free(dma->bufs[i].buflist[j].dev_private,
79 dma->bufs[i].buflist[j].dev_priv_size,
83 if (dma->bufs[i].buf_count)
84 drm_free(dma->bufs[i].buflist,
85 dma->bufs[i].buf_count *
86 sizeof (*dma->bufs[0].buflist), DRM_MEM_BUFS);
88 if (dma->buflist) {
89 drm_free(dma->buflist,
90 dma->buf_count *sizeof (*dma->buflist),
94 if (dma->pagelist) {
95 drm_free(dma->pagelist,
96 dma->page_count *sizeof (*dma->pagelist),
100 drm_free(dev->dma, sizeof (*dev->dma), DRM_MEM_DRIVER);
101 dev->dma = NULL;
121 drm_device_dma_t *dma = dev->dma;
124 if (!dma)
126 for (i = 0; i < dma->buf_count; i++) {
127 if (dma->buflist[i]->filp == fpriv) {
128 switch (dma->buflist[i]->list) {
130 drm_free_buffer(dev, dma->buflist[i]);
133 dma->buflist[i]->list = DRM_LIST_RECLAIM;