drm/ttm: add BO priorities for the LRUs
This way the driver can specify a priority for a BO which has the effect that a BO is only evicted when all other BOs with a lower priority are evicted first. Reviewed-by: Sinclair Yeh <syeh@vmware.com> Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Roger.He <Hongbo.He@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

parent
2ee7fc92cf
commit
cf6c467d67
@@ -215,6 +215,8 @@ struct ttm_buffer_object {
|
||||
|
||||
struct drm_vma_offset_node vma_node;
|
||||
|
||||
unsigned priority;
|
||||
|
||||
/**
|
||||
* Special members that are protected by the reserve lock
|
||||
* and the bo::lock when written to. Can be read with
|
||||
|
@@ -42,6 +42,8 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/reservation.h>
|
||||
|
||||
#define TTM_MAX_BO_PRIORITY 16
|
||||
|
||||
struct ttm_backend_func {
|
||||
/**
|
||||
* struct ttm_backend_func member bind
|
||||
@@ -298,7 +300,7 @@ struct ttm_mem_type_manager {
|
||||
* Protected by the global->lru_lock.
|
||||
*/
|
||||
|
||||
struct list_head lru;
|
||||
struct list_head lru[TTM_MAX_BO_PRIORITY];
|
||||
|
||||
/*
|
||||
* Protected by @move_lock.
|
||||
@@ -518,7 +520,7 @@ struct ttm_bo_global {
|
||||
/**
|
||||
* Protected by the lru_lock.
|
||||
*/
|
||||
struct list_head swap_lru;
|
||||
struct list_head swap_lru[TTM_MAX_BO_PRIORITY];
|
||||
|
||||
/**
|
||||
* Internal protection.
|
||||
|
Reference in New Issue
Block a user