diff options
Diffstat (limited to 'drivers/gpu/drm/savage/savage_bci.c')
-rw-r--r-- | drivers/gpu/drm/savage/savage_bci.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/gpu/drm/savage/savage_bci.c b/drivers/gpu/drm/savage/savage_bci.c index 456cd040f31..bff6fc2524c 100644 --- a/drivers/gpu/drm/savage/savage_bci.c +++ b/drivers/gpu/drm/savage/savage_bci.c | |||
@@ -298,8 +298,8 @@ static int savage_dma_init(drm_savage_private_t * dev_priv) | |||
298 | 298 | ||
299 | dev_priv->nr_dma_pages = dev_priv->cmd_dma->size / | 299 | dev_priv->nr_dma_pages = dev_priv->cmd_dma->size / |
300 | (SAVAGE_DMA_PAGE_SIZE * 4); | 300 | (SAVAGE_DMA_PAGE_SIZE * 4); |
301 | dev_priv->dma_pages = drm_alloc(sizeof(drm_savage_dma_page_t) * | 301 | dev_priv->dma_pages = kmalloc(sizeof(drm_savage_dma_page_t) * |
302 | dev_priv->nr_dma_pages, DRM_MEM_DRIVER); | 302 | dev_priv->nr_dma_pages, GFP_KERNEL); |
303 | if (dev_priv->dma_pages == NULL) | 303 | if (dev_priv->dma_pages == NULL) |
304 | return -ENOMEM; | 304 | return -ENOMEM; |
305 | 305 | ||
@@ -539,7 +539,7 @@ int savage_driver_load(struct drm_device *dev, unsigned long chipset) | |||
539 | { | 539 | { |
540 | drm_savage_private_t *dev_priv; | 540 | drm_savage_private_t *dev_priv; |
541 | 541 | ||
542 | dev_priv = drm_alloc(sizeof(drm_savage_private_t), DRM_MEM_DRIVER); | 542 | dev_priv = kmalloc(sizeof(drm_savage_private_t), GFP_KERNEL); |
543 | if (dev_priv == NULL) | 543 | if (dev_priv == NULL) |
544 | return -ENOMEM; | 544 | return -ENOMEM; |
545 | 545 | ||
@@ -671,7 +671,7 @@ int savage_driver_unload(struct drm_device *dev) | |||
671 | { | 671 | { |
672 | drm_savage_private_t *dev_priv = dev->dev_private; | 672 | drm_savage_private_t *dev_priv = dev->dev_private; |
673 | 673 | ||
674 | drm_free(dev_priv, sizeof(drm_savage_private_t), DRM_MEM_DRIVER); | 674 | kfree(dev_priv); |
675 | 675 | ||
676 | return 0; | 676 | return 0; |
677 | } | 677 | } |
@@ -804,8 +804,8 @@ static int savage_do_init_bci(struct drm_device * dev, drm_savage_init_t * init) | |||
804 | dev_priv->fake_dma.offset = 0; | 804 | dev_priv->fake_dma.offset = 0; |
805 | dev_priv->fake_dma.size = SAVAGE_FAKE_DMA_SIZE; | 805 | dev_priv->fake_dma.size = SAVAGE_FAKE_DMA_SIZE; |
806 | dev_priv->fake_dma.type = _DRM_SHM; | 806 | dev_priv->fake_dma.type = _DRM_SHM; |
807 | dev_priv->fake_dma.handle = drm_alloc(SAVAGE_FAKE_DMA_SIZE, | 807 | dev_priv->fake_dma.handle = kmalloc(SAVAGE_FAKE_DMA_SIZE, |
808 | DRM_MEM_DRIVER); | 808 | GFP_KERNEL); |
809 | if (!dev_priv->fake_dma.handle) { | 809 | if (!dev_priv->fake_dma.handle) { |
810 | DRM_ERROR("could not allocate faked DMA buffer!\n"); | 810 | DRM_ERROR("could not allocate faked DMA buffer!\n"); |
811 | savage_do_cleanup_bci(dev); | 811 | savage_do_cleanup_bci(dev); |
@@ -903,9 +903,7 @@ static int savage_do_cleanup_bci(struct drm_device * dev) | |||
903 | drm_savage_private_t *dev_priv = dev->dev_private; | 903 | drm_savage_private_t *dev_priv = dev->dev_private; |
904 | 904 | ||
905 | if (dev_priv->cmd_dma == &dev_priv->fake_dma) { | 905 | if (dev_priv->cmd_dma == &dev_priv->fake_dma) { |
906 | if (dev_priv->fake_dma.handle) | 906 | kfree(dev_priv->fake_dma.handle); |
907 | drm_free(dev_priv->fake_dma.handle, | ||
908 | SAVAGE_FAKE_DMA_SIZE, DRM_MEM_DRIVER); | ||
909 | } else if (dev_priv->cmd_dma && dev_priv->cmd_dma->handle && | 907 | } else if (dev_priv->cmd_dma && dev_priv->cmd_dma->handle && |
910 | dev_priv->cmd_dma->type == _DRM_AGP && | 908 | dev_priv->cmd_dma->type == _DRM_AGP && |
911 | dev_priv->dma_type == SAVAGE_DMA_AGP) | 909 | dev_priv->dma_type == SAVAGE_DMA_AGP) |
@@ -920,10 +918,7 @@ static int savage_do_cleanup_bci(struct drm_device * dev) | |||
920 | dev->agp_buffer_map = NULL; | 918 | dev->agp_buffer_map = NULL; |
921 | } | 919 | } |
922 | 920 | ||
923 | if (dev_priv->dma_pages) | 921 | kfree(dev_priv->dma_pages); |
924 | drm_free(dev_priv->dma_pages, | ||
925 | sizeof(drm_savage_dma_page_t) * dev_priv->nr_dma_pages, | ||
926 | DRM_MEM_DRIVER); | ||
927 | 922 | ||
928 | return 0; | 923 | return 0; |
929 | } | 924 | } |