<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><span>Acked-by: Alex Deucher <alexander.deucher@amd.com></span><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Friday, September 14, 2018 6:57:28 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> [PATCH 2/2] drm/amdgpu: revert "stop using gart_start as offset for the GTT domain"</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Turned out the commit is incomplete and since we remove using the AGP<br>
mapping from the GTT manager it is also not necessary any more.<br>
<br>
This reverts commit 22d8bfafcc12dfa17b91d2e8ae4e1898e782003a.<br>
<br>
Signed-off-by: Christian König <christian.koenig@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 3 +--<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c     | 7 +++----<br>
 2 files changed, 4 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c<br>
index c2539f6821c0..da7b1b92d9cf 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c<br>
@@ -143,8 +143,7 @@ static int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,<br>
         spin_unlock(&mgr->lock);<br>
 <br>
         if (!r)<br>
-               mem->start = node->node.start +<br>
-                       (adev->gmc.gart_start >> PAGE_SHIFT);<br>
+               mem->start = node->node.start;<br>
 <br>
         return r;<br>
 }<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
index 8a158ee922f7..f12ae6b525b9 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
@@ -188,7 +188,7 @@ static int amdgpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,<br>
         case TTM_PL_TT:<br>
                 /* GTT memory  */<br>
                 man->func = &amdgpu_gtt_mgr_func;<br>
-               man->gpu_offset = 0;<br>
+               man->gpu_offset = adev->gmc.gart_start;<br>
                 man->available_caching = TTM_PL_MASK_CACHING;<br>
                 man->default_caching = TTM_PL_FLAG_CACHED;<br>
                 man->flags = TTM_MEMTYPE_FLAG_MAPPABLE | TTM_MEMTYPE_FLAG_CMA;<br>
@@ -1060,7 +1060,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm,<br>
         flags = amdgpu_ttm_tt_pte_flags(adev, ttm, bo_mem);<br>
 <br>
         /* bind pages into GART page tables */<br>
-       gtt->offset = ((u64)bo_mem->start << PAGE_SHIFT) - adev->gmc.gart_start;<br>
+       gtt->offset = (u64)bo_mem->start << PAGE_SHIFT;<br>
         r = amdgpu_gart_bind(adev, gtt->offset, ttm->num_pages,<br>
                 ttm->pages, gtt->ttm.dma_address, flags);<br>
 <br>
@@ -1112,8 +1112,7 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo)<br>
                 flags = amdgpu_ttm_tt_pte_flags(adev, bo->ttm, &tmp);<br>
 <br>
                 /* Bind pages */<br>
-               gtt->offset = ((u64)tmp.start << PAGE_SHIFT) -<br>
-                       adev->gmc.gart_start;<br>
+               gtt->offset = (u64)tmp.start << PAGE_SHIFT;<br>
                 r = amdgpu_ttm_gart_bind(adev, bo, flags);<br>
                 if (unlikely(r)) {<br>
                         ttm_bo_mem_put(bo, &tmp);<br>
-- <br>
2.14.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>