All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@linux.intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Andi Shyti <andi.shyti@linux.intel.com>
Subject: [CI 2/2] drm/i915/gt: Force ccs_mode 4
Date: Mon, 22 Apr 2024 18:27:31 +0200	[thread overview]
Message-ID: <20240422162731.7046-3-andi.shyti@linux.intel.com> (raw)
In-Reply-To: <20240422162731.7046-1-andi.shyti@linux.intel.com>

Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.c b/drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.c
index 044219c5960a..d0f181a8e73e 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.c
@@ -10,29 +10,33 @@
 
 void intel_gt_apply_ccs_mode(struct intel_gt *gt)
 {
+	unsigned long ccs_mask = CCS_MASK(gt);
 	int cslice;
 	u32 mode = 0;
-	int first_ccs = __ffs(CCS_MASK(gt));
+	int first_ccs = __ffs(ccs_mask);
 
 	if (!IS_DG2(gt->i915))
 		return;
 
 	/* Build the value for the fixed CCS load balancing */
 	for (cslice = 0; cslice < I915_MAX_CCS; cslice++) {
-		if (CCS_MASK(gt) & BIT(cslice))
+		if (CCS_MASK(gt) & BIT(cslice)) {
 			/*
 			 * If available, assign the cslice
 			 * to the first available engine...
 			 */
 			mode |= XEHP_CCS_MODE_CSLICE(cslice, first_ccs);
-
-		else
+			first_ccs = find_next_bit(&ccs_mask,
+						  I915_MAX_CCS,
+						  first_ccs + 1);
+		} else {
 			/*
 			 * ... otherwise, mark the cslice as
 			 * unavailable if no CCS dispatches here
 			 */
 			mode |= XEHP_CCS_MODE_CSLICE(cslice,
 						     XEHP_CCS_MODE_CSLICE_MASK);
+		}
 	}
 
 	intel_uncore_write(gt->uncore, XEHP_CCS_MODE, mode);
-- 
2.43.0


  parent reply	other threads:[~2024-04-22 16:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 16:27 [CI 0/2] Force CCS mode to the maximum Andi Shyti
2024-04-22 16:27 ` [CI 1/2] Revert "drm/i915/gt: Do not generate the command streamer for all the CCS" Andi Shyti
2024-04-22 16:27 ` Andi Shyti [this message]
2024-04-22 17:20 ` ✗ Fi.CI.CHECKPATCH: warning for Force CCS mode to the maximum Patchwork
2024-04-22 17:20 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-04-22 17:28 ` ✓ Fi.CI.BAT: success " Patchwork
2024-04-23  9:08 ` ✗ Fi.CI.IGT: 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=20240422162731.7046-3-andi.shyti@linux.intel.com \
    --to=andi.shyti@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.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.