diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 5aac350b007f..4dddeafabd09 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -122,20 +122,19 @@ static void amdgpu_ttm_placement_init(struct amdgpu_device *adev, | |||
122 | 122 | ||
123 | if (domain & AMDGPU_GEM_DOMAIN_VRAM) { | 123 | if (domain & AMDGPU_GEM_DOMAIN_VRAM) { |
124 | unsigned visible_pfn = adev->mc.visible_vram_size >> PAGE_SHIFT; | 124 | unsigned visible_pfn = adev->mc.visible_vram_size >> PAGE_SHIFT; |
125 | unsigned lpfn = 0; | ||
126 | |||
127 | /* This forces a reallocation if the flag wasn't set before */ | ||
128 | if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) | ||
129 | lpfn = adev->mc.real_vram_size >> PAGE_SHIFT; | ||
130 | 125 | ||
131 | places[c].fpfn = 0; | 126 | places[c].fpfn = 0; |
132 | places[c].lpfn = lpfn; | 127 | places[c].lpfn = 0; |
133 | places[c].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | | 128 | places[c].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | |
134 | TTM_PL_FLAG_VRAM; | 129 | TTM_PL_FLAG_VRAM; |
130 | |||
135 | if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) | 131 | if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) |
136 | places[c].lpfn = visible_pfn; | 132 | places[c].lpfn = visible_pfn; |
137 | else | 133 | else |
138 | places[c].flags |= TTM_PL_FLAG_TOPDOWN; | 134 | places[c].flags |= TTM_PL_FLAG_TOPDOWN; |
135 | |||
136 | if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) | ||
137 | places[c].flags |= TTM_PL_FLAG_CONTIGUOUS; | ||
139 | c++; | 138 | c++; |
140 | } | 139 | } |
141 | 140 | ||