diff options
author | Flora Cui <Flora.Cui@amd.com> | 2016-09-20 11:07:31 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-09-28 22:16:23 +0200 |
commit | 815973039406d77210166ff5cc6b23504f10eb0e (patch) | |
tree | 628ba9bb857d901d8700cd9e31458887f4a3d4e7 /drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | |
parent | drm/amdgpu: fix initializing the VM BO shadow (diff) | |
download | linux-815973039406d77210166ff5cc6b23504f10eb0e.tar.xz linux-815973039406d77210166ff5cc6b23504f10eb0e.zip |
drm/amdgpu: fix gtt_mgr bo's offset
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c index 262e872bea0e..f86c84427778 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c @@ -128,8 +128,9 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, if (!r) { mem->start = node->start; - tbo->offset = (tbo->mem.start << PAGE_SHIFT) + - tbo->bdev->man[tbo->mem.mem_type].gpu_offset; + if (&tbo->mem == mem) + tbo->offset = (tbo->mem.start << PAGE_SHIFT) + + tbo->bdev->man[tbo->mem.mem_type].gpu_offset; } return r; |