<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 2/11/20 3:09 PM, Christian König
wrote:<br>
</div>
<blockquote type="cite" cite="mid:3bf68f81-2825-6b00-af9a-e073c3872384@amd.com">Am
11.02.20 um 15:06 schrieb Nirmoy Das:
<br>
<blockquote type="cite">GPU address should belong to driver not in
memory management.
<br>
This patch moves ttm bo.offset and gpu_offset calculation to
amdgpu driver.
<br>
<br>
Signed-off-by: Nirmoy Das <a class="moz-txt-link-rfc2396E" href="mailto:nirmoy.das@amd.com"><nirmoy.das@amd.com></a>
<br>
---
<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 22
+++++++++++++++++++--
<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 +
<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +-------
<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 4 ++--
<br>
4 files changed, 24 insertions(+), 11 deletions(-)
<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
<br>
index 6f60a581e3ba..e25924be33ca 100644
<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
<br>
@@ -917,7 +917,7 @@ int amdgpu_bo_pin_restricted(struct
amdgpu_bo *bo, u32 domain,
<br>
bo->pin_count++;
<br>
if (max_offset != 0) {
<br>
- u64 domain_start =
bo->tbo.bdev->man[mem_type].gpu_offset;
<br>
+ u64 domain_start = amdgpu_bo_gpu_start(adev,
mem_type);
<br>
WARN_ON_ONCE(max_offset <
<br>
(amdgpu_bo_gpu_offset(bo) -
domain_start));
<br>
}
<br>
@@ -1248,6 +1248,18 @@ int amdgpu_bo_get_metadata(struct
amdgpu_bo *bo, void *buffer,
<br>
return 0;
<br>
}
<br>
+uint64_t amdgpu_bo_gpu_start(struct amdgpu_device *adev,
uint32_t type)
<br>
</blockquote>
<br>
Probably better to put that into amdgpu_ttm.[ch] or
amdgpu_gmc.[ch] and name it an amdgpu_ttm_domain_start.
<br>
<br>
<blockquote type="cite">+{
<br>
+ switch(type) {
<br>
+ case TTM_PL_TT:
<br>
</blockquote>
<br>
Coding style here is of, what editor and setting do you use?
<br>
</blockquote>
vi with <b>set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab
cindent</b><br>
<p><br>
</p>
<p>My bad, I didn't check existing switch style.</p>
<p><br>
</p>
<p>Regards,</p>
<p>Nirmoy <br>
</p>
</body>
</html>