[PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation
Zhang, Yifan
Yifan1.Zhang at amd.com
Wed Aug 25 08:04:36 UTC 2021
[Public]
Hi Christian,
OK. Then I think we should modify the document for amdgpu_bo_get_preferred_pin_domain since it is not only for display scanout, right ?
/**
* amdgpu_bo_get_preferred_pin_domain - get preferred domain for scanout
* @adev: amdgpu device object
* @domain: allowed :ref:`memory domains <amdgpu_memory_domains>`
*
* Returns:
* Which of the allowed domains is preferred for pinning the BO for scanout.
*/
uint32_t amdgpu_bo_get_preferred_pin_domain(struct amdgpu_device *adev,
uint32_t domain)
{
if (domain == (AMDGPU_GEM_DOMAIN_VRAM | AMDGPU_GEM_DOMAIN_GTT)) {
domain = AMDGPU_GEM_DOMAIN_VRAM;
if (adev->gmc.real_vram_size <= AMDGPU_SG_THRESHOLD)
domain = AMDGPU_GEM_DOMAIN_GTT;
}
return domain;
}
BRs,
Yifan
-----Original Message-----
From: Koenig, Christian <Christian.Koenig at amd.com>
Sent: Wednesday, August 25, 2021 3:47 PM
To: Zhang, Yifan <Yifan1.Zhang at amd.com>; amd-gfx at lists.freedesktop.org; Deucher, Alexander <Alexander.Deucher at amd.com>
Subject: Re: [PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation
Am 25.08.21 um 09:44 schrieb Yifan Zhang:
> amdgpu_bo_get_preferred_pin_domain was added to handle system memory
> page tables. Since system memory pt/pd is disabled now, remove
> preferred domain judgement to avoid confusion.
Well I would rather keep that and enable system memory page tables again.
We should probably add IOMMU checks to
amdgpu_bo_get_preferred_pin_domain() anyway. My last status is that this has been causing problems with DC as well.
Alex, what do you think?
Regards,
Christian.
>
> Signed-off-by: Yifan Zhang <yifan1.zhang at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 0b893aa21ffe..764822edba18 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -926,7 +926,6 @@ static int amdgpu_vm_pt_create(struct amdgpu_device *adev,
> bp.size = amdgpu_vm_bo_size(adev, level);
> bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
> bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
> - bp.domain = amdgpu_bo_get_preferred_pin_domain(adev, bp.domain);
> bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
> AMDGPU_GEM_CREATE_CPU_GTT_USWC;
>
More information about the amd-gfx
mailing list