]> Git Repo - linux.git/commitdiff
drm/amdgpu: unbind GTT only when it is bound
authorChristian König <[email protected]>
Fri, 9 Sep 2016 13:39:08 +0000 (15:39 +0200)
committerAlex Deucher <[email protected]>
Wed, 14 Sep 2016 19:10:44 +0000 (15:10 -0400)
Doesn't make much sense to clear the GTT when it was never filled.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index b50535c3ce51cd29f665e256696abf61921c7dce..8aa3fe6c270c49ece0c4dcadac21bb62bdd9f36a 100644 (file)
@@ -733,6 +733,9 @@ static int amdgpu_ttm_backend_unbind(struct ttm_tt *ttm)
 {
        struct amdgpu_ttm_tt *gtt = (void *)ttm;
 
+       if (!amdgpu_ttm_is_bound(ttm))
+               return 0;
+
        /* unbind shouldn't be done for GDS/GWS/OA in ttm_bo_clean_mm */
        if (gtt->adev->gart.ready)
                amdgpu_gart_unbind(gtt->adev, gtt->offset, ttm->num_pages);
This page took 0.058396 seconds and 4 git commands to generate.