All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 3/4] drm/i915/gtt: make ggtt.insert_page depend on mappable aperture
Date: Wed,  3 Feb 2021 12:11:18 +0000	[thread overview]
Message-ID: <20210203121119.481146-3-matthew.auld@intel.com> (raw)
In-Reply-To: <20210203121119.481146-1-matthew.auld@intel.com>

The vm insert_page is useful to insert a vma-less page into the GGTT,
which so far is always to map something through the mappable aperture,
usually when the entire VMA doesn't fit, or if we specifically don't
want to hog it, since it's generally quite limited in size.

On platforms including DG1 the mappable aperture is gone, and so
insert_page is effectively unused and untested. In the next patch we
need to extend the flags to include the PTE_LM bit when binding into the
GGTT, so rather than extend insert_page to potentially account for this,
we can instead just drop support for the hook on such platforms, at
least until we come up with a valid use.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_ggtt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c
index fc399ac16eda..30187483cd92 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
@@ -882,7 +882,9 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt)
 
 	ggtt->vm.total = (size / sizeof(gen8_pte_t)) * I915_GTT_PAGE_SIZE;
 	ggtt->vm.cleanup = gen6_gmch_remove;
-	ggtt->vm.insert_page = gen8_ggtt_insert_page;
+
+	if (ggtt->mappable_end)
+		ggtt->vm.insert_page = gen8_ggtt_insert_page;
 	ggtt->vm.clear_range = nop_clear_range;
 	if (intel_scanout_needs_vtd_wa(i915))
 		ggtt->vm.clear_range = gen8_ggtt_clear_range;
-- 
2.26.2

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

  parent reply	other threads:[~2021-02-03 12:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 12:11 [Intel-gfx] [PATCH 1/4] drm/i915: Distinction of memory regions Matthew Auld
2021-02-03 12:11 ` [Intel-gfx] [PATCH 2/4] drm/i915/gtt/dg1: add PTE_LM plumbing for ppGTT Matthew Auld
2021-02-03 12:11 ` Matthew Auld [this message]
2021-02-03 12:15   ` [Intel-gfx] [PATCH 3/4] drm/i915/gtt: make ggtt.insert_page depend on mappable aperture Chris Wilson
2021-02-03 12:11 ` [Intel-gfx] [PATCH 4/4] drm/i915/gtt/dg1: add PTE_LM plumbing for GGTT Matthew Auld
2021-02-03 13:20 ` [Intel-gfx] [PATCH 1/4] drm/i915: Distinction of memory regions Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210203121119.481146-3-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.