drm/amdgpu: use the actual placement for pin accounting
Subsystems (3)
PATCH 1/8 drm/amdgpu: use the actual placement for pin accounting
From: Christian König <[email protected]>
This allows us to specify multiple possible placements again.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -0
@@ -697,6 +697,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, } *gpu_addr =amdgpu_bo_gpu_offset (bo); } + + domain =amdgpu_mem_type_to_domain (bo->tbo.mem.mem_type);if (domain ==AMDGPU_GEM_DOMAIN_VRAM ) { adev->vram_pin_size +=amdgpu_bo_size (bo);if (bo->flags &AMDGPU_GEM_CREATE_NO_CPU_ACCESS )
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509033983-2977-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
PATCH 2/8 drm/amdgpu: always bind pinned BOs
From: Christian König <[email protected]>
We always need to bind pinned BOs, not just when the caller requested the address.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +7 -7
@@ -688,15 +688,15 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, goto error; } + r =amdgpu_ttm_bind (&bo->tbo, &bo->tbo.mem); +if (unlikely (r)) { +dev_err (adev->dev,"%p bind failed\n" , bo); + goto error; + } + bo->pin_count =1 ; -if (gpu_addr !=NULL ) { - r =amdgpu_ttm_bind (&bo->tbo, &bo->tbo.mem); -if (unlikely (r)) { -dev_err (adev->dev,"%p bind failed\n" , bo); - goto error; - } +if (gpu_addr !=NULL ) *gpu_addr =amdgpu_bo_gpu_offset (bo); - } domain =amdgpu_mem_type_to_domain (bo->tbo.mem.mem_type);if (domain ==AMDGPU_GEM_DOMAIN_VRAM ) {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509033983-2977-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 2/8] drm/amdgpu: always bind pinned BOs
Quoted 7 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 2/8] drm/amdgpu: always bind pinned BOs
Quoted 6 lines
From: Christian König <[email protected]>
We always need to bind pinned BOs, not just when the caller requested the address.
Signed-off-by Christian König <[email protected]>
Should this go to stable as well?
Alex
Quoted 33 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +7
-7@@ -688,15 +688,15 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, goto error; } + r =amdgpu_ttm_bind (&bo->tbo, &bo->tbo.mem); +if (unlikely (r)) { +dev_err (adev->dev,"%p bind failed\n" , bo); + goto error; + } + bo->pin_count =1 ; -if (gpu_addr !=NULL ) { - r =amdgpu_ttm_bind (&bo->tbo, &bo->tbo.mem); -if (unlikely (r)) { -dev_err (adev->dev,"%p bind failed\n" , bo); - goto error; - } +if (gpu_addr !=NULL ) *gpu_addr =amdgpu_bo_gpu_offset (bo); - } domain = amdgpu_mem_type_to_domain(bo-Quoted 1 line
tbo.mem.mem_type);
Quoted 8 lines
if (domain ==
AMDGPU_GEM_DOMAIN_VRAM) {
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB165231D62C6A835680DCF860F7450-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 2/8] drm/amdgpu: always bind pinned BOs
Am 26.10.2017 um 19:55 schrieb Deucher, Alexander:
Quoted 9 lines
Quoted 9 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 2/8] drm/amdgpu: always bind pinned BOsFrom: Christian König <[email protected]>
Quoted 7 lines
Quoted 4 lines
We always need to bind pinned BOs, not just when the caller requested the address.
Signed-off-by Christian König <[email protected]>Reviewed-by Alex Deucher <[email protected]>Should this go to stable as well?
Good question. As far as I can see it didn't made a difference so far cause all users of pinned GART BOs provided an address as well.
Just the framebuffer code doesn't do this and so I stumbled over it when allowing scanout from GART.
Christian.
Quoted 40 lines
Alex
Quoted 37 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +7
-7@@ -688,15 +688,15 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, goto error; } + r =amdgpu_ttm_bind (&bo->tbo, &bo->tbo.mem); +if (unlikely (r)) { +dev_err (adev->dev,"%p bind failed\n" , bo); + goto error; + } + bo->pin_count =1 ; -if (gpu_addr !=NULL ) { - r =amdgpu_ttm_bind (&bo->tbo, &bo->tbo.mem); -if (unlikely (r)) { -dev_err (adev->dev,"%p bind failed\n" , bo); - goto error; - } +if (gpu_addr !=NULL ) *gpu_addr =amdgpu_bo_gpu_offset (bo); - } domain = amdgpu_mem_type_to_domain(bo-Quoted 1 line
tbo.mem.mem_type);
if (domain ==
AMDGPU_GEM_DOMAIN_VRAM) {
--
2.7.4
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/8 drm/amdgpu: fix pin domain compatibility check
In reply to a message not in the archiveFrom: Christian König <[email protected]>
We need to test if any domain fits, not all of them.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -1
@@ -647,7 +647,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,if (bo->pin_count) {uint32_t mem_type = bo->tbo.mem.mem_type; -if (domain !=amdgpu_mem_type_to_domain (mem_type)) +if (!(domain &amdgpu_mem_type_to_domain (mem_type)))return -EINVAL ; bo->pin_count++;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509033983-2977-3-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 3/8] drm/amdgpu: fix pin domain compatibility check
Quoted 7 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 3/8] drm/amdgpu: fix pin domain compatibility check
Quoted 5 lines
From: Christian König <[email protected]>
We need to test if any domain fits, not all of them.
Signed-off-by Christian König <[email protected]>
Quoted 19 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-1@@ -647,7 +647,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, if (bo->pin_count) {uint32_t mem_type = bo->tbo.mem.mem_type; -if (domain !=amdgpu_mem_type_to_domain (mem_type)) +if (!(domain &amdgpu_mem_type_to_domain (mem_type)))return -EINVAL ;
Quoted 8 lines
bo->pin_count++;
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/8 drm/amdgpu: don't wait interruptible while binding GART space
In reply to a message not in the archiveFrom: Christian König <[email protected]>
Display can't seem to handle this correctly.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -913,7 +913,7 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem) placements.flags = (bo->mem.placement & ~TTM_PL_MASK_MEM ) |TTM_PL_FLAG_TT ; - r =ttm_bo_mem_space (bo, &placement, &tmp, true, false); + r =ttm_bo_mem_space (bo, &placement, &tmp, false, false);if (unlikely (r))return r;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509033983-2977-4-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Deucher, Alexander
Acked-by Alex DeucherRE: [PATCH 4/8] drm/amdgpu: don't wait interruptible while binding GART space
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 4/8] drm/amdgpu: don't wait interruptible while binding GART space
Quoted 5 lines
From: Christian König <[email protected]>
Display can't seem to handle this correctly.
Signed-off-by Christian König <[email protected]>
Quoted 23 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0@@ -913,7 +913,7 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem) placements.flags = (bo->mem.placement & ~TTM_PL_MASK_MEM)|
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-2TTM_PL_FLAG_TT ; - r =ttm_bo_mem_space (bo, &placement, &tmp, true, false); + r =ttm_bo_mem_space (bo, &placement, &tmp, false, false);if (unlikely (r))return r; --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB16521DDD4DFA885F641C0702F7450-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 4/8] drm/amdgpu: don't wait interruptible while binding GART space
Am 26.10.2017 um 19:56 schrieb Deucher, Alexander:
Quoted 8 lines
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 4/8] drm/amdgpu: don't wait interruptible while binding GART space
Quoted 6 lines
Quoted 5 lines
From: Christian König <[email protected]>
Display can't seem to handle this correctly.
Signed-off-by Christian König <[email protected]>Acked-by Alex Deucher <[email protected]>
BTW: Harry & Andrey:
It is probably a good idea to actually wait interruptible here.
How problematic would it be for you guys to allow that?
The only negative effect I could find of hand is some error printing in the DC code.
Christian.
Quoted 24 lines
Quoted 24 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0@@ -913,7 +913,7 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem) placements.flags = (bo->mem.placement & ~TTM_PL_MASK_MEM)|
TTM_PL_FLAG_TT;drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-2- r =ttm_bo_mem_space (bo, &placement, &tmp, true, false); + r =ttm_bo_mem_space (bo, &placement, &tmp, false, false);if (unlikely (r))return r; --2.7.4
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 62a8b570-df06-6447-29e1-0d61c4064213-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH 4/8] drm/amdgpu: don't wait interruptible while binding GART space
Quoted 16 lines · Christian König
Am 26.10.2017 um 19:56 schrieb Deucher, Alexander:
Quoted 8 lines
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 4/8] drm/amdgpu: don't wait interruptible while binding GART spaceQuoted 6 lines
Quoted 5 lines
From: Christian König <[email protected]>
Display can't seem to handle this correctly.
Signed-off-by Christian König <[email protected]>Acked-by Alex Deucher <[email protected]>
Quoted 7 lines
BTW: Harry & Andrey:
It is probably a good idea to actually wait interruptible here.
How problematic would it be for you guys to allow that?
The only negative effect I could find of hand is some error printing in the DC code.
It shouldn't be an issue, as i trace this call i see it's gonna impact dm_plane_helper_prepare_fb through calling amdgpu_bo_pin, so instead of treating any r != 0 as error we just should gracefully return for EINTR there w\o printing error.
Thanks,
Andrey
Quoted 37 lines
Christian.
Quoted 32 lines
Quoted 28 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0@@ -913,7 +913,7 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem) placements.flags = (bo->mem.placement & ~TTM_PL_MASK_MEM)|
TTM_PL_FLAG_TT;drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-1- r =ttm_bo_mem_space (bo, &placement, &tmp, true, false); + r =ttm_bo_mem_space (bo, &placement, &tmp, false, false);if (unlikely (r))return r;Signature · 7 lines
-- 2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): d2eec3af-6f38-202c-c264-0c388264616d-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 4/8] drm/amdgpu: don't wait interruptible while binding GART space
Quoted 21 lines · Andrey Grodzovsky
Quoted 18 lines · Christian König
Am 26.10.2017 um 19:56 schrieb Deucher, Alexander:
Quoted 8 lines
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 4/8] drm/amdgpu: don't wait interruptible while binding GART spaceQuoted 6 lines
Quoted 5 lines
From: Christian König <[email protected]>
Display can't seem to handle this correctly.
Signed-off-by Christian König <[email protected]>Acked-by Alex Deucher <[email protected]>BTW: Harry & Andrey:
Quoted 9 lines
Quoted 5 lines
It is probably a good idea to actually wait interruptible here.
How problematic would it be for you guys to allow that?
The only negative effect I could find of hand is some error printing in the DC code.
It shouldn't be an issue, as i trace this call i see it's gonna impact
dm_plane_helper_prepare_fbthrough callingamdgpu_bo_pin, so instead of treating any r != 0 as error we just should gracefully return for EINTR there w\o printing error.
I tend to agree. It should already work. Just sent a patch, though, to not print an error on EINTR.
Harry
Quoted 41 lines
Thanks,
AndreyQuoted 37 lines
Christian.
Quoted 32 lines
Quoted 21 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0@@ -913,7 +913,7 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem) placements.flags = (bo->mem.placement & ~TTM_PL_MASK_MEM)|
TTM_PL_FLAG_TT;- r =
ttm_bo_mem_space(bo, &placement, &tmp, true, false); + r =ttm_bo_mem_space(bo, &placement, &tmp, false, false); if (unlikely(r))
return r;Quoted 7 lines
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/8 drm/amdgpu: don't use ttm_bo_move_ttm in amdgpu_ttm_bind
In reply to a message not in the archiveFrom: Christian König <[email protected]>
Just unbind and rebind to force updates of the GART space.
This prevents forcing the BO to be idle.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +18 -6
@@ -917,14 +917,26 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem)if (unlikely (r))return r; - r =ttm_bo_move_ttm (bo, true, false, &tmp); -if (unlikely (r)) +if (ttm->state == tt_bound) { + r = ttm->func->unbind (ttm); +if (unlikely (r)) +return r; + + ttm->state = tt_unbound; + } + + r =ttm_tt_bind (ttm, &tmp); +if (unlikely (r)) {ttm_bo_mem_put (bo, &tmp); -else - bo->offset = (bo->mem.start <<PAGE_SHIFT ) + - bo->bdev->man[bo->mem.mem_type].gpu_offset; +return r; + } -return r; +ttm_bo_mem_put (bo, bo_mem); + bo->mem = tmp; + bo->offset = (bo->mem.start <<PAGE_SHIFT ) + + bo->bdev->man[bo->mem.mem_type].gpu_offset; + +return 0 ; }int amdgpu_ttm_recover_gart (struct amdgpu_device *adev)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509033983-2977-5-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
RE: [PATCH 5/8] drm/amdgpu: don't use ttm_bo_move_ttm in amdgpu_ttm_bind
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 5/8] drm/amdgpu: don't usettm_bo_move_ttminamdgpu_ttm_bind
Quoted 5 lines
From: Christian König <[email protected]>
Just unbind and rebind to force updates of the GART space.
This prevents forcing the BO to be idle.
Is there a chance something could change like the caching on a rebind that we need to account for?
Alex
Quoted 49 lines
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 24 ++++++++++++++++++- ----- 1 file changed, 18 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +18
-6@@ -917,14 +917,26 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem)if (unlikely (r))return r; - r =ttm_bo_move_ttm (bo, true, false, &tmp); -if (unlikely (r)) +if (ttm->state == tt_bound) { + r = ttm->func->unbind (ttm); +if (unlikely (r)) +return r; + + ttm->state = tt_unbound; + } + + r =ttm_tt_bind (ttm, &tmp); +if (unlikely (r)) {ttm_bo_mem_put (bo, &tmp); -else - bo->offset = (bo->mem.start <<PAGE_SHIFT ) + - bo->bdev->man[bo->mem.mem_type].gpu_offset; +return r; + } -return r; +ttm_bo_mem_put (bo, bo_mem); + bo->mem = tmp; + bo->offset = (bo->mem.start <<PAGE_SHIFT ) + + bo->bdev->man[bo->mem.mem_type].gpu_offset; + +return 0 ; }int
amdgpu_ttm_recover_gart(struct amdgpu_device *adev)
--
2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1652E2D2EE8BDBA571EC95EAF7450-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 5/8] drm/amdgpu: don't use ttm_bo_move_ttm in amdgpu_ttm_bind
Am 26.10.2017 um 20:11 schrieb Deucher, Alexander:
Quoted 8 lines
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 5/8] drm/amdgpu: don't usettm_bo_move_ttminamdgpu_ttm_bind
Quoted 6 lines
Quoted 5 lines
From: Christian König <[email protected]>
Just unbind and rebind to force updates of the GART space.
This prevents forcing the BO to be idle.
Is there a chance something could change like the caching on a rebind that we need to account for?
Not that I could think of.
The new placement should have identical attributes to the old one, just with GART space allocated.
Christian.
Quoted 51 lines
Alex
Quoted 48 lines
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 24 ++++++++++++++++++- ----- 1 file changed, 18 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +18
-6@@ -917,14 +917,26 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem)if (unlikely (r))return r; - r =ttm_bo_move_ttm (bo, true, false, &tmp); -if (unlikely (r)) +if (ttm->state == tt_bound) { + r = ttm->func->unbind (ttm); +if (unlikely (r)) +return r; + + ttm->state = tt_unbound; + } + + r =ttm_tt_bind (ttm, &tmp); +if (unlikely (r)) {ttm_bo_mem_put (bo, &tmp); -else - bo->offset = (bo->mem.start <<PAGE_SHIFT ) + - bo->bdev->man[bo->mem.mem_type].gpu_offset; +return r; + } -return r; +ttm_bo_mem_put (bo, bo_mem); + bo->mem = tmp; + bo->offset = (bo->mem.start <<PAGE_SHIFT ) + + bo->bdev->man[bo->mem.mem_type].gpu_offset; + +return 0 ; }int
amdgpu_ttm_recover_gart(struct amdgpu_device *adev)
--
2.7.4
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 0b9322f4-dc4b-08de-fd90-f188c885ecd7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Deucher, Alexander
Acked-by Alex DeucherRE: [PATCH 5/8] drm/amdgpu: don't use ttm_bo_move_ttm in amdgpu_ttm_bind
Quoted 21 lines
-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Thursday, October 26, 2017 2:39 PM
To: Deucher, Alexander; 'Christian König'; [email protected]
Subject: Re: [PATCH 5/8] drm/amdgpu: don't usettm_bo_move_ttminamdgpu_ttm_bindAm 26.10.2017 um 20:11 schrieb Deucher, Alexander:
Quoted 2 lines
Quoted 2 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] OnBehalf
Quoted 10 lines
Quoted 10 lines
Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 5/8] drm/amdgpu: don't usettm_bo_move_ttminamdgpu_ttm_bindFrom: Christian König <[email protected]>
Just unbind and rebind to force updates of the GART space.
Quoted 8 lines
Quoted 2 lines
Quoted 1 line
This prevents forcing the BO to be idle.
Is there a chance something could change like the caching on a rebind that
we need to account for?
Not that I could think of.
The new placement should have identical attributes to the old one, just with GART space allocated.
In that case,
Quoted 4 lines
Christian.
Quoted 1 line
Quoted 60 lines
Quoted 5 lines
Alex
Quoted 3 lines
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 24++++++++++++++++++-
Quoted 53 lines
Quoted 45 lines
-----
1 file changed, 18 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +18
-6@@ -917,14 +917,26 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem)if (unlikely (r))return r; - r =ttm_bo_move_ttm (bo, true, false, &tmp); -if (unlikely (r)) +if (ttm->state == tt_bound) { + r = ttm->func->unbind (ttm); +if (unlikely (r)) +return r; + + ttm->state = tt_unbound; + } + + r =ttm_tt_bind (ttm, &tmp); +if (unlikely (r)) {ttm_bo_mem_put (bo, &tmp); -else - bo->offset = (bo->mem.start <<PAGE_SHIFT ) + - bo->bdev->man[bo->mem.mem_type].gpu_offset; +return r; + } -return r; +ttm_bo_mem_put (bo, bo_mem); + bo->mem = tmp; + bo->offset = (bo->mem.start <<PAGE_SHIFT ) + + bo->bdev->man[bo->mem.mem_type].gpu_offset; + +return 0 ; }int
amdgpu_ttm_recover_gart(struct amdgpu_device *adev)
--
2.7.4Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/8 drm/amd/display: enable GPU VM support
In reply to a message not in the archiveFrom: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment =DCE_ENV_PRODUCTION_DRV ; + init_data.flags.gpu_vm_support = true; +if (amdgpu_dc_log) init_data.log_mask =DC_DEFAULT_LOG_MASK ;else
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509033983-2977-6-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Deucher, Alexander
Acked-by Alex DeucherRE: [PATCH 6/8] drm/amd/display: enable GPU VM support
Quoted 7 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 6/8] drm/amd/display: enable GPU VM support
Quoted 5 lines
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>
Quoted 22 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment =DCE_ENV_PRODUCTION_DRV ; + init_data.flags.gpu_vm_support = true; +if (amdgpu_dc_log) init_data.log_mask =DC_DEFAULT_LOG_MASK ;else
--
2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Andrey Grodzovsky
Reviewed-byRe: [PATCH 6/8] drm/amd/display: enable GPU VM support
In reply to a message not in the archiveQuoted 14 lines · Christian König
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 424
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment =DCE_ENV_PRODUCTION_DRV ; + init_data.flags.gpu_vm_support = true; +if (amdgpu_dc_log) init_data.log_mask =DC_DEFAULT_LOG_MASK ;else
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 6/8] drm/amd/display: enable GPU VM support
In reply to a message not in the archiveQuoted 14 lines · Christian König
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 421
Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment =DCE_ENV_PRODUCTION_DRV ; + init_data.flags.gpu_vm_support = true; +
Hi Christian,
what ASIC has this been tested on?
I'm not sure that this won't break dGPU. dGPU doesn't have vm_support but I think DC will still try to write the same registers as for CZ on dGPU if we enable this. We at least need to make sure it doesn't blow up.
As for Raven we use this flag on Windows but only tested the case where VM is actually programmed. If VM isn't programmed it might still work but we'd need to give that a spin.
Harry
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 424
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0if (amdgpu_dc_log) init_data.log_mask =DC_DEFAULT_LOG_MASK ;else
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 058e99f7-c585-5ba7-e22f-2c0a2d7c241b-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 6/8] drm/amd/display: enable GPU VM support
Am 27.10.2017 um 16:37 schrieb Harry Wentland:
Quoted 16 lines · Christian König
Quoted 15 lines
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 421
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0init_data.dce_environment =DCE_ENV_PRODUCTION_DRV ; + init_data.flags.gpu_vm_support = true; +Hi Christian,
what ASIC has this been tested on?
Carizzo.
Quoted 1 line
I'm not sure that this won't break dGPU. dGPU doesn't have
vm_supportbut I think DC will still try to write the same registers as for CZ on dGPU if we enable this. We at least need to make sure it doesn't blow up.
Yeah, as Tom already stumbled over as well it causes a warning on Tonga. Currently giving it a spin on Polaris.
Quoted 1 line
As for Raven we use this flag on Windows but only tested the case where VM is actually programmed. If VM isn't programmed it might still work but we'd need to give that a spin.
Without this flag tilling fails and only displays a quite unusual pattern.
I would actually prefer if we can completely remove this flag and instead always enable the VM programming on supported hardware.
Is there any downside on doing so?
Christian.
Quoted 11 lines
Harry
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 424
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0if (amdgpu_dc_log) init_data.log_mask =DC_DEFAULT_LOG_MASK ;else _______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 3a5f912f-5161-76a7-af36-6d92abebc7c1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH 6/8] drm/amd/display: enable GPU VM support
Quoted 22 lines · Christian König
Am 27.10.2017 um 16:37 schrieb Harry Wentland:
Quoted 21 lines · Christian König
Quoted 14 lines
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 2 ++1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device · line 420
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment = DCE_ENV_PRODUCTION_DRV; + init_data.flags.gpu_vm_support = true; +Hi Christian,
Quoted 7 lines
Quoted 1 line
what ASIC has this been tested on?
Carizzo.
Quoted 1 line
I'm not sure that this won't break dGPU. dGPU doesn't have
vm_supportbut I think DC will still try to write the same registers as for CZ on dGPU if we enable this. We at least need to make sure it doesn't blow up.Yeah, as Tom already stumbled over as well it causes a warning on Tonga. Currently giving it a spin on Polaris.
I saw the warnings on my CZ+P10 setup but I didn't note which device was complaining.
And I'd like to think I journeyed into it on my meandering path of testing new commits on the hodgepodge of gear I have :-).
Tom
Quoted 23 lines
Quoted 1 line
As for Raven we use this flag on Windows but only tested the case where VM is actually programmed. If VM isn't programmed it might still work but we'd need to give that a spin.
Without this flag tilling fails and only displays a quite unusual pattern.
I would actually prefer if we can completely remove this flag and instead always enable the VM programming on supported hardware.
Is there any downside on doing so?
Christian.
Quoted 11 lines
Harry
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0if (amdgpu_dc_log) init_data.log_mask = DC_DEFAULT_LOG_MASK;else
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 6/8] drm/amd/display: enable GPU VM support
In reply to a message not in the archiveQuoted 38 lines · Christian König
Am 27.10.2017 um 16:37 schrieb Harry Wentland:
Quoted 22 lines · Christian König
Quoted 15 lines
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 2 ++1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device · line 420
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment = DCE_ENV_PRODUCTION_DRV; + init_data.flags.gpu_vm_support = true; +Hi Christian,
Quoted 1 line
what ASIC has this been tested on?
Carizzo.
Quoted 3 lines
I'm not sure that this won't break dGPU. dGPU doesn't have
vm_supportbut I think DC will still try to write the same registers as for CZ on dGPU if we enable this. We at least need to make sure it doesn't blow up.Yeah, as Tom already stumbled over as well it causes a warning on Tonga. Currently giving it a spin on Polaris.
Quoted 3 lines
As for Raven we use this flag on Windows but only tested the case where VM is actually programmed. If VM isn't programmed it might still work but we'd need to give that a spin.
Quoted 6 lines
Without this flag tilling fails and only displays a quite unusual pattern.
I would actually prefer if we can completely remove this flag and instead always enable the VM programming on supported hardware.
Is there any downside on doing so?
Is there a particular use-case for scanout from system memory with a dGPU? Otherwise I suspect it's better not to bother, because the failure mode might be pretty bad if the PCIe link can't keep up with scanout.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): f4a55c92-6209-af56-56a9-527b4e449a03-otUistvHUpPR7s880joybQ@public.gmane.org
Re: [PATCH 6/8] drm/amd/display: enable GPU VM support
Am 27.10.2017 um 16:58 schrieb Michel Dänzer:
Quoted 38 lines · Christian König
Quoted 37 lines
Am 27.10.2017 um 16:37 schrieb Harry Wentland:
Quoted 22 lines · Christian König
Quoted 15 lines
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device · line 420
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment = DCE_ENV_PRODUCTION_DRV; + init_data.flags.gpu_vm_support = true; +Hi Christian,
Quoted 1 line
what ASIC has this been tested on?
Carizzo.
Quoted 3 lines
I'm not sure that this won't break dGPU. dGPU doesn't have
vm_supportbut I think DC will still try to write the same registers as for CZ on dGPU if we enable this. We at least need to make sure it doesn't blow up.Yeah, as Tom already stumbled over as well it causes a warning on Tonga. Currently giving it a spin on Polaris.
Quoted 3 lines
As for Raven we use this flag on Windows but only tested the case where VM is actually programmed. If VM isn't programmed it might still work but we'd need to give that a spin.
Without this flag tilling fails and only displays a quite unusual pattern.
Quoted 7 lines
Quoted 4 lines
I would actually prefer if we can completely remove this flag and instead always enable the VM programming on supported hardware.
Is there any downside on doing so?
Is there a particular use-case for scanout from system memory with a dGPU? Otherwise I suspect it's better not to bother, because the failure mode might be pretty bad if the PCIe link can't keep up with scanout.
That's true and I actually didn't want to suggest that we scanout from system memory on dGPUs.
But setting up the tilling information in the DCE/DCN VM block anyway looks harmless to me.
And scanning out from scattered VRAM at some point still seems to make sense to me.
Regards,
Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 6/8] drm/amd/display: enable GPU VM support
In reply to a message not in the archiveQuoted 29 lines · Christian König
Am 27.10.2017 um 16:37 schrieb Harry Wentland:
Quoted 20 lines · Christian König
Quoted 14 lines
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 2 ++1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 419
Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment = DCE_ENV_PRODUCTION_DRV; + init_data.flags.gpu_vm_support = true; +Hi Christian,
Quoted 1 line
what ASIC has this been tested on?
Carizzo.
Quoted 1 line
I'm not sure that this won't break dGPU. dGPU doesn't have
vm_supportbut I think DC will still try to write the same registers as for CZ on dGPU if we enable this. We at least need to make sure it doesn't blow up.Yeah, as Tom already stumbled over as well it causes a warning on Tonga. Currently giving it a spin on Polaris.
Quoted 8 lines
Quoted 1 line
As for Raven we use this flag on Windows but only tested the case where VM is actually programmed. If VM isn't programmed it might still work but we'd need to give that a spin.
Without this flag tilling fails and only displays a quite unusual pattern.
I would actually prefer if we can completely remove this flag and instead always enable the VM programming on supported hardware.
Is there any downside on doing so?
The way this flag is currently used is for the base driver (amdgpu on Linux, kmd on Windows) to let us know whether VM is being used or not. The options are
1) amdgpu lets us know whether the framebuffer is in virtual memory or not
2) we assume amdgpu always uses virtual memory on ASICs that support it, set this flag to true (as in this patch) and make sure DC only programs it on ASICs that support it
I'd somewhat prefer option 2 as it's simpler from an amdgpu perspective and also keeps DC consistent.
Harry
Quoted 15 lines
Christian.
Quoted 11 lines
Harry
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0if (amdgpu_dc_log) init_data.log_mask = DC_DEFAULT_LOG_MASK;else
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 49b98f35-1801-ec19-0720-b0aa8b616025-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 6/8] drm/amd/display: enable GPU VM support
Am 27.10.2017 um 17:40 schrieb Harry Wentland:
Quoted 33 lines · Christian König
Quoted 32 lines
Am 27.10.2017 um 16:37 schrieb Harry Wentland:
Quoted 20 lines · Christian König
Quoted 14 lines
From: Christian König <[email protected]>
Just set the bit so that DC does the hardware programming.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 419
Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-0@@ -417,6 +417,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.dce_environment = DCE_ENV_PRODUCTION_DRV; + init_data.flags.gpu_vm_support = true; +Hi Christian,
Quoted 1 line
what ASIC has this been tested on?
Carizzo.
Quoted 1 line
I'm not sure that this won't break dGPU. dGPU doesn't have
vm_supportbut I think DC will still try to write the same registers as for CZ on dGPU if we enable this. We at least need to make sure it doesn't blow up.Yeah, as Tom already stumbled over as well it causes a warning on Tonga. Currently giving it a spin on Polaris.
Quoted 1 line
As for Raven we use this flag on Windows but only tested the case where VM is actually programmed. If VM isn't programmed it might still work but we'd need to give that a spin.
Without this flag tilling fails and only displays a quite unusual pattern.
I would actually prefer if we can completely remove this flag and instead always enable the VM programming on supported hardware.
Quoted 8 lines
Quoted 2 lines
Is there any downside on doing so?
The way this flag is currently used is for the base driver (amdgpu on Linux, kmd on Windows) to let us know whether VM is being used or not. The options are
1) amdgpu lets us know whether the framebuffer is in virtual memory or not
2) we assume amdgpu always uses virtual memory on ASICs that support it, set this flag to true (as in this patch) and make sure DC only programs it on ASICs that support itI'd somewhat prefer option 2 as it's simpler from an amdgpu perspective and also keeps DC consistent.
I agree that option 2 sounds better. In this case please provide DC patches to fix the warning and clean things up.
BTW: I've also get a bunch of warning from the DRM core about things DC does. You're probably aware of those problem, but I just wanted to note once more that the backtraces in the log are kind of annoying.
Regards,
Christian.
Quoted 16 lines
Harry
Quoted 13 lines
Christian.
Quoted 10 lines
Harry
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 423
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0if (amdgpu_dc_log) init_data.log_mask = DC_DEFAULT_LOG_MASK; else_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/8 drm/amdgpu: fix indentation in amdgpu_display.h
In reply to a message not in the archiveFrom: Christian König <[email protected]>
That was somehow completely of.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.h +2 -3
@@ -25,9 +25,8 @@struct drm_framebuffer *amdgpu_user_framebuffer_create (struct drm_device *dev, -struct drm_file *file_priv, -const struct drm_mode_fb_cmd2 *mode_cmd); - +struct drm_file *file_priv, +const struct drm_mode_fb_cmd2 *mode_cmd);void amdgpu_output_poll_changed (struct drm_device *dev);#endif
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509033983-2977-7-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 7/8] drm/amdgpu: fix indentation in amdgpu_display.h
Quoted 7 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 7/8] drm/amdgpu: fix indentation inamdgpu_display.h
Quoted 5 lines
From: Christian König <[email protected]>
That was somehow completely of.
Signed-off-by Christian König <[email protected]>
Quoted 25 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_display.h +2
-3@@ -25,9 +25,8 @@struct drm_framebuffer *amdgpu_user_framebuffer_create (struct drm_device *dev, -struct drm_file *file_priv, -const struct drm_mode_fb_cmd2 *mode_cmd); - +struct drm_file *file_priv, + const struct drm_mode_fb_cmd2 *mode_cmd);void amdgpu_output_poll_changed (struct drm_device *dev);#endif
--
2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/8 drm/amdgpu: allow framebuffer in GART memory as well
In reply to a message not in the archiveFrom: Christian König <[email protected]>
On CZ and newer APUs we can pin the fb into GART as well as VRAM.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 13 ++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_display.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 10 ++++++---- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 ++++++++++--- 4 files changed, 29 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +12 -1
@@ -29,6 +29,7 @@#include "amdgpu_i2c.h" #include "atom.h" #include "amdgpu_connectors.h" +#include "amdgpu_display.h" #include <asm/div64.h> #include <linux/pm_runtime.h>
@@ -188,7 +189,7 @@ int amdgpu_crtc_page_flip_target(struct drm_crtc *crtc, goto cleanup; } - r =amdgpu_bo_pin (new_abo,AMDGPU_GEM_DOMAIN_VRAM , &base); + r =amdgpu_bo_pin (new_abo,amdgpu_framebuffer_domains (adev), &base);if (unlikely (r !=0 )) {DRM_ERROR ("failed to pin new abo buffer before flip\n" ); goto unreserve;
@@ -501,6 +502,16 @@ static const struct drm_framebuffer_funcs amdgpu_fb_funcs = { .create_handle = amdgpu_user_framebuffer_create_handle, }; +uint32_t amdgpu_framebuffer_domains (struct amdgpu_device *adev) +{ +uint32_t domain =AMDGPU_GEM_DOMAIN_VRAM ; + +if (adev->asic_type >=CHIP_CARRIZO && adev->flags &AMD_IS_APU ) + domain |=AMDGPU_GEM_DOMAIN_GTT ; + +return domain; +} + int amdgpu_framebuffer_init(struct drm_device *dev, struct amdgpu_framebuffer *rfb,
drivers/gpu/drm/amd/amdgpu/amdgpu_display.h +1 -0
@@ -23,6 +23,7 @@#ifndef __AMDGPU_DISPLAY_H__#define __AMDGPU_DISPLAY_H__ +uint32_t amdgpu_framebuffer_domains (struct amdgpu_device *adev);struct drm_framebuffer * amdgpu_user_framebuffer_create(struct drm_device *dev, struct drm_file *file_priv,
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +6 -4
@@ -38,6 +38,8 @@#include <linux/vga_switcheroo.h> +#include "amdgpu_display.h" +/* object hierarchy - this contains a helper + a amdgpu fb the helper contains a pointer to amdgpu framebuffer baseclass.
@@ -124,7 +126,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,struct drm_gem_object *gobj =NULL ;struct amdgpu_bo *abo =NULL ;bool fb_tiled = false;/* useful for testing */ -u32 tiling_flags =0 ; +u32 tiling_flags =0 , domain;int ret;int aligned_size, size;int height = mode_cmd->height;
@@ -135,12 +137,12 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,/* need to align pitch with crtc limits */ mode_cmd->pitches[0 ] =amdgpu_align_pitch (adev, mode_cmd->width, cpp, fb_tiled); + domain =amdgpu_framebuffer_domains (adev); height =ALIGN (mode_cmd->height,8 ); size = mode_cmd->pitches[0 ] * height; aligned_size =ALIGN (size,PAGE_SIZE ); - ret = amdgpu_gem_object_create(adev, aligned_size, 0, - AMDGPU_GEM_DOMAIN_VRAM, + ret = amdgpu_gem_object_create(adev, aligned_size, 0, domain, AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED | AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS | AMDGPU_GEM_CREATE_VRAM_CLEARED,
@@ -166,7 +168,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, } - ret =amdgpu_bo_pin (abo,AMDGPU_GEM_DOMAIN_VRAM ,NULL ); + ret =amdgpu_bo_pin (abo, domain,NULL );if (ret) {amdgpu_bo_unreserve (abo); goto out_unref;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +10 -3
@@ -2934,10 +2934,12 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane, {struct amdgpu_framebuffer *afb;struct drm_gem_object *obj; +struct amdgpu_device *adev;struct amdgpu_bo *rbo; -int r;struct dm_plane_state *dm_plane_state_new, *dm_plane_state_old;unsigned int awidth; +uint32_t domain; +int r; dm_plane_state_old =to_dm_plane_state (plane->state); dm_plane_state_new =to_dm_plane_state (new_state);
@@ -2951,17 +2953,22 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane, obj = afb->obj; rbo =gem_to_amdgpu_bo (obj); + adev =amdgpu_ttm_adev (rbo->tbo.bdev); r =amdgpu_bo_reserve (rbo, false);if (unlikely (r !=0 ))return r; - r =amdgpu_bo_pin (rbo,AMDGPU_GEM_DOMAIN_VRAM , &afb->address); +if (plane->type !=DRM_PLANE_TYPE_CURSOR ) + domain =amdgpu_framebuffer_domains (adev); +else + domain =AMDGPU_GEM_DOMAIN_VRAM ; + r =amdgpu_bo_pin (rbo, domain, &afb->address);amdgpu_bo_unreserve (rbo);if (unlikely (r !=0 )) { -DRM_ERROR ("Failed to pin framebuffer\n" ); +DRM_ERROR ("Failed to pin framebuffer (%d)\n" , r);return r; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1509033983-2977-8-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 8/8] drm/amdgpu: allow framebuffer in GART memory as well
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 8/8] drm/amdgpu: allow framebuffer in GART memory as well
Quoted 5 lines
From: Christian König <[email protected]>
On CZ and newer APUs we can pin the fb into GART as well as VRAM.
Signed-off-by Christian König <[email protected]>
Quoted 168 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 13 ++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_display.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 10 ++++++---- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 ++++++++++--- 4 files changed, 29 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2
-1@@ -29,6 +29,7 @@#include "amdgpu_i2c.h" #include "atom.h" #include "amdgpu_connectors.h" +#include "amdgpu_display.h" #include <asm/div64.h> #include <linux/pm_runtime.h> @@ -188,7 +189,7 @@ int amdgpu_crtc_page_flip_target(struct drm_crtc *crtc, goto cleanup; } - r =amdgpu_bo_pin (new_abo,AMDGPU_GEM_DOMAIN_VRAM , &base); + r =amdgpu_bo_pin (new_abo,amdgpu_framebuffer_domains (adev), &base);drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +10
-0if (unlikely (r !=0 )) {DRM_ERROR ("failed to pin new abo buffer before flip\n" ); goto unreserve;@@ -501,6 +502,16 @@ static const struct drm_framebuffer_funcs amdgpu_fb_funcs = { .create_handle = amdgpu_user_framebuffer_create_handle, }; +uint32_t amdgpu_framebuffer_domains (struct amdgpu_device *adev) +{ +uint32_t domain =AMDGPU_GEM_DOMAIN_VRAM ; + +if (adev->asic_type >=CHIP_CARRIZO && adev->flags &AMD_IS_APU ) + domain |=AMDGPU_GEM_DOMAIN_GTT ; + +return domain; +} +int amdgpu_framebuffer_init(struct
drm_device*dev,drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0
-0struct amdgpu_framebuffer *rfb,drivers/gpu/drm/amd/amdgpu/amdgpu_display.h +1
-0@@ -23,6 +23,7 @@#ifndef __AMDGPU_DISPLAY_H__#define __AMDGPU_DISPLAY_H__ +uint32_t amdgpu_framebuffer_domains (struct amdgpu_device *adev);struct drm_framebuffer * amdgpu_user_framebuffer_create(struct drm_device *dev, struct drm_file *file_priv,drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +3
-1@@ -38,6 +38,8 @@#include <linux/vga_switcheroo.h> +#include "amdgpu_display.h" +/* object hierarchy - this contains a helper + a amdgpu fb the helper contains a pointer to amdgpu framebuffer baseclass. @@ -124,7 +126,7 @@ static int amdgpufb_create_pinned_object(structamdgpu_fbdev *rfbdev, struct drm_gem_object *gobj = NULL;struct amdgpu_bo *abo =NULL ;bool fb_tiled = false;/* useful for testing */ -u32 tiling_flags =0 ; +u32 tiling_flags =0 , domain;int ret;int aligned_size, size;drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +2
-2int height = mode_cmd->height;@@ -135,12 +137,12 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,/* need to align pitch with crtc limits */ mode_cmd->pitches[0 ] =amdgpu_align_pitch (adev, mode_cmd- >width, cpp, fb_tiled); + domain =amdgpu_framebuffer_domains (adev); height =ALIGN (mode_cmd->height,8 ); size = mode_cmd->pitches[0 ] * height; aligned_size =ALIGN (size,PAGE_SIZE ); - ret = amdgpu_gem_object_create(adev, aligned_size, 0, - AMDGPU_GEM_DOMAIN_VRAM, + ret = amdgpu_gem_object_create(adev, aligned_size, 0, domain,
AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED|
AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS|
AMDGPU_GEM_CREATE_VRAM_CLEARED,drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1
-1@@ -166,7 +168,7 @@ static int amdgpufb_create_pinned_object(structamdgpu_fbdev *rfbdev, } - ret =amdgpu_bo_pin (abo,AMDGPU_GEM_DOMAIN_VRAM , NULL); + ret =amdgpu_bo_pin (abo, domain,NULL );if (ret) {drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0
-0amdgpu_bo_unreserve (abo); goto out_unref;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3
-1@@ -2934,10 +2934,12 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane, {struct amdgpu_framebuffer *afb;struct drm_gem_object *obj; +struct amdgpu_device *adev;struct amdgpu_bo *rbo; -int r;struct dm_plane_state *dm_plane_state_new, *dm_plane_state_old;unsigned int awidth; +uint32_t domain; +int r;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7
-2dm_plane_state_old =to_dm_plane_state (plane->state); dm_plane_state_new =to_dm_plane_state (new_state);@@ -2951,17 +2953,22 @@ static int dm_plane_helper_prepare_fb(structdrm_plane *plane, obj = afb->obj; rbo =gem_to_amdgpu_bo (obj); + adev =amdgpu_ttm_adev (rbo->tbo.bdev); r =amdgpu_bo_reserve (rbo, false);if (unlikely (r !=0 ))return r; - r =amdgpu_bo_pin (rbo,AMDGPU_GEM_DOMAIN_VRAM , &afb- >address); +if (plane->type !=DRM_PLANE_TYPE_CURSOR ) + domain =amdgpu_framebuffer_domains (adev); +else + domain =AMDGPU_GEM_DOMAIN_VRAM ; + r =amdgpu_bo_pin (rbo, domain, &afb->address);amdgpu_bo_unreserve (rbo);if (unlikely (r !=0 )) { -DRM_ERROR ("Failed to pin framebuffer\n" ); +DRM_ERROR ("Failed to pin framebuffer (%d)\n" , r);return r;}
Quoted 7 lines
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Thursday, October 26, 2017 12:06 PM
To: [email protected]
Subject: [PATCH 1/8] drm/amdgpu: use the actual placement for pin accounting
Quoted 5 lines
From: Christian König <[email protected]>
This allows us to specify multiple possible placements again.
Signed-off-by Christian König <[email protected]>
Quoted 23 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2
-0@@ -697,6 +697,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, } *gpu_addr =amdgpu_bo_gpu_offset (bo); } + + domain =amdgpu_mem_type_to_domain (bo- >tbo.mem.mem_type);if (domain ==AMDGPU_GEM_DOMAIN_VRAM ) {drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-1adev->vram_pin_size +=amdgpu_bo_size (bo);if (bo->flags &AMDGPU_GEM_CREATE_NO_CPU_ACCESS ) --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx