<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Reviewed-by: Ken Wang <Qingqing.Wang@amd.com><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>发件人:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Flora Cui <Flora.Cui@amd.com><br>
<b>发送时间:</b> 2016年8月18日 13:36:59<br>
<b>收件人:</b> amd-gfx@lists.freedesktop.org<br>
<b>抄送:</b> Cui, Flora<br>
<b>主题:</b> [PATCH 3/3] drm/amdgpu: use domain's gpu_offset for start addr</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Change-Id: I77610c286af4cf77bb508136fffc0c77c7cbc34b<br>
Signed-off-by: Flora Cui <Flora.Cui@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +-----<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    | 8 ++------<br>
 2 files changed, 3 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 dbab3c0..2c08e1b 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<br>
@@ -530,11 +530,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,<br>
                         *gpu_addr = amdgpu_bo_gpu_offset(bo);<br>
 <br>
                 if (max_offset != 0) {<br>
-                       u64 domain_start;<br>
-                       if (domain == AMDGPU_GEM_DOMAIN_VRAM)<br>
-                               domain_start = bo->adev->mc.vram_start;<br>
-                       else<br>
-                               domain_start = bo->adev->mc.gtt_start;<br>
+                       u64 domain_start = bo->tbo.bdev->man[mem_type].gpu_offset;<br>
                         WARN_ON_ONCE(max_offset <<br>
                                      (amdgpu_bo_gpu_offset(bo) - domain_start));<br>
                 }<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
index 105bd22..8a12b24 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
@@ -257,10 +257,8 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,<br>
 <br>
         switch (old_mem->mem_type) {<br>
         case TTM_PL_VRAM:<br>
-               old_start += adev->mc.vram_start;<br>
-               break;<br>
         case TTM_PL_TT:<br>
-               old_start += adev->mc.gtt_start;<br>
+               old_start += bo->bdev->man[old_mem->mem_type].gpu_offset;<br>
                 break;<br>
         default:<br>
                 DRM_ERROR("Unknown placement %d\n", old_mem->mem_type);<br>
@@ -268,10 +266,8 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,<br>
         }<br>
         switch (new_mem->mem_type) {<br>
         case TTM_PL_VRAM:<br>
-               new_start += adev->mc.vram_start;<br>
-               break;<br>
         case TTM_PL_TT:<br>
-               new_start += adev->mc.gtt_start;<br>
+               new_start += bo->bdev->man[new_mem->mem_type].gpu_offset;<br>
                 break;<br>
         default:<br>
                 DRM_ERROR("Unknown placement %d\n", old_mem->mem_type);<br>
-- <br>
2.7.4<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>
</body>
</html>