aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0436-drm-amdgpu-add-invisible-pin-size-statistic.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0436-drm-amdgpu-add-invisible-pin-size-statistic.patch')
-rw-r--r--common/recipes-kernel/linux/files/0436-drm-amdgpu-add-invisible-pin-size-statistic.patch77
1 files changed, 0 insertions, 77 deletions
diff --git a/common/recipes-kernel/linux/files/0436-drm-amdgpu-add-invisible-pin-size-statistic.patch b/common/recipes-kernel/linux/files/0436-drm-amdgpu-add-invisible-pin-size-statistic.patch
deleted file mode 100644
index 09ca6e44..00000000
--- a/common/recipes-kernel/linux/files/0436-drm-amdgpu-add-invisible-pin-size-statistic.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From 4982b13ed49e522d56cd303c2910c7b76c15a491 Mon Sep 17 00:00:00 2001
-From: Chunming Zhou <David1.Zhou@amd.com>
-Date: Tue, 5 Apr 2016 10:48:48 +0800
-Subject: [PATCH 0436/1110] drm/amdgpu: add invisible pin size statistic
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
-Reviewed-by: Christian K├Ânig <christian.koenig@amd.com>
-Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
----
- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +-
- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 12 ++++++++----
- 3 files changed, 10 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-index 16cdddb..47150ae 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-@@ -2039,6 +2039,7 @@ struct amdgpu_device {
-
- /* tracking pinned memory */
- u64 vram_pin_size;
-+ u64 invisible_pin_size;
- u64 gart_pin_size;
-
- /* amdkfd interface */
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
-index 8efe335..b04337d 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
-@@ -384,7 +384,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
- vram_gtt.vram_size = adev->mc.real_vram_size;
- vram_gtt.vram_size -= adev->vram_pin_size;
- vram_gtt.vram_cpu_accessible_size = adev->mc.visible_vram_size;
-- vram_gtt.vram_cpu_accessible_size -= adev->vram_pin_size;
-+ vram_gtt.vram_cpu_accessible_size -= (adev->vram_pin_size - adev->invisible_pin_size);
- vram_gtt.gtt_size = adev->mc.gtt_size;
- vram_gtt.gtt_size -= adev->gart_pin_size;
- return copy_to_user(out, &vram_gtt,
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
-index af5c32f..b91ff33 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
-@@ -424,9 +424,11 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
- bo->pin_count = 1;
- if (gpu_addr != NULL)
- *gpu_addr = amdgpu_bo_gpu_offset(bo);
-- if (domain == AMDGPU_GEM_DOMAIN_VRAM)
-+ if (domain == AMDGPU_GEM_DOMAIN_VRAM) {
- bo->adev->vram_pin_size += amdgpu_bo_size(bo);
-- else
-+ if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)
-+ bo->adev->invisible_pin_size += amdgpu_bo_size(bo);
-+ } else
- bo->adev->gart_pin_size += amdgpu_bo_size(bo);
- } else {
- dev_err(bo->adev->dev, "%p pin failed\n", bo);
-@@ -456,9 +458,11 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo)
- }
- r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
- if (likely(r == 0)) {
-- if (bo->tbo.mem.mem_type == TTM_PL_VRAM)
-+ if (bo->tbo.mem.mem_type == TTM_PL_VRAM) {
- bo->adev->vram_pin_size -= amdgpu_bo_size(bo);
-- else
-+ if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)
-+ bo->adev->invisible_pin_size -= amdgpu_bo_size(bo);
-+ } else
- bo->adev->gart_pin_size -= amdgpu_bo_size(bo);
- } else {
- dev_err(bo->adev->dev, "%p validate failed for unpin\n", bo);
---
-2.7.4
-