mirror of
https://github.com/torvalds/linux.git
synced 2026-04-27 02:52:27 -04:00
drm/vmwgfx: Assign eviction priorities to resources
TTM provides a means to assign eviction priorities to buffer object. This means that all buffer objects with a lower priority will be evicted first on memory pressure. Use this to make sure surfaces and in particular non-dirty surfaces are evicted first. Evicting in particular shaders, cotables and contexts imply a significant performance hit on vmwgfx, so make sure these resources are evicted last. Some buffer objects are sub-allocated in user-space which means we can have many resources attached to a single buffer object or resource. In that case the buffer object is given the highest priority of the attached resources. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
@@ -510,6 +510,8 @@ int vmw_bo_init(struct vmw_private *dev_priv,
|
||||
|
||||
acc_size = vmw_bo_acc_size(dev_priv, size, user);
|
||||
memset(vmw_bo, 0, sizeof(*vmw_bo));
|
||||
BUILD_BUG_ON(TTM_MAX_BO_PRIORITY <= 3);
|
||||
vmw_bo->base.priority = 3;
|
||||
|
||||
INIT_LIST_HEAD(&vmw_bo->res_list);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user