igt_can_allocate_thp() uses has_transparent_hugepage() to check if THP
is supported with PMD-sized pages. However, has_transparent_hugepage()
is being replaced by an API that has clearer semantics. Thus, replace
has_transparent_hugepage() with pgtable_has_pmd_leaves() and a check for
IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE), this makes the intent of the
check very clear.
Signed-off-by: Luiz Capitulino <luizcap@redhat.com>
---
drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index bd08605a1611..dcd1f1141513 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -1316,7 +1316,9 @@ typedef struct drm_i915_gem_object *
static inline bool igt_can_allocate_thp(struct drm_i915_private *i915)
{
- return i915->mm.gemfs && has_transparent_hugepage();
+ return i915->mm.gemfs &&
+ IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) &&
+ pgtable_has_pmd_leaves();
}
static struct drm_i915_gem_object *
--
2.53.0