summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-02-24 13:06:40 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-02-24 13:06:40 +0000
commit78875a32676153bc7e85fd5fe1b8ac47f88978da (patch)
treeaf7adb6470a6334e7110d5786aae653327e086c3
parentf085f6926ee41f37f042dd37545ff7be8fce03b8 (diff)
drm/i915/ttm: tweak priority hint selection
From Matthew Auld 79bdf56cc55d103f2a276318fd973a296a110b95 in linux 5.15.y/5.15.25 0bdc0a0699929c814a8aecd55d2accb8c11beae2 in mainline linux
-rw-r--r--sys/dev/pci/drm/i915/gem/i915_gem_ttm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_ttm.c b/sys/dev/pci/drm/i915/gem/i915_gem_ttm.c
index 2d5be6247d1..94c65842667 100644
--- a/sys/dev/pci/drm/i915/gem/i915_gem_ttm.c
+++ b/sys/dev/pci/drm/i915/gem/i915_gem_ttm.c
@@ -774,11 +774,9 @@ static void i915_ttm_adjust_lru(struct drm_i915_gem_object *obj)
if (obj->mm.madv != I915_MADV_WILLNEED) {
bo->priority = I915_TTM_PRIO_PURGE;
} else if (!i915_gem_object_has_pages(obj)) {
- if (bo->priority < I915_TTM_PRIO_HAS_PAGES)
- bo->priority = I915_TTM_PRIO_HAS_PAGES;
+ bo->priority = I915_TTM_PRIO_NO_PAGES;
} else {
- if (bo->priority > I915_TTM_PRIO_NO_PAGES)
- bo->priority = I915_TTM_PRIO_NO_PAGES;
+ bo->priority = I915_TTM_PRIO_HAS_PAGES;
}
ttm_bo_move_to_lru_tail(bo, bo->resource, NULL);