drm/amdgpu: add print for iommu translation mode
Subsystems (2)
PATCH v2 1/1 drm/amdgpu: add print for iommu translation mode
Add log to display whether RAM is direct vs DMA mapped.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -1
@@ -3528,8 +3528,12 @@ static void amdgpu_device_check_iommu_direct_map(struct amdgpu_device *adev)struct iommu_domain *domain; domain =iommu_get_domain_for_dev (adev->dev); -if (!domain || domain->type ==IOMMU_DOMAIN_IDENTITY ) +if (!domain || domain->type ==IOMMU_DOMAIN_IDENTITY ) { +dev_info (adev->dev,"RAM is direct mapped to GPU (not translated by IOMMU)\n" ); adev->ram_is_direct_mapped = true; + }else { +dev_info (adev->dev,"RAM is DMA mapped to GPU (translated by IOMMU)\n" ); + } }static const struct attribute *amdgpu_dev_attributes[] = {
Signature · 1 line
2.25.1
Quoted 3 lines · Graham Sider
Add log to display whether RAM is direct vs DMA mapped.
Signed-off-by Graham Sider <[email protected]>
Quoted 22 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5
-1@@ -3528,8 +3528,12 @@ static void amdgpu_device_check_iommu_direct_map(struct amdgpu_device *adev)struct iommu_domain *domain; domain =iommu_get_domain_for_dev (adev->dev); -if (!domain || domain->type ==IOMMU_DOMAIN_IDENTITY ) +if (!domain || domain->type ==IOMMU_DOMAIN_IDENTITY ) { +dev_info (adev->dev,"RAM is direct mapped to GPU (not translated by IOMMU)\n" ); adev->ram_is_direct_mapped = true; + }else { +dev_info (adev->dev,"RAM is DMA mapped to GPU (translated by IOMMU)\n" ); + } }static const struct attribute *amdgpu_dev_attributes[] = {
[AMD Official Use Only - General]
Ping :)
Best,
Graham
Quoted 41 lines
-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Monday, March 20, 2023 12:16 PM
To: Sider, Graham <[email protected]>; amd- [email protected]
Subject: Re: [PATCH v2] drm/amdgpu: add print for iommu translation modeQuoted 3 lines · Graham Sider
Add log to display whether RAM is direct vs DMA mapped.
Signed-off-by Graham Sider <[email protected]>Acked-by Felix Kuehling <[email protected]>Review
Quoted 5 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.cdrivers/gpu/drm/amd/amdgpu/amdgpu_device.c static void
Quoted 4 lines
index
3bd6c5aef796..83774824694b100644drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0@@ -3528,8 +3528,12 @@ static void
amdgpu_device_check_iommu_direct_map(struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static void amdgpu_device_check_iommu_direct_map(struct amdgpu_device *adev)
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2
-1struct iommu_domain *domain; domain =iommu_get_domain_for_dev (adev->dev); -if (!domain || domain->type ==IOMMU_DOMAIN_IDENTITY ) +if (!domain || domain->type ==IOMMU_DOMAIN_IDENTITY ) { + dev_info(adev->dev, "RAM is direct mapped to GPU (nottranslated by IOMMU)\n");
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static void amdgpu_device_check_iommu_direct_map(struct amdgpu_device *adev)
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2
-0adev->ram_is_direct_mapped = true; + }else { + dev_info(adev->dev, "RAM is DMA mapped to GPU(translated by IOMMU)\n");
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-0+ } }static const struct attribute *amdgpu_dev_attributes[] = {