Re: [PATCH] drm/amdgpu: allocate GTT space for shadow VM page tables

2016-09-16 Thread Christian König
Could be, but possible that I've missed a few other places where GTT is 
used as well.


What issues where you seeing and are there any backtraces logged? I have 
a WARN_ON() in the code path which should trigger whenever I missed 
something.


Christian.

Am 16.09.2016 um 11:55 schrieb Mike Lothian:


Does this fix the issue I was seeing since the new memory manager went 
into thr 4.9-wip branch?



On Fri, 16 Sep 2016, 10:48 am Christian König, 
> wrote:


From: Christian König >

We need to access those with the system domain.

Fixes fallout from only allocating GTT space on demand.

Signed-off-by: Christian König >
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index a6a48ed..8928a2a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -552,6 +552,10 @@ static int amdgpu_vm_clear_bo(struct
amdgpu_device *adev,
if (r)
goto error;

+   r = amdgpu_ttm_bind(>tbo, >tbo.mem);
+   if (r)
+   goto error;
+
addr = amdgpu_bo_gpu_offset(bo);
entries = amdgpu_bo_size(bo) / 8;

@@ -625,6 +629,11 @@ static int
amdgpu_vm_update_pd_or_shadow(struct amdgpu_device *adev,

if (!pd)
return 0;
+
+   r = amdgpu_ttm_bind(>tbo, >tbo.mem);
+   if (r)
+   return r;
+
pd_addr = amdgpu_bo_gpu_offset(pd);
ring = container_of(vm->entity.sched, struct amdgpu_ring,
sched);

@@ -650,6 +659,14 @@ static int
amdgpu_vm_update_pd_or_shadow(struct amdgpu_device *adev,
if (bo == NULL)
continue;

+   if (bo->shadow) {
+   struct amdgpu_bo *shadow = bo->shadow;
+
+   r = amdgpu_ttm_bind(>tbo,
>tbo.mem);
+   if (r)
+   return r;
+   }
+
pt = amdgpu_bo_gpu_offset(bo);
if (!shadow) {
if (vm->page_tables[pt_idx].addr == pt)
--
2.5.0

___
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


Re: [PATCH] drm/amdgpu: allocate GTT space for shadow VM page tables

2016-09-16 Thread Mike Lothian
Does this fix the issue I was seeing since the new memory manager went into
thr 4.9-wip branch?

On Fri, 16 Sep 2016, 10:48 am Christian König, 
wrote:

> From: Christian König 
>
> We need to access those with the system domain.
>
> Fixes fallout from only allocating GTT space on demand.
>
> Signed-off-by: Christian König 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 17 +
>  1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index a6a48ed..8928a2a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -552,6 +552,10 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device
> *adev,
> if (r)
> goto error;
>
> +   r = amdgpu_ttm_bind(>tbo, >tbo.mem);
> +   if (r)
> +   goto error;
> +
> addr = amdgpu_bo_gpu_offset(bo);
> entries = amdgpu_bo_size(bo) / 8;
>
> @@ -625,6 +629,11 @@ static int amdgpu_vm_update_pd_or_shadow(struct
> amdgpu_device *adev,
>
> if (!pd)
> return 0;
> +
> +   r = amdgpu_ttm_bind(>tbo, >tbo.mem);
> +   if (r)
> +   return r;
> +
> pd_addr = amdgpu_bo_gpu_offset(pd);
> ring = container_of(vm->entity.sched, struct amdgpu_ring, sched);
>
> @@ -650,6 +659,14 @@ static int amdgpu_vm_update_pd_or_shadow(struct
> amdgpu_device *adev,
> if (bo == NULL)
> continue;
>
> +   if (bo->shadow) {
> +   struct amdgpu_bo *shadow = bo->shadow;
> +
> +   r = amdgpu_ttm_bind(>tbo,
> >tbo.mem);
> +   if (r)
> +   return r;
> +   }
> +
> pt = amdgpu_bo_gpu_offset(bo);
> if (!shadow) {
> if (vm->page_tables[pt_idx].addr == pt)
> --
> 2.5.0
>
> ___
> 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