drm/amdgpu: stop adding dummy entry in amdgpu_ttm_placement_init

AMDGPU_GEM_CREATE_NO_CPU_ACCESS and AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED are
obviously mutual exclusive. So stop adding a dummy entry without effect when
both are specified.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Christian König 2016-08-15 14:08:54 +02:00 committed by Alex Deucher
parent faceaf6a73
commit 6369f6f133
1 changed files with 3 additions and 5 deletions

View File

@ -119,17 +119,15 @@ static void amdgpu_ttm_placement_init(struct amdgpu_device *adev,
struct ttm_place *places, struct ttm_place *places,
u32 domain, u64 flags) u32 domain, u64 flags)
{ {
u32 c = 0, i; u32 c = 0;
if (domain & AMDGPU_GEM_DOMAIN_VRAM) { if (domain & AMDGPU_GEM_DOMAIN_VRAM) {
unsigned visible_pfn = adev->mc.visible_vram_size >> PAGE_SHIFT; unsigned visible_pfn = adev->mc.visible_vram_size >> PAGE_SHIFT;
if (flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS && if (flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS &&
!(flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) &&
adev->mc.visible_vram_size < adev->mc.real_vram_size) { adev->mc.visible_vram_size < adev->mc.real_vram_size) {
places[c].fpfn = visible_pfn; places[c].fpfn = visible_pfn;
if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED)
places[c].lpfn = visible_pfn;
else
places[c].lpfn = 0; places[c].lpfn = 0;
places[c].flags = TTM_PL_FLAG_WC | places[c].flags = TTM_PL_FLAG_WC |
TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM | TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM |