Skip to content

Commit 7809f28

Browse files
alexdeuchersashalevin
authored andcommitted
drm/radeon: drop ttm two ended allocation
[ Upstream commit a239118 ] radeon_bo_create() calls radeon_ttm_placement_from_domain() before ttm_bo_init() is called. radeon_ttm_placement_from_domain() uses the ttm bo size to determine when to select top down allocation but since the ttm bo is not initialized yet the check is always false. It only took effect when buffers were validated later. It also seemed to regress suspend and resume on some systems possibly due to it not taking effect in radeon_bo_create(). radeon_bo_create() and radeon_ttm_placement_from_domain() need to be reworked substantially for this to be optimally effective. Re-enable it at that point. Noticed-by: Oded Gabbay <oded.gabbay@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent 764725a commit 7809f28

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

‎drivers/gpu/drm/radeon/radeon_object.c‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,6 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
151151
else
152152
rbo->placements[i].lpfn = 0;
153153
}
154-
155-
/*
156-
* Use two-ended allocation depending on the buffer size to
157-
* improve fragmentation quality.
158-
* 512kb was measured as the most optimal number.
159-
*/
160-
if (!((rbo->flags & RADEON_GEM_CPU_ACCESS) &&
161-
(rbo->placements[i].flags & TTM_PL_FLAG_VRAM)) &&
162-
rbo->tbo.mem.size > 512 * 1024) {
163-
for (i = 0; i < c; i++) {
164-
rbo->placements[i].flags |= TTM_PL_FLAG_TOPDOWN;
165-
}
166-
}
167154
}
168155

169156
int radeon_bo_create(struct radeon_device *rdev,

0 commit comments

Comments
 (0)