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.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_dma.c b/drivers/gpu/drm/drm_dma.c
index 495b5fd2787c..8a140a953754 100644
--- a/drivers/gpu/drm/drm_dma.c
+++ b/drivers/gpu/drm/drm_dma.c
@@ -44,10 +44,18 @@
44 * 44 *
45 * Allocate and initialize a drm_device_dma structure. 45 * Allocate and initialize a drm_device_dma structure.
46 */ 46 */
47int drm_dma_setup(struct drm_device *dev) 47int drm_legacy_dma_setup(struct drm_device *dev)
48{ 48{
49 int i; 49 int i;
50 50
51 if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA) ||
52 drm_core_check_feature(dev, DRIVER_MODESET)) {
53 return 0;
54 }
55
56 dev->buf_use = 0;
57 atomic_set(&dev->buf_alloc, 0);
58
51 dev->dma = kzalloc(sizeof(*dev->dma), GFP_KERNEL); 59 dev->dma = kzalloc(sizeof(*dev->dma), GFP_KERNEL);
52 if (!dev->dma) 60 if (!dev->dma)
53 return -ENOMEM; 61 return -ENOMEM;
@@ -66,11 +74,16 @@ int drm_dma_setup(struct drm_device *dev)
66 * Free all pages associated with DMA buffers, the buffers and pages lists, and 74 * Free all pages associated with DMA buffers, the buffers and pages lists, and
67 * finally the drm_device::dma structure itself. 75 * finally the drm_device::dma structure itself.
68 */ 76 */
69void drm_dma_takedown(struct drm_device *dev) 77void drm_legacy_dma_takedown(struct drm_device *dev)
70{ 78{
71 struct drm_device_dma *dma = dev->dma; 79 struct drm_device_dma *dma = dev->dma;
72 int i, j; 80 int i, j;
73 81
82 if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA) ||
83 drm_core_check_feature(dev, DRIVER_MODESET)) {
84 return;
85 }
86
74 if (!dma) 87 if (!dma)
75 return; 88 return;
76 89