* [PATCH 1/2] drm/amdgpu: update gart_pin_size if bo is in GTT
@ 2016-09-09 6:30 Flora Cui
[not found] ` <1473402651-2395-1-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Flora Cui @ 2016-09-09 6:30 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Flora Cui
Change-Id: Ia2cb8a8f62d0933b7937991bec4eace560745f97
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 5a6216c..296eb6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -376,6 +376,7 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
amdgpu_fill_placement_to_bo(bo, placement);
+
/* Kernel allocation are uninterruptible */
r = ttm_bo_init(&adev->mman.bdev, &bo->tbo, size, type,
&bo->placement, page_align, !kernel, NULL,
@@ -726,7 +727,7 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo)
bo->adev->vram_pin_size -= amdgpu_bo_size(bo);
if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)
bo->adev->invisible_pin_size -= amdgpu_bo_size(bo);
- } else {
+ } else if (bo->tbo.mem.mem_type == TTM_PL_TT) {
bo->adev->gart_pin_size -= amdgpu_bo_size(bo);
}
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset
[not found] ` <1473402651-2395-1-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org>
@ 2016-09-09 6:30 ` Flora Cui
[not found] ` <1473402651-2395-2-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org>
2016-09-09 7:17 ` [PATCH 1/2] drm/amdgpu: update gart_pin_size if bo is in GTT Christian König
1 sibling, 1 reply; 7+ messages in thread
From: Flora Cui @ 2016-09-09 6:30 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Flora Cui
Change-Id: I8112e9d85866104559ecef7449f50fbb94167382
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index a549abd..3d7a3ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1151,7 +1151,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
break;
case TTM_PL_VRAM:
- addr += adev->vm_manager.vram_base_offset;
+ addr += bo_va->bo->tbo.bdev->man[mem->mem_type].gpu_offset;
break;
default:
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* 答复: [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset
[not found] ` <1473402651-2395-2-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org>
@ 2016-09-09 6:40 ` Qu, Jim
2016-09-09 7:18 ` Christian König
1 sibling, 0 replies; 7+ messages in thread
From: Qu, Jim @ 2016-09-09 6:40 UTC (permalink / raw)
To: Cui, Flora,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Hi Flora:
What is the purpose of these patches?
Thanks
JimQu
________________________________________
发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Flora Cui <Flora.Cui@amd.com>
发送时间: 2016年9月9日 14:30:51
收件人: amd-gfx@lists.freedesktop.org
抄送: Cui, Flora
主题: [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset
Change-Id: I8112e9d85866104559ecef7449f50fbb94167382
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index a549abd..3d7a3ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1151,7 +1151,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
break;
case TTM_PL_VRAM:
- addr += adev->vm_manager.vram_base_offset;
+ addr += bo_va->bo->tbo.bdev->man[mem->mem_type].gpu_offset;
break;
default:
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] drm/amdgpu: update gart_pin_size if bo is in GTT
[not found] ` <1473402651-2395-1-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org>
2016-09-09 6:30 ` [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset Flora Cui
@ 2016-09-09 7:17 ` Christian König
1 sibling, 0 replies; 7+ messages in thread
From: Christian König @ 2016-09-09 7:17 UTC (permalink / raw)
To: Flora Cui, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 09.09.2016 um 08:30 schrieb Flora Cui:
> Change-Id: Ia2cb8a8f62d0933b7937991bec4eace560745f97
> Signed-off-by: Flora Cui <Flora.Cui@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 5a6216c..296eb6a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -376,6 +376,7 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
> bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
>
> amdgpu_fill_placement_to_bo(bo, placement);
> +
Unrelated white space change, please remove.
With that fixed the patch is Reviewed-by: Christian König
<christian.koenig@amd.com>.
Regards,
Christian.
> /* Kernel allocation are uninterruptible */
> r = ttm_bo_init(&adev->mman.bdev, &bo->tbo, size, type,
> &bo->placement, page_align, !kernel, NULL,
> @@ -726,7 +727,7 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo)
> bo->adev->vram_pin_size -= amdgpu_bo_size(bo);
> if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)
> bo->adev->invisible_pin_size -= amdgpu_bo_size(bo);
> - } else {
> + } else if (bo->tbo.mem.mem_type == TTM_PL_TT) {
> bo->adev->gart_pin_size -= amdgpu_bo_size(bo);
> }
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset
[not found] ` <1473402651-2395-2-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org>
2016-09-09 6:40 ` 答复: " Qu, Jim
@ 2016-09-09 7:18 ` Christian König
[not found] ` <7b7de55b-a83c-618f-d91a-2174e850d521-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
1 sibling, 1 reply; 7+ messages in thread
From: Christian König @ 2016-09-09 7:18 UTC (permalink / raw)
To: Flora Cui, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
NAK, that is clearly incorrect. The gpu_offset are MC addresses while
the vram_base_offset is a bud address.
Most of the time they are both zero, except for APUs which would break
with this change.
Regards,
Christian.
Am 09.09.2016 um 08:30 schrieb Flora Cui:
> Change-Id: I8112e9d85866104559ecef7449f50fbb94167382
> Signed-off-by: Flora Cui <Flora.Cui@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index a549abd..3d7a3ab 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1151,7 +1151,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
> break;
>
> case TTM_PL_VRAM:
> - addr += adev->vm_manager.vram_base_offset;
> + addr += bo_va->bo->tbo.bdev->man[mem->mem_type].gpu_offset;
> break;
>
> default:
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset
[not found] ` <7b7de55b-a83c-618f-d91a-2174e850d521-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-09-09 7:54 ` Flora Cui
2016-09-09 8:52 ` Christian König
0 siblings, 1 reply; 7+ messages in thread
From: Flora Cui @ 2016-09-09 7:54 UTC (permalink / raw)
To: Christian König; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
what about commit e6eb9e1cdb740f778fbbacc5f62edd0ce97c2d52?
should the start addr get updated either?
On Fri, Sep 09, 2016 at 09:18:47AM +0200, Christian König wrote:
> NAK, that is clearly incorrect. The gpu_offset are MC addresses while the
> vram_base_offset is a bud address.
>
> Most of the time they are both zero, except for APUs which would break with
> this change.
>
> Regards,
> Christian.
>
> Am 09.09.2016 um 08:30 schrieb Flora Cui:
> >Change-Id: I8112e9d85866104559ecef7449f50fbb94167382
> >Signed-off-by: Flora Cui <Flora.Cui@amd.com>
> >---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> >index a549abd..3d7a3ab 100644
> >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> >@@ -1151,7 +1151,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
> > break;
> > case TTM_PL_VRAM:
> >- addr += adev->vm_manager.vram_base_offset;
> >+ addr += bo_va->bo->tbo.bdev->man[mem->mem_type].gpu_offset;
> > break;
> > default:
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset
2016-09-09 7:54 ` Flora Cui
@ 2016-09-09 8:52 ` Christian König
0 siblings, 0 replies; 7+ messages in thread
From: Christian König @ 2016-09-09 8:52 UTC (permalink / raw)
To: Flora Cui; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
No that patch is correct. See we are dealing with different address
spaces here.
The TTM code works with MC addresses. E.g. the internal address space as
seen by everything which runs on system VM (copy operations, ring
buffers, UVD, VCE etc...).
The MC in turn then works with bus addresses which it either send to the
PCIE bus or to the VRAM. Those are just a completely different address
space.
Regards,
Christian.
Am 09.09.2016 um 09:54 schrieb Flora Cui:
> what about commit e6eb9e1cdb740f778fbbacc5f62edd0ce97c2d52?
> should the start addr get updated either?
>
> On Fri, Sep 09, 2016 at 09:18:47AM +0200, Christian König wrote:
>> NAK, that is clearly incorrect. The gpu_offset are MC addresses while the
>> vram_base_offset is a bud address.
>>
>> Most of the time they are both zero, except for APUs which would break with
>> this change.
>>
>> Regards,
>> Christian.
>>
>> Am 09.09.2016 um 08:30 schrieb Flora Cui:
>>> Change-Id: I8112e9d85866104559ecef7449f50fbb94167382
>>> Signed-off-by: Flora Cui <Flora.Cui@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> index a549abd..3d7a3ab 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> @@ -1151,7 +1151,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
>>> break;
>>> case TTM_PL_VRAM:
>>> - addr += adev->vm_manager.vram_base_offset;
>>> + addr += bo_va->bo->tbo.bdev->man[mem->mem_type].gpu_offset;
>>> break;
>>> default:
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-09-09 8:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-09 6:30 [PATCH 1/2] drm/amdgpu: update gart_pin_size if bo is in GTT Flora Cui
[not found] ` <1473402651-2395-1-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org>
2016-09-09 6:30 ` [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset Flora Cui
[not found] ` <1473402651-2395-2-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org>
2016-09-09 6:40 ` 答复: " Qu, Jim
2016-09-09 7:18 ` Christian König
[not found] ` <7b7de55b-a83c-618f-d91a-2174e850d521-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-09 7:54 ` Flora Cui
2016-09-09 8:52 ` Christian König
2016-09-09 7:17 ` [PATCH 1/2] drm/amdgpu: update gart_pin_size if bo is in GTT Christian König
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.