Skip to contentSkip to conversation

drm/amdgpu: use generic DMA API

PATCH In review Nirmoy Das 2 participants 2 messages Nov 20, 2020

Subsystems (2)
lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 drm/amdgpu: use generic DMA API

Use generic DMA api instead of bus-specific API.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -1
index e01e681d2a60..ea55d66b3ef6 100644
@@ -75,7 +75,7 @@ static int amdgpu_gart_dummy_page_init(struct amdgpu_device *adev)
 
 	if (adev->dummy_page_addr)
 		return 0;
-	adev->dummy_page_addr = pci_map_page(adev->pdev, dummy_page, 0,
+	adev->dummy_page_addr = dma_map_page(&adev->pdev->dev, dummy_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");
Signature · 6 lines
2.29.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

Sorry, I missed pci_dma_mapping_error() :/ I will resend.

Nirmoy

Quoted 12 lines · Nirmoy Das

Use generic DMA api instead of bus-specific API.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +0 -0
index e01e681d2a60..ea55d66b3ef6 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c static int amdgpu_gart_dummy_page_init(struct amdgpu_device *adev) · line 81

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -1
@@ -75,7 +75,7 @@ static int amdgpu_gart_dummy_page_init(struct amdgpu_device *adev)
 
  	if (adev->dummy_page_addr)
  		return 0;
-	adev->dummy_page_addr = pci_map_page(adev->pdev, dummy_page, 0,
+	adev->dummy_page_addr = dma_map_page(&adev->pdev->dev, dummy_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");

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx