Commit b65a9b98 authored by Matthew Auld's avatar Matthew Auld Committed by Chris Wilson

drm/i915: prefer i915_gem_object_has_pages()

We have an existing helper for testing obj->mm.pages, so use it.
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20171218103855.25274-1-matthew.auld@intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent a31d73c3
...@@ -2596,7 +2596,7 @@ static int ____i915_gem_object_get_pages(struct drm_i915_gem_object *obj) ...@@ -2596,7 +2596,7 @@ static int ____i915_gem_object_get_pages(struct drm_i915_gem_object *obj)
} }
err = obj->ops->get_pages(obj); err = obj->ops->get_pages(obj);
GEM_BUG_ON(!err && IS_ERR_OR_NULL(obj->mm.pages)); GEM_BUG_ON(!err && !i915_gem_object_has_pages(obj));
return err; return err;
} }
......
...@@ -1637,7 +1637,7 @@ static int igt_shrink_thp(void *arg) ...@@ -1637,7 +1637,7 @@ static int igt_shrink_thp(void *arg)
* shmem to truncate our pages. * shmem to truncate our pages.
*/ */
i915_gem_shrink_all(i915); i915_gem_shrink_all(i915);
if (!IS_ERR_OR_NULL(obj->mm.pages)) { if (i915_gem_object_has_pages(obj)) {
pr_err("shrink-all didn't truncate the pages\n"); pr_err("shrink-all didn't truncate the pages\n");
err = -EINVAL; err = -EINVAL;
goto out_close; goto out_close;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment