[PATCH v2 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs
Christian König
christian.koenig at amd.com
Thu Aug 24 14:56:44 UTC 2023
Am 24.08.23 um 15:53 schrieb Yifan Zhang:
> To decrease VRAM pressure for APUs, put page tables to
> GTT domain for gfx10 and newer APUs.
>
> v2: only enable it for gfx10 and newer APUs (Alex, Christian)
>
> Signed-off-by: Yifan Zhang <yifan1.zhang at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> index 96d601e209b8..b108d92883d9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> @@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> bp.size = amdgpu_vm_pt_size(adev, level);
> bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
>
> - if (!adev->gmc.is_app_apu)
> - bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
> - else
> + if (adev->gmc.is_app_apu ||
> + ((adev->flags & AMD_IS_APU) &&
> + (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
Please double check the coding style this doesn't looks correctly
indented to me.
Apart from that looks good to me,
Christian.
> bp.domain = AMDGPU_GEM_DOMAIN_GTT;
> + else
> + bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
> +
>
> bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);
> bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
More information about the amd-gfx
mailing list