From: Christian König Date: Mon, 16 Oct 2017 11:47:15 +0000 (+0200) Subject: drm/amdgpu: minor cleanup for amdgpu_ttm_bind X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ec8c9f8be875c48c391a1355255867a2d70d1ee2;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: minor cleanup for amdgpu_ttm_bind Filter the placement mask before using it. In theory it could be that we have other flags set here as well. Signed-off-by: Christian König Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 51eacefadea1..b577b717caa0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -909,7 +909,8 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem) placement.busy_placement = &placements; placements.fpfn = 0; placements.lpfn = adev->mc.gart_size >> PAGE_SHIFT; - placements.flags = bo->mem.placement | TTM_PL_FLAG_TT; + placements.flags = (bo->mem.placement & ~TTM_PL_MASK_MEM) | + TTM_PL_FLAG_TT; r = ttm_bo_mem_space(bo, &placement, &tmp, true, false); if (unlikely(r))