Lines Matching refs:pt
41 static noinline int expect_pfn_sg(struct pfn_table *pt, in expect_pfn_sg() argument
50 pfn = pt->start; in expect_pfn_sg()
51 for_each_sg(pt->st.sgl, sg, pt->st.nents, n) { in expect_pfn_sg()
53 unsigned int npages = npages_fn(n, pt->st.nents, rnd); in expect_pfn_sg()
72 if (pfn != pt->end) { in expect_pfn_sg()
74 __func__, who, pt->end, pfn); in expect_pfn_sg()
81 static noinline int expect_pfn_sg_page_iter(struct pfn_table *pt, in expect_pfn_sg_page_iter() argument
88 pfn = pt->start; in expect_pfn_sg_page_iter()
89 for_each_sg_page(pt->st.sgl, &sgiter, pt->st.nents, 0) { in expect_pfn_sg_page_iter()
103 if (pfn != pt->end) { in expect_pfn_sg_page_iter()
105 __func__, who, pt->end, pfn); in expect_pfn_sg_page_iter()
112 static noinline int expect_pfn_sgtiter(struct pfn_table *pt, in expect_pfn_sgtiter() argument
120 pfn = pt->start; in expect_pfn_sgtiter()
121 for_each_sgt_page(page, sgt, &pt->st) { in expect_pfn_sgtiter()
133 if (pfn != pt->end) { in expect_pfn_sgtiter()
135 __func__, who, pt->end, pfn); in expect_pfn_sgtiter()
142 static int expect_pfn_sgtable(struct pfn_table *pt, in expect_pfn_sgtable() argument
150 err = expect_pfn_sg(pt, npages_fn, rnd, who, timeout); in expect_pfn_sgtable()
154 err = expect_pfn_sg_page_iter(pt, who, timeout); in expect_pfn_sgtable()
158 err = expect_pfn_sgtiter(pt, who, timeout); in expect_pfn_sgtable()
214 static int alloc_table(struct pfn_table *pt, in alloc_table() argument
227 if (sg_alloc_table(&pt->st, max, in alloc_table()
238 pt->start = PFN_BIAS; in alloc_table()
239 pfn = pt->start; in alloc_table()
240 sg = pt->st.sgl; in alloc_table()
248 sg_free_table(&pt->st); in alloc_table()
263 pt->st.nents = n; in alloc_table()
264 pt->end = pfn; in alloc_table()
293 struct pfn_table pt; in igt_sg_alloc() local
299 err = alloc_table(&pt, sz, sz, *npages, &prng, in igt_sg_alloc()
308 err = expect_pfn_sgtable(&pt, *npages, &prng, in igt_sg_alloc()
311 sg_free_table(&pt.st); in igt_sg_alloc()
329 struct pfn_table pt; in igt_sg_trim() local
341 err = alloc_table(&pt, prime, max, *npages, &prng, in igt_sg_trim()
348 if (i915_sg_trim(&pt.st)) { in igt_sg_trim()
349 if (pt.st.orig_nents != prime || in igt_sg_trim()
350 pt.st.nents != prime) { in igt_sg_trim()
352 pt.st.nents, pt.st.orig_nents, prime); in igt_sg_trim()
357 err = expect_pfn_sgtable(&pt, in igt_sg_trim()
363 sg_free_table(&pt.st); in igt_sg_trim()