[PATCH 3/3] drm/amdgpu: fix initializing the VM BO shadow

Alex Deucher alexdeucher at gmail.com
Fri Sep 16 13:58:01 UTC 2016


On Fri, Sep 16, 2016 at 8:12 AM, Christian König
<deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at amd.com>
>
> We need to clear the shadows as well.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>

Series is:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 63649c3..2bb78dc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1434,6 +1434,15 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,
>                         goto error_free;
>                 }
>
> +               if (pt->shadow) {
> +                       r = amdgpu_vm_clear_bo(adev, vm, pt->shadow);
> +                       if (r) {
> +                               amdgpu_bo_unref(&pt->shadow);
> +                               amdgpu_bo_unref(&pt);
> +                               goto error_free;
> +                       }
> +               }
> +
>                 entry->robj = pt;
>                 entry->priority = 0;
>                 entry->tv.bo = &entry->robj->tbo;
> @@ -1631,6 +1640,12 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
>         if (r)
>                 goto error_unreserve;
>
> +       if (vm->page_directory->shadow) {
> +               r = amdgpu_vm_clear_bo(adev, vm, vm->page_directory->shadow);
> +               if (r)
> +                       goto error_unreserve;
> +       }
> +
>         vm->last_eviction_counter = atomic64_read(&adev->num_evictions);
>         amdgpu_bo_unreserve(vm->page_directory);
>
> --
> 2.5.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list