mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
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>
This commit is contained in:
@@ -724,51 +724,6 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_dummy_page_init - init dummy page used by the driver
|
||||
*
|
||||
* @adev: amdgpu_device pointer
|
||||
*
|
||||
* Allocate the dummy page used by the driver (all asics).
|
||||
* This dummy page is used by the driver as a filler for gart entries
|
||||
* when pages are taken out of the GART
|
||||
* Returns 0 on sucess, -ENOMEM on failure.
|
||||
*/
|
||||
int amdgpu_dummy_page_init(struct amdgpu_device *adev)
|
||||
{
|
||||
if (adev->dummy_page.page)
|
||||
return 0;
|
||||
adev->dummy_page.page = alloc_page(GFP_DMA32 | GFP_KERNEL | __GFP_ZERO);
|
||||
if (adev->dummy_page.page == NULL)
|
||||
return -ENOMEM;
|
||||
adev->dummy_page.addr = pci_map_page(adev->pdev, adev->dummy_page.page,
|
||||
0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
|
||||
if (pci_dma_mapping_error(adev->pdev, adev->dummy_page.addr)) {
|
||||
dev_err(&adev->pdev->dev, "Failed to DMA MAP the dummy page\n");
|
||||
__free_page(adev->dummy_page.page);
|
||||
adev->dummy_page.page = NULL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_dummy_page_fini - free dummy page used by the driver
|
||||
*
|
||||
* @adev: amdgpu_device pointer
|
||||
*
|
||||
* Frees the dummy page used by the driver (all asics).
|
||||
*/
|
||||
void amdgpu_dummy_page_fini(struct amdgpu_device *adev)
|
||||
{
|
||||
if (adev->dummy_page.page == NULL)
|
||||
return;
|
||||
pci_unmap_page(adev->pdev, adev->dummy_page.addr,
|
||||
PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
|
||||
__free_page(adev->dummy_page.page);
|
||||
adev->dummy_page.page = NULL;
|
||||
}
|
||||
|
||||
/* if we get transitioned to only one device, take VGA back */
|
||||
/**
|
||||
* amdgpu_device_vga_set_decode - enable/disable vga decode
|
||||
|
||||
Reference in New Issue
Block a user