Skip to content

Commit 2070787

Browse files
committed
Revert "drm/radeon: do not move bo to different placement at each cs"
This reverts commit d025e9e. This causes corruption for a number of users and needs further investigation in the next cycle. https://bugzilla.kernel.org/show_bug.cgi?id=52491 https://bugs.freedesktop.org/show_bug.cgi?id=58659 http://lists.freedesktop.org/archives/dri-devel/2013-January/032961.html Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 5f0839c commit 2070787

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

drivers/gpu/drm/radeon/radeon.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ struct radeon_bo {
324324
struct list_head list;
325325
/* Protected by tbo.reserved */
326326
u32 placements[3];
327-
u32 busy_placements[3];
328327
struct ttm_placement placement;
329328
struct ttm_buffer_object tbo;
330329
struct ttm_bo_kmap_obj kmap;

drivers/gpu/drm/radeon/radeon_object.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
8484
rbo->placement.fpfn = 0;
8585
rbo->placement.lpfn = 0;
8686
rbo->placement.placement = rbo->placements;
87+
rbo->placement.busy_placement = rbo->placements;
8788
if (domain & RADEON_GEM_DOMAIN_VRAM)
8889
rbo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
8990
TTM_PL_FLAG_VRAM;
@@ -104,14 +105,6 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
104105
if (!c)
105106
rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
106107
rbo->placement.num_placement = c;
107-
108-
c = 0;
109-
rbo->placement.busy_placement = rbo->busy_placements;
110-
if (rbo->rdev->flags & RADEON_IS_AGP) {
111-
rbo->busy_placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_TT;
112-
} else {
113-
rbo->busy_placements[c++] = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_TT;
114-
}
115108
rbo->placement.num_busy_placement = c;
116109
}
117110

@@ -357,6 +350,7 @@ int radeon_bo_list_validate(struct list_head *head)
357350
{
358351
struct radeon_bo_list *lobj;
359352
struct radeon_bo *bo;
353+
u32 domain;
360354
int r;
361355

362356
r = ttm_eu_reserve_buffers(head);
@@ -366,9 +360,17 @@ int radeon_bo_list_validate(struct list_head *head)
366360
list_for_each_entry(lobj, head, tv.head) {
367361
bo = lobj->bo;
368362
if (!bo->pin_count) {
363+
domain = lobj->wdomain ? lobj->wdomain : lobj->rdomain;
364+
365+
retry:
366+
radeon_ttm_placement_from_domain(bo, domain);
369367
r = ttm_bo_validate(&bo->tbo, &bo->placement,
370368
true, false);
371369
if (unlikely(r)) {
370+
if (r != -ERESTARTSYS && domain == RADEON_GEM_DOMAIN_VRAM) {
371+
domain |= RADEON_GEM_DOMAIN_GTT;
372+
goto retry;
373+
}
372374
return r;
373375
}
374376
}

0 commit comments

Comments
 (0)