diff options
author | Christian König <[email protected]> | 2017-01-10 17:27:49 +0100 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2017-01-27 12:20:33 -0500 |
commit | e1f055b30187204439b6693a118b9dde9cda04ae (patch) | |
tree | 29689d69c58bacf23601ef70a1adde165d3b1a88 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | cf6c467d67d319e239aec57d7ba31cb9946f29bf (diff) |
drm/amdgpu: user BO priority instead of self coding it (v2)
Keeping groups of BOs on the LRU is to time consuming on command submission.
Instead use the newly added BO priority to give a certain eviction order.
v2: agd: trivial warning fix
Signed-off-by: Christian König <[email protected]>
Reviewed-by: Roger.He <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 7aecf2667f9d..c43e8c534899 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -386,6 +386,9 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev, if (unlikely(r != 0)) return r; + bo->tbo.priority = ilog2(bo->tbo.num_pages); + bo->tbo.priority = min(bo->tbo.priority, (unsigned)(TTM_MAX_BO_PRIORITY - 1)); + if (flags & AMDGPU_GEM_CREATE_VRAM_CLEARED && bo->tbo.mem.placement & TTM_PL_FLAG_VRAM) { struct dma_fence *fence; |