[1/2] drm/amdgpu: update gart_pin_size if bo is in GTT

Submitted by Cui, Flora on Sept. 9, 2016, 6:30 a.m.

Details

Message ID 1473402651-2395-1-git-send-email-Flora.Cui@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Cui, Flora Sept. 9, 2016, 6:30 a.m.
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(-)

Patch hide | download patch | download mbox

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);
 	}
 

Comments

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);
>   	}
>