From: jsg Date: Thu, 24 Feb 2022 13:06:39 +0000 (+0000) Subject: drm/i915/ttm: tweak priority hint selection X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=09355c2a2627668212573aa2c005156a5a8ceb91;p=openbsd drm/i915/ttm: tweak priority hint selection From Matthew Auld 79bdf56cc55d103f2a276318fd973a296a110b95 in linux 5.15.y/5.15.25 0bdc0a0699929c814a8aecd55d2accb8c11beae2 in mainline linux --- 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);