[1/8] drm/amdgpu: use the actual placement for pin accounting

Submitted by Christian König on Oct. 26, 2017, 4:06 p.m.

Details

Message ID 1509033983-2977-1-git-send-email-deathsimple@vodafone.de
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

Christian König Oct. 26, 2017, 4:06 p.m.
From: Christian König <christian.koenig@amd.com>

This allows us to specify multiple possible placements again.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
 1 file changed, 2 insertions(+)

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 e527c16..76551cd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -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)

Comments

> -----Original Message-----

> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf

> Of Christian König

> Sent: Thursday, October 26, 2017 12:06 PM

> To: amd-gfx@lists.freedesktop.org

> Subject: [PATCH 1/8] drm/amdgpu: use the actual placement for pin

> accounting

> 

> From: Christian König <christian.koenig@amd.com>

> 

> This allows us to specify multiple possible placements again.

> 

> Signed-off-by: Christian König <christian.koenig@amd.com>


Reviewed-by: Alex Deucher <alexander.deucher@amd.com>


> ---

>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

> index e527c16..76551cd 100644

> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

> @@ -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)

> --

> 2.7.4

> 

> _______________________________________________

> amd-gfx mailing list

> amd-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/amd-gfx