All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/gtt: Allow mixed pages to setup large PTE
@ 2018-10-26 12:04 Chris Wilson
  2018-10-26 13:04 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Chris Wilson @ 2018-10-26 12:04 UTC (permalink / raw)
  To: intel-gfx; +Cc: Matthew Auld

For example, we may want to split a 2MiB large page into multiple 64KiB
PTEs. To do so, we want to allow a vma that only has the 2MiB flag set
to utilise the 64KiB as required, i.e. we want to include all larger
pages as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 19b2d991b5d8..9e1756216ada 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1074,7 +1074,7 @@ static void gen8_ppgtt_insert_huge_entries(struct i915_vma *vma,
 		gen8_pte_t *vaddr;
 		u16 index, max;
 
-		if (vma->page_sizes.sg & I915_GTT_PAGE_SIZE_2M &&
+		if (vma->page_sizes.sg & -I915_GTT_PAGE_SIZE_2M &&
 		    IS_ALIGNED(iter->dma, I915_GTT_PAGE_SIZE_2M) &&
 		    rem >= I915_GTT_PAGE_SIZE_2M && !idx.pte) {
 			index = idx.pde;
@@ -1092,7 +1092,7 @@ static void gen8_ppgtt_insert_huge_entries(struct i915_vma *vma,
 			page_size = I915_GTT_PAGE_SIZE;
 
 			if (!index &&
-			    vma->page_sizes.sg & I915_GTT_PAGE_SIZE_64K &&
+			    vma->page_sizes.sg & -I915_GTT_PAGE_SIZE_64K &&
 			    IS_ALIGNED(iter->dma, I915_GTT_PAGE_SIZE_64K) &&
 			    (IS_ALIGNED(rem, I915_GTT_PAGE_SIZE_64K) ||
 			     rem >= (max - index) * I915_GTT_PAGE_SIZE))
-- 
2.19.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-10-26 22:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 12:04 [PATCH] drm/i915/gtt: Allow mixed pages to setup large PTE Chris Wilson
2018-10-26 13:04 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-10-26 14:58 ` [PATCH] " Chris Wilson
2018-10-26 19:27   ` Matthew Auld
2018-10-26 19:48     ` Chris Wilson
2018-10-26 15:44 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gtt: Allow mixed pages to setup large PTE (rev2) Patchwork
2018-10-26 16:13 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-26 22:52 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.