diff options
Diffstat (limited to 'common/recipes-kernel/linux/files/0216-drm-amdgpu-fix-amdgpu_cs_get_threshold_for_moves-han.patch')
-rw-r--r-- | common/recipes-kernel/linux/files/0216-drm-amdgpu-fix-amdgpu_cs_get_threshold_for_moves-han.patch | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0216-drm-amdgpu-fix-amdgpu_cs_get_threshold_for_moves-han.patch b/common/recipes-kernel/linux/files/0216-drm-amdgpu-fix-amdgpu_cs_get_threshold_for_moves-han.patch new file mode 100644 index 00000000..92094287 --- /dev/null +++ b/common/recipes-kernel/linux/files/0216-drm-amdgpu-fix-amdgpu_cs_get_threshold_for_moves-han.patch @@ -0,0 +1,96 @@ +From 3a010d204e89688d424d44a82fa8f726eb6c1628 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com> +Date: Fri, 10 Jun 2016 19:27:25 +0530 +Subject: [PATCH 0216/1110] drm/amdgpu: fix amdgpu_cs_get_threshold_for_moves + handling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The threshold should only be computed once. + +Signed-off-by: Christian König <christian.koenig@amd.com> +Reviewed-by: Alex Deucher <alexander.deucher@amd.com> +Signed-off-by: Alex Deucher <alexander.deucher@amd.com> +Signed-off-by: Kalyan Alle <kalyan.alle@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 21 ++++++++++++--------- + 2 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h +index a152e82..501fd23 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h +@@ -1228,6 +1228,8 @@ struct amdgpu_cs_parser { + struct amdgpu_bo_list_entry vm_pd; + struct list_head validated; + struct fence *fence; ++ uint64_t bytes_moved_threshold; ++ uint64_t bytes_moved; + + struct amdgpu_ib *ibs; + uint32_t num_ibs; +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +index b7d6438..9212787 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +@@ -336,14 +336,14 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct amdgpu_device *adev) + return max(bytes_moved_threshold, 1024*1024ull); + } + +-int amdgpu_cs_list_validate(struct amdgpu_device *adev, +- struct amdgpu_vm *vm, ++int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p, + struct list_head *validated) + { ++ struct amdgpu_fpriv *fpriv = p->filp->driver_priv; ++ struct amdgpu_vm *vm = &fpriv->vm; + struct amdgpu_bo_list_entry *lobj; + struct amdgpu_bo *bo; +- u64 bytes_moved = 0, initial_bytes_moved; +- u64 bytes_moved_threshold = amdgpu_cs_get_threshold_for_moves(adev); ++ u64 initial_bytes_moved; + int r; + + list_for_each_entry(lobj, validated, tv.head) { +@@ -363,16 +363,16 @@ int amdgpu_cs_list_validate(struct amdgpu_device *adev, + */ + if ((lobj->allowed_domains & current_domain) != 0 && + (domain & current_domain) == 0 && /* will be moved */ +- bytes_moved > bytes_moved_threshold) { ++ p->bytes_moved > p->bytes_moved_threshold) { + /* don't move it */ + domain = current_domain; + } + + retry: + amdgpu_ttm_placement_from_domain(bo, domain); +- initial_bytes_moved = atomic64_read(&adev->num_bytes_moved); ++ initial_bytes_moved = atomic64_read(&bo->adev->num_bytes_moved); + r = ttm_bo_validate(&bo->tbo, &bo->placement, true, false); +- bytes_moved += atomic64_read(&adev->num_bytes_moved) - ++ p->bytes_moved += atomic64_read(&bo->adev->num_bytes_moved) - + initial_bytes_moved; + + if (unlikely(r)) { +@@ -421,11 +421,14 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p) + + amdgpu_vm_get_pt_bos(&fpriv->vm, &duplicates); + +- r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &duplicates); ++ p->bytes_moved_threshold = amdgpu_cs_get_threshold_for_moves(p->adev); ++ p->bytes_moved = 0; ++ ++ r = amdgpu_cs_list_validate(p, &duplicates); + if (r) + goto error_validate; + +- r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated); ++ r = amdgpu_cs_list_validate(p, &p->validated); + + error_validate: + if (r) +-- +2.7.4 + |