* [PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation
@ 2021-08-25 7:44 Yifan Zhang
2021-08-25 7:46 ` Christian König
0 siblings, 1 reply; 5+ messages in thread
From: Yifan Zhang @ 2021-08-25 7:44 UTC (permalink / raw)
To: amd-gfx; +Cc: christian.koenig, 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.
Signed-off-by: Yifan Zhang <yifan1.zhang@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;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation
2021-08-25 7:44 [PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation Yifan Zhang
@ 2021-08-25 7:46 ` Christian König
2021-08-25 8:04 ` Zhang, Yifan
2021-08-25 13:26 ` Alex Deucher
0 siblings, 2 replies; 5+ messages in thread
From: Christian König @ 2021-08-25 7:46 UTC (permalink / raw)
To: Yifan Zhang, amd-gfx, Alex Deucher
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@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;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation
2021-08-25 7:46 ` Christian König
@ 2021-08-25 8:04 ` Zhang, Yifan
2021-08-25 8:11 ` Christian König
2021-08-25 13:26 ` Alex Deucher
1 sibling, 1 reply; 5+ messages in thread
From: Zhang, Yifan @ 2021-08-25 8:04 UTC (permalink / raw)
To: Koenig, Christian, amd-gfx, Deucher, Alexander
[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@amd.com>
Sent: Wednesday, August 25, 2021 3:47 PM
To: Zhang, Yifan <Yifan1.Zhang@amd.com>; amd-gfx@lists.freedesktop.org; Deucher, Alexander <Alexander.Deucher@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@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;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation
2021-08-25 8:04 ` Zhang, Yifan
@ 2021-08-25 8:11 ` Christian König
0 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2021-08-25 8:11 UTC (permalink / raw)
To: Zhang, Yifan, amd-gfx, Deucher, Alexander
Yes, good point. And we should probably also rename the functions since
page tables are not pinned at all.
Christian.
Am 25.08.21 um 10:04 schrieb Zhang, Yifan:
> [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@amd.com>
> Sent: Wednesday, August 25, 2021 3:47 PM
> To: Zhang, Yifan <Yifan1.Zhang@amd.com>; amd-gfx@lists.freedesktop.org; Deucher, Alexander <Alexander.Deucher@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@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;
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation
2021-08-25 7:46 ` Christian König
2021-08-25 8:04 ` Zhang, Yifan
@ 2021-08-25 13:26 ` Alex Deucher
1 sibling, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2021-08-25 13:26 UTC (permalink / raw)
To: Christian König; +Cc: Yifan Zhang, amd-gfx list, Alex Deucher
On Wed, Aug 25, 2021 at 4:01 AM Christian König
<christian.koenig@amd.com> wrote:
>
> 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?
I think we can just enable them on dGPUs and APUs >= Renoir.
Alex
>
> Regards,
> Christian.
>
> >
> > Signed-off-by: Yifan Zhang <yifan1.zhang@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;
> >
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-25 13:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 7:44 [PATCH] drm/amdgpu: remove preferred domain judgement in pt/pd creation Yifan Zhang
2021-08-25 7:46 ` Christian König
2021-08-25 8:04 ` Zhang, Yifan
2021-08-25 8:11 ` Christian König
2021-08-25 13:26 ` Alex Deucher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.