drm_dma.c (814aaaa7da4dab462d90e12e7b48b75f2093ccfd) | drm_dma.c (b4b4b5304bd22eab265c9c049cb7fc6b55c4ef3f) |
---|---|
1/** 2 * \file drm_dma.c 3 * DMA IOCTL and function support 4 * 5 * \author Rickard E. (Rik) Faith <faith@valinux.com> 6 * \author Gareth Hughes <gareth@valinux.com> 7 */ 8 --- 23 unchanged lines hidden (view full) --- 32 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 33 * OTHER DEALINGS IN THE SOFTWARE. 34 */ 35 36#include <sys/cdefs.h> 37__FBSDID("$FreeBSD$"); 38 39#include <dev/drm2/drmP.h> | 1/** 2 * \file drm_dma.c 3 * DMA IOCTL and function support 4 * 5 * \author Rickard E. (Rik) Faith <faith@valinux.com> 6 * \author Gareth Hughes <gareth@valinux.com> 7 */ 8 --- 23 unchanged lines hidden (view full) --- 32 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 33 * OTHER DEALINGS IN THE SOFTWARE. 34 */ 35 36#include <sys/cdefs.h> 37__FBSDID("$FreeBSD$"); 38 39#include <dev/drm2/drmP.h> |
40#include <linux/slab.h> | |
41 42/** 43 * Initialize the DMA data. 44 * 45 * \param dev DRM device. 46 * \return zero on success or a negative value on failure. 47 * 48 * Allocate and initialize a drm_device_dma structure. --- 36 unchanged lines hidden (view full) --- 85 i, 86 dma->bufs[i].buf_count, 87 dma->bufs[i].seg_count); 88 for (j = 0; j < dma->bufs[i].seg_count; j++) { 89 if (dma->bufs[i].seglist[j]) { 90 drm_pci_free(dev, dma->bufs[i].seglist[j]); 91 } 92 } | 40 41/** 42 * Initialize the DMA data. 43 * 44 * \param dev DRM device. 45 * \return zero on success or a negative value on failure. 46 * 47 * Allocate and initialize a drm_device_dma structure. --- 36 unchanged lines hidden (view full) --- 84 i, 85 dma->bufs[i].buf_count, 86 dma->bufs[i].seg_count); 87 for (j = 0; j < dma->bufs[i].seg_count; j++) { 88 if (dma->bufs[i].seglist[j]) { 89 drm_pci_free(dev, dma->bufs[i].seglist[j]); 90 } 91 } |
93 kfree(dma->bufs[i].seglist); | 92 free(dma->bufs[i].seglist, DRM_MEM_SEGS); |
94 } 95 if (dma->bufs[i].buf_count) { 96 for (j = 0; j < dma->bufs[i].buf_count; j++) { | 93 } 94 if (dma->bufs[i].buf_count) { 95 for (j = 0; j < dma->bufs[i].buf_count; j++) { |
97 kfree(dma->bufs[i].buflist[j].dev_private); | 96 free(dma->bufs[i].buflist[j].dev_private, 97 DRM_MEM_BUFS); |
98 } | 98 } |
99 kfree(dma->bufs[i].buflist); | 99 free(dma->bufs[i].buflist, DRM_MEM_BUFS); |
100 } 101 } 102 | 100 } 101 } 102 |
103 kfree(dma->buflist); | 103 free(dma->buflist, DRM_MEM_BUFS); |
104 free(dma->pagelist, DRM_MEM_PAGES); 105 free(dev->dma, DRM_MEM_DRIVER); 106 dev->dma = NULL; 107} 108 109/** 110 * Free a buffer. 111 * --- 49 unchanged lines hidden --- | 104 free(dma->pagelist, DRM_MEM_PAGES); 105 free(dev->dma, DRM_MEM_DRIVER); 106 dev->dma = NULL; 107} 108 109/** 110 * Free a buffer. 111 * --- 49 unchanged lines hidden --- |