public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Stuart Summers <stuart.summers@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 10/11] drm/i915: Add new function to copy subslices for a slice
Date: Thu, 22 Aug 2019 11:32:12 -0700	[thread overview]
Message-ID: <20190822183213.132380-11-stuart.summers@intel.com> (raw)
In-Reply-To: <20190822183213.132380-1-stuart.summers@intel.com>

Add a new function to copy subslices for a specified slice
between intel_sseu structures for the purpose of determining
power-gate status. Note that currently ss_stride has a max
of 1.

Signed-off-by: Stuart Summers <stuart.summers@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 549a121e583c..ba93194752c0 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3722,6 +3722,15 @@ i915_cache_sharing_set(void *data, u64 val)
 	return 0;
 }
 
+static void
+intel_sseu_copy_subslices(const struct sseu_dev_info *sseu, int slice,
+			  u8 *to_mask)
+{
+	int offset = slice * sseu->ss_stride;
+
+	memcpy(&to_mask[offset], &sseu->subslice_mask[offset], sseu->ss_stride);
+}
+
 DEFINE_SIMPLE_ATTRIBUTE(i915_cache_sharing_fops,
 			i915_cache_sharing_get, i915_cache_sharing_set,
 			"%llu\n");
@@ -3795,7 +3804,7 @@ static void gen10_sseu_device_status(struct drm_i915_private *dev_priv,
 			continue;
 
 		sseu->slice_mask |= BIT(s);
-		sseu->subslice_mask[s] = info->sseu.subslice_mask[s];
+		intel_sseu_copy_subslices(&info->sseu, s, sseu->subslice_mask);
 
 		for (ss = 0; ss < info->sseu.max_subslices; ss++) {
 			unsigned int eu_cnt;
@@ -3846,7 +3855,8 @@ static void gen9_sseu_device_status(struct drm_i915_private *dev_priv,
 		sseu->slice_mask |= BIT(s);
 
 		if (IS_GEN9_BC(dev_priv))
-			sseu->subslice_mask[s] = info->sseu.subslice_mask[s];
+			intel_sseu_copy_subslices(&info->sseu, s,
+						  sseu->subslice_mask);
 
 		for (ss = 0; ss < info->sseu.max_subslices; ss++) {
 			unsigned int eu_cnt;
@@ -3882,7 +3892,8 @@ static void broadwell_sseu_device_status(struct drm_i915_private *dev_priv,
 	if (sseu->slice_mask) {
 		sseu->eu_per_subslice = info->sseu.eu_per_subslice;
 		for (s = 0; s < fls(sseu->slice_mask); s++)
-			sseu->subslice_mask[s] = info->sseu.subslice_mask[s];
+			intel_sseu_copy_subslices(&info->sseu, s,
+						  sseu->subslice_mask);
 		sseu->eu_total = sseu->eu_per_subslice *
 				 intel_sseu_subslice_total(sseu);
 
-- 
2.22.0

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

  parent reply	other threads:[~2019-08-22 18:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 18:32 [PATCH 00/11] Refactor to expand subslice mask (rev 2) Stuart Summers
2019-08-22 18:32 ` [PATCH 01/11] drm/i915: Use variable for debugfs device status Stuart Summers
2019-08-22 18:32 ` [PATCH 02/11] drm/i915: Add function to set SSEU info per platform Stuart Summers
2019-08-22 18:32 ` [PATCH 03/11] drm/i915: Add subslice stride runtime parameter Stuart Summers
2019-08-22 18:32 ` [PATCH 04/11] drm/i915: Add EU " Stuart Summers
2019-08-22 18:32 ` [PATCH 05/11] drm/i915: Use local variables for subslice_mask for device info Stuart Summers
2019-08-22 18:32 ` [PATCH 06/11] drm/i915: Add function to set subslices Stuart Summers
2019-08-22 22:39   ` Chris Wilson
2019-08-22 18:32 ` [PATCH 07/11] drm/i915: Use subslice stride to set subslices for a given slice Stuart Summers
2019-08-22 22:43   ` Chris Wilson
2019-08-23 15:59     ` Summers, Stuart
2019-08-22 18:32 ` [PATCH 08/11] drm/i915: Add function to determine if a slice has a subslice Stuart Summers
2019-08-22 18:32 ` [PATCH 09/11] drm/i915: Refactor instdone loops on new subslice functions Stuart Summers
2019-08-22 18:32 ` Stuart Summers [this message]
2019-08-22 18:32 ` [PATCH 11/11] drm/i915: Expand subslice mask Stuart Summers
2019-08-22 18:45 ` ✗ Fi.CI.CHECKPATCH: warning for Refactor to expand subslice mask (rev 2) Patchwork
2019-08-22 19:10 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-23 13:44 ` ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-08-23 16:02 [PATCH 00/11] " Stuart Summers
2019-08-23 16:03 ` [PATCH 10/11] drm/i915: Add new function to copy subslices for a slice Stuart Summers
2019-08-20 23:05 [PATCH 00/11] Refactor to expand subslice mask (rev 2) Stuart Summers
2019-08-20 23:05 ` [PATCH 10/11] drm/i915: Add new function to copy subslices for a slice Stuart Summers
2019-08-21 22:41   ` Chris Wilson
2019-08-22 16:36     ` Summers, Stuart

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=20190822183213.132380-11-stuart.summers@intel.com \
    --to=stuart.summers@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox