|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
From 1fc0d158b55d3e833c0d819e48494b7013a44ebe Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
From: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
Date: Mon, 19 Feb 2018 02:18:36 -0500
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
Subject: [PATCH 1/2] amdgpu: Fix mistake in initial hole size calculation.
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
MIME-Version: 1.0
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
Content-Type: text/plain; charset=UTF-8
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
Content-Transfer-Encoding: 8bit
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
Acked-by: Christian K├Ânig <christian.koenig@amd.com>
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
(cherry picked from commit 33a2851ab9bc3cd8a68bedf4cf0fdc549b0f3596)
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
---
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
amdgpu/amdgpu_vamgr.c | 3 ++-
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
index 722067f3..58400428 100644
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
--- a/amdgpu/amdgpu_vamgr.c
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
+++ b/amdgpu/amdgpu_vamgr.c
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
@@ -57,7 +57,7 @@ drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
pthread_mutex_init(&mgr->bo_va_mutex, NULL);
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
pthread_mutex_lock(&mgr->bo_va_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
- n->size = mgr->va_max;
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
+ n->size = mgr->va_max - start;
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
n->offset = start;
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
list_add(&n->list, &mgr->va_holes);
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
pthread_mutex_unlock(&mgr->bo_va_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
@@ -80,6 +80,7 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
struct amdgpu_bo_va_hole *hole, *n;
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
uint64_t offset = 0, waste = 0;
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
+
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
alignment = MAX2(alignment, mgr->va_alignment);
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
size = ALIGN(size, mgr->va_alignment);
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
--
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
2.16.2
|
|
![](https://seccdn.libravatar.org/avatar/522f0859d72d8d86c8d610f3d46a8d3efe6fd2fe35ddd2512e51a8506ba62906?s=16&d=retro) |
054d488 |
|