From: Andi Shyti <andi.shyti@linux.intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>
Cc: Chris Wilson <chris.p.wilson@linux.intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>,
Andi Shyti <andi.shyti@linux.intel.com>
Subject: [PATCH v2 07/15] drm/i915/gt: Manage CCS engine creation within UABI exposure
Date: Thu, 22 Aug 2024 19:28:24 +0200 [thread overview]
Message-ID: <20240822172832.494994-8-andi.shyti@linux.intel.com> (raw)
In-Reply-To: <20240822172832.494994-1-andi.shyti@linux.intel.com>
In commit ea315f98e5d6 ("drm/i915/gt: Do not generate the command
streamer for all the CCS"), we restricted the creation of
physical CCS engines to only one stream. This allowed the user to
submit a single compute workload, with all CCS slices sharing the
workload from that stream.
This patch removes that limitation but still exposes only one
stream to the user. The physical memory for each engine remains
allocated but unused, however the user will only see one engine
exposed.
Do this by adding only one engine to the UABI list, ensuring that
only one engine is visible to the user.
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
drivers/gpu/drm/i915/gt/intel_engine_cs.c | 23 ---------------------
drivers/gpu/drm/i915/gt/intel_engine_user.c | 17 ++++++++++++---
2 files changed, 14 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 4d30a86016f2..def255ee0b96 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -876,29 +876,6 @@ static intel_engine_mask_t init_engine_mask(struct intel_gt *gt)
info->engine_mask &= ~BIT(GSC0);
}
- /*
- * Do not create the command streamer for CCS slices beyond the first.
- * All the workload submitted to the first engine will be shared among
- * all the slices.
- *
- * Once the user will be allowed to customize the CCS mode, then this
- * check needs to be removed.
- */
- if (IS_DG2(gt->i915)) {
- u8 first_ccs = __ffs(CCS_MASK(gt));
-
- /*
- * Store the number of active cslices before
- * changing the CCS engine configuration
- */
- gt->ccs.cslices = CCS_MASK(gt);
-
- /* Mask off all the CCS engine */
- info->engine_mask &= ~GENMASK(CCS3, CCS0);
- /* Put back in the first CCS engine */
- info->engine_mask |= BIT(_CCS(first_ccs));
- }
-
return info->engine_mask;
}
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_user.c b/drivers/gpu/drm/i915/gt/intel_engine_user.c
index cd7662b1ad59..8e5284af8335 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_user.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_user.c
@@ -246,6 +246,20 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
GEM_BUG_ON(uabi_class >=
ARRAY_SIZE(i915->engine_uabi_class_count));
+
+ /* Fix up the mapping to match default execbuf::user_map[] */
+ add_legacy_ring(&ring, engine);
+
+ /*
+ * Do not create the command streamer for CCS slices beyond the
+ * first. All the workload submitted to the first engine will be
+ * shared among all the slices.
+ */
+ if (IS_DG2(i915) &&
+ uabi_class == I915_ENGINE_CLASS_COMPUTE &&
+ engine->uabi_instance)
+ goto clear_node_continue;
+
i915->engine_uabi_class_count[uabi_class]++;
rb_link_node(&engine->uabi_node, prev, p);
@@ -255,9 +269,6 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
engine->uabi_class,
engine->uabi_instance) != engine);
- /* Fix up the mapping to match default execbuf::user_map[] */
- add_legacy_ring(&ring, engine);
-
prev = &engine->uabi_node;
p = &prev->rb_right;
--
2.45.2
next prev parent reply other threads:[~2024-08-22 17:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 17:28 [PATCH v2 00/15] CCS static load balance Andi Shyti
2024-08-22 17:28 ` [PATCH v2 01/15] drm/i915/gt: Avoid using masked workaround for CCS_MODE setting Andi Shyti
2024-08-22 17:28 ` [PATCH v2 02/15] drm/i915/gt: Move the CCS mode variable to a global position Andi Shyti
2024-08-22 17:28 ` [PATCH v2 03/15] drm/i915/gt: Allow the creation of multi-mode CCS masks Andi Shyti
2024-08-22 17:28 ` [PATCH v2 04/15] drm/i915/gt: Refactor uabi engine class/instance list creation Andi Shyti
2024-08-22 17:28 ` [PATCH v2 05/15] drm/i915/gem: Mark and verify UABI engine validity Andi Shyti
2024-08-22 17:28 ` [PATCH v2 06/15] drm/i915/gt: Introduce for_each_enabled_engine() and apply it in selftests Andi Shyti
2024-08-22 17:28 ` Andi Shyti [this message]
2024-08-22 17:28 ` [PATCH v2 08/15] drm/i915/gt: Remove cslices mask value from the CCS structure Andi Shyti
2024-08-22 17:28 ` [PATCH v2 09/15] drm/i915/gt: Expose the number of total CCS slices Andi Shyti
2024-08-22 17:28 ` [PATCH v2 10/15] drm/i915/gt: Store engine-related sysfs kobjects Andi Shyti
2024-08-22 17:28 ` [PATCH v2 11/15] drm/i915/gt: Store active CCS mask Andi Shyti
2024-08-22 17:28 ` [PATCH v2 12/15] drm/i915: Protect access to the UABI engines list with a mutex Andi Shyti
2024-08-22 17:28 ` [PATCH v2 13/15] drm/i915/gt: Isolate single sysfs engine file creation Andi Shyti
2024-08-22 17:28 ` [PATCH v2 14/15] drm/i915/gt: Implement creation and removal routines for CCS engines Andi Shyti
2024-08-22 17:28 ` [PATCH v2 15/15] drm/i915/gt: Allow the user to change the CCS mode through sysfs Andi Shyti
2024-08-22 18:00 ` ✗ Fi.CI.CHECKPATCH: warning for CCS static load balance (rev4) Patchwork
2024-08-22 18:00 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-08-22 18:18 ` ✗ Fi.CI.BAT: failure " Patchwork
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=20240822172832.494994-8-andi.shyti@linux.intel.com \
--to=andi.shyti@linux.intel.com \
--cc=chris.p.wilson@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tursulin@ursulin.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox