Skip to content

Commit d025e9e

Browse files
Jerome Glissealexdeucher
authored andcommitted
drm/radeon: do not move bo to different placement at each cs
The bo creation placement is where the bo will be. Instead of trying to move bo at each command stream let this work to another worker thread that will use more advance heuristic. agd5f: remove leftover unused variable Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
1 parent a636a98 commit d025e9e

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

drivers/gpu/drm/radeon/radeon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ struct radeon_bo {
318318
struct list_head list;
319319
/* Protected by tbo.reserved */
320320
u32 placements[3];
321+
u32 busy_placements[3];
321322
struct ttm_placement placement;
322323
struct ttm_buffer_object tbo;
323324
struct ttm_bo_kmap_obj kmap;

drivers/gpu/drm/radeon/radeon_object.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ 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;
8887
if (domain & RADEON_GEM_DOMAIN_VRAM)
8988
rbo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
9089
TTM_PL_FLAG_VRAM;
@@ -105,6 +104,14 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
105104
if (!c)
106105
rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
107106
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+
}
108115
rbo->placement.num_busy_placement = c;
109116
}
110117

@@ -350,7 +357,6 @@ int radeon_bo_list_validate(struct list_head *head)
350357
{
351358
struct radeon_bo_list *lobj;
352359
struct radeon_bo *bo;
353-
u32 domain;
354360
int r;
355361

356362
r = ttm_eu_reserve_buffers(head);
@@ -360,17 +366,9 @@ int radeon_bo_list_validate(struct list_head *head)
360366
list_for_each_entry(lobj, head, tv.head) {
361367
bo = lobj->bo;
362368
if (!bo->pin_count) {
363-
domain = lobj->wdomain ? lobj->wdomain : lobj->rdomain;
364-
365-
retry:
366-
radeon_ttm_placement_from_domain(bo, domain);
367369
r = ttm_bo_validate(&bo->tbo, &bo->placement,
368370
true, false);
369371
if (unlikely(r)) {
370-
if (r != -ERESTARTSYS && domain == RADEON_GEM_DOMAIN_VRAM) {
371-
domain |= RADEON_GEM_DOMAIN_GTT;
372-
goto retry;
373-
}
374372
return r;
375373
}
376374
}

0 commit comments

Comments
 (0)