aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-12-15 16:28:33 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-18 10:59:52 -0500
commit55e0037aab6503453eef663eded60e530896eaef (patch)
tree6270773bc0fa441060a0233fe594183c2bd4b235 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parent39c640c086ad12005e88cf6f9de03c32111ef081 (diff)
drm/amdgpu: move dummy page functions to amdgpu_gart.c
It's the only place they are used. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 8cc3dcf120d0..0080776c4936 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -724,51 +724,6 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
724 return true; 724 return true;
725} 725}
726 726
727/**
728 * amdgpu_dummy_page_init - init dummy page used by the driver
729 *
730 * @adev: amdgpu_device pointer
731 *
732 * Allocate the dummy page used by the driver (all asics).
733 * This dummy page is used by the driver as a filler for gart entries
734 * when pages are taken out of the GART
735 * Returns 0 on sucess, -ENOMEM on failure.
736 */
737int amdgpu_dummy_page_init(struct amdgpu_device *adev)
738{
739 if (adev->dummy_page.page)
740 return 0;
741 adev->dummy_page.page = alloc_page(GFP_DMA32 | GFP_KERNEL | __GFP_ZERO);
742 if (adev->dummy_page.page == NULL)
743 return -ENOMEM;
744 adev->dummy_page.addr = pci_map_page(adev->pdev, adev->dummy_page.page,
745 0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
746 if (pci_dma_mapping_error(adev->pdev, adev->dummy_page.addr)) {
747 dev_err(&adev->pdev->dev, "Failed to DMA MAP the dummy page\n");
748 __free_page(adev->dummy_page.page);
749 adev->dummy_page.page = NULL;
750 return -ENOMEM;
751 }
752 return 0;
753}
754
755/**
756 * amdgpu_dummy_page_fini - free dummy page used by the driver
757 *
758 * @adev: amdgpu_device pointer
759 *
760 * Frees the dummy page used by the driver (all asics).
761 */
762void amdgpu_dummy_page_fini(struct amdgpu_device *adev)
763{
764 if (adev->dummy_page.page == NULL)
765 return;
766 pci_unmap_page(adev->pdev, adev->dummy_page.addr,
767 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
768 __free_page(adev->dummy_page.page);
769 adev->dummy_page.page = NULL;
770}
771
772/* if we get transitioned to only one device, take VGA back */ 727/* if we get transitioned to only one device, take VGA back */
773/** 728/**
774 * amdgpu_device_vga_set_decode - enable/disable vga decode 729 * amdgpu_device_vga_set_decode - enable/disable vga decode