mirror of
https://github.com/torvalds/linux.git
synced 2026-04-26 18:42:25 -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:
@@ -112,6 +112,8 @@ static const struct vmw_res_func vmw_legacy_surface_func = {
|
||||
.res_type = vmw_res_surface,
|
||||
.needs_backup = false,
|
||||
.may_evict = true,
|
||||
.prio = 1,
|
||||
.dirty_prio = 1,
|
||||
.type_name = "legacy surfaces",
|
||||
.backup_placement = &vmw_srf_placement,
|
||||
.create = &vmw_legacy_srf_create,
|
||||
@@ -124,6 +126,8 @@ static const struct vmw_res_func vmw_gb_surface_func = {
|
||||
.res_type = vmw_res_surface,
|
||||
.needs_backup = true,
|
||||
.may_evict = true,
|
||||
.prio = 1,
|
||||
.dirty_prio = 2,
|
||||
.type_name = "guest backed surfaces",
|
||||
.backup_placement = &vmw_mob_placement,
|
||||
.create = vmw_gb_surface_create,
|
||||
|
||||
Reference in New Issue
Block a user