All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: dri-devel <dri-devel@lists.freedesktop.org>,
	intel-gfx <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel@ffwll.ch>, CQ Tang <cq.tang@intel.com>,
	Matthew Auld <matthew.auld@intel.com>,
	lucas.demarchi@intel.com, <rodrigo.vivi@intel.com>,
	Hellstrom Thomas <thomas.hellstrom@intel.com>,
	Ramalingam C <ramalingam.c@intel.com>
Subject: [PATCH v2 04/17] drm/i915: enforce min page size for scratch
Date: Thu, 21 Oct 2021 19:56:14 +0530	[thread overview]
Message-ID: <20211021142627.31058-5-ramalingam.c@intel.com> (raw)
In-Reply-To: <20211021142627.31058-1-ramalingam.c@intel.com>

From: Matthew Auld <matthew.auld@intel.com>

If the device needs 64K minimum GTT pages for device local-memory,
like on XEHPSDV, then we need to fail the allocation if we can't
meet it, instead of falling back to 4K pages, otherwise we can't
safely support the insertion of device local-memory pages for
this vm, since the HW expects the correct physical alignment and
size for every PTE, if we mark the page-table as 64K GTT mode.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gtt.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c
index 67d14afa6623..2a6eec5f0d58 100644
--- a/drivers/gpu/drm/i915/gt/intel_gtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gtt.c
@@ -334,6 +334,18 @@ int setup_scratch_page(struct i915_address_space *vm)
 		if (size == I915_GTT_PAGE_SIZE_4K)
 			return -ENOMEM;
 
+		/*
+		 * If we need 64K minimum GTT pages for device local-memory,
+		 * like on XEHPSDV, then we need to fail the allocation here,
+		 * otherwise we can't safely support the insertion of
+		 * local-memory pages for this vm, since the HW expects the
+		 * correct physical alignment and size when the page-table is
+		 * operating in 64K GTT mode, which includes any scratch PTEs,
+		 * since userpsace can still touch them.
+		 */
+		if (HAS_64K_PAGES(vm->i915))
+			return -ENOMEM;
+
 		size = I915_GTT_PAGE_SIZE_4K;
 	} while (1);
 }
-- 
2.20.1


WARNING: multiple messages have this Message-ID (diff)
From: Ramalingam C <ramalingam.c@intel.com>
To: dri-devel <dri-devel@lists.freedesktop.org>,
	intel-gfx <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel@ffwll.ch>, CQ Tang <cq.tang@intel.com>,
	Matthew Auld <matthew.auld@intel.com>,
	lucas.demarchi@intel.com, <rodrigo.vivi@intel.com>,
	Hellstrom Thomas <thomas.hellstrom@intel.com>,
	Ramalingam C <ramalingam.c@intel.com>
Subject: [Intel-gfx] [PATCH v2 04/17] drm/i915: enforce min page size for scratch
Date: Thu, 21 Oct 2021 19:56:14 +0530	[thread overview]
Message-ID: <20211021142627.31058-5-ramalingam.c@intel.com> (raw)
In-Reply-To: <20211021142627.31058-1-ramalingam.c@intel.com>

From: Matthew Auld <matthew.auld@intel.com>

If the device needs 64K minimum GTT pages for device local-memory,
like on XEHPSDV, then we need to fail the allocation if we can't
meet it, instead of falling back to 4K pages, otherwise we can't
safely support the insertion of device local-memory pages for
this vm, since the HW expects the correct physical alignment and
size for every PTE, if we mark the page-table as 64K GTT mode.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gtt.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c
index 67d14afa6623..2a6eec5f0d58 100644
--- a/drivers/gpu/drm/i915/gt/intel_gtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gtt.c
@@ -334,6 +334,18 @@ int setup_scratch_page(struct i915_address_space *vm)
 		if (size == I915_GTT_PAGE_SIZE_4K)
 			return -ENOMEM;
 
+		/*
+		 * If we need 64K minimum GTT pages for device local-memory,
+		 * like on XEHPSDV, then we need to fail the allocation here,
+		 * otherwise we can't safely support the insertion of
+		 * local-memory pages for this vm, since the HW expects the
+		 * correct physical alignment and size when the page-table is
+		 * operating in 64K GTT mode, which includes any scratch PTEs,
+		 * since userpsace can still touch them.
+		 */
+		if (HAS_64K_PAGES(vm->i915))
+			return -ENOMEM;
+
 		size = I915_GTT_PAGE_SIZE_4K;
 	} while (1);
 }
-- 
2.20.1


  parent reply	other threads:[~2021-10-21 14:24 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 14:26 [PATCH v2 00/17] drm/i915/dg2: Enabling 64k page size and flat ccs Ramalingam C
2021-10-21 14:26 ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 01/17] drm/i915: Add has_64k_pages flag Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-22  6:47   ` Lucas De Marchi
2021-10-21 14:26 ` [PATCH v2 02/17] drm/i915/xehpsdv: set min page-size to 64K Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-22  6:47   ` Lucas De Marchi
2021-10-22  6:47     ` [Intel-gfx] " Lucas De Marchi
2021-10-21 14:26 ` [PATCH v2 03/17] drm/i915/xehpsdv: enforce min GTT alignment Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` Ramalingam C [this message]
2021-10-21 14:26   ` [Intel-gfx] [PATCH v2 04/17] drm/i915: enforce min page size for scratch Ramalingam C
2021-10-21 14:26 ` [PATCH v2 05/17] drm/i915/gtt/xehpsdv: move scratch page to system memory Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 06/17] drm/i915/xehpsdv: support 64K GTT pages Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-22 17:04   ` Matthew Auld
2021-10-22 17:04     ` [Intel-gfx] " Matthew Auld
2021-10-21 14:26 ` [PATCH v2 07/17] drm/i915: Add vm min alignment support Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-22 16:56   ` Matthew Auld
2021-10-22 16:56     ` [Intel-gfx] " Matthew Auld
2021-10-21 14:26 ` [PATCH v2 08/17] drm/i915/selftests: account for min_alignment in GTT selftests Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 09/17] drm/i915/xehpsdv: implement memory coloring Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 10/17] drm/i915/xehpsdv: Add has_flat_ccs to device info Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 11/17] drm/i915/lmem: Enable lmem for platforms with Flat CCS Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 12/17] drm/i915/gt: Clear compress metadata for Xe_HP platforms Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 13/17] drm/i915/dg2: Tile 4 plane format support Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:27   ` Lisovskiy, Stanislav
2021-10-21 14:27     ` [Intel-gfx] " Lisovskiy, Stanislav
2021-10-26 15:08     ` Ramalingam C
2021-10-26 15:08       ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 14/17] uapi/drm/dg2: Format modifier for DG2 unified compression and clear color Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:28   ` Simon Ser
2021-10-21 14:28     ` [Intel-gfx] " Simon Ser
2021-10-21 14:35   ` Ville Syrjälä
2021-10-21 14:35     ` [Intel-gfx] " Ville Syrjälä
2021-10-25 11:20     ` Juha-Pekka Heikkila
2021-10-26 15:44       ` Ramalingam C
2021-10-21 14:26 ` [PATCH v2 15/17] drm/i915/uapi: document behaviour for DG2 64K support Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 16/17] drm/i915/Flat-CCS: Document on Flat-CCS memory compression Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 14:26 ` [PATCH v2 17/17] Doc/gpu/rfc/i915: i915 DG2 uAPI Ramalingam C
2021-10-21 14:26   ` [Intel-gfx] " Ramalingam C
2021-10-21 16:02 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dg2: Enabling 64k page size and flat ccs (rev2) Patchwork
2021-10-21 16:04 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-10-21 16:33 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-10-25 17:31 ` [Intel-gfx] [PATCH v2 00/17] drm/i915/dg2: Enabling 64k page size and flat ccs Robert Beckett

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=20211021142627.31058-5-ramalingam.c@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=cq.tang@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.auld@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@intel.com \
    /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.