Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Manszewski <christoph.manszewski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Chris Wilson <chris.p.wilson@intel.com>
Subject: [igt-dev] [PATCH i-g-t 2/2] lib: Apply rightmost execution mask to xehp gpu walker
Date: Fri,  9 Jun 2023 11:37:19 +0200	[thread overview]
Message-ID: <20230609093719.2076046-2-christoph.manszewski@intel.com> (raw)
In-Reply-To: <20230609093719.2076046-1-christoph.manszewski@intel.com>

The final thread group in each row may need partial execution (not the
full simd16) in order to fit within the region of interest.

Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
Signed-off-by: Christoph Manszewski <christoph.manszewski@intel.com>
---
 lib/gpu_cmds.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index aecba928..48fe1e13 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -953,7 +953,7 @@ xehp_emit_compute_walk(struct intel_bb *ibb,
 		       struct xehp_interface_descriptor_data *pidd,
 		       uint8_t color)
 {
-	uint32_t x_dim, y_dim;
+	uint32_t x_dim, y_dim, mask;
 
 	/*
 	 * Simply do SIMD16 based dispatch, so every thread uses
@@ -969,6 +969,12 @@ xehp_emit_compute_walk(struct intel_bb *ibb,
 	x_dim = (x + width + 15) / 16;
 	y_dim = y + height;
 
+	mask = (x + width) & 15;
+	if (mask == 0)
+		mask = (1 << 16) - 1;
+	else
+		mask = (1 << mask) - 1;
+
 	intel_bb_out(ibb, XEHP_COMPUTE_WALKER | 0x25);
 
 	intel_bb_out(ibb, 0); /* debug object */		//dw1
@@ -980,7 +986,7 @@ xehp_emit_compute_walk(struct intel_bb *ibb,
 	intel_bb_out(ibb, 1 << 30 | 1 << 25 | 1 << 17);		//dw4
 
 	/* Execution mask */
-	intel_bb_out(ibb, 0xffffffff);				//dw5
+	intel_bb_out(ibb, mask);				//dw5
 
 	/* x/y/z max */
 	intel_bb_out(ibb, (x_dim << 20) | (y_dim << 10) | 1);	//dw6
-- 
2.40.1

  reply	other threads:[~2023-06-09  9:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09  9:37 [igt-dev] [PATCH i-g-t 1/2] lib: Apply x/y offsets to GPGPU fill Christoph Manszewski
2023-06-09  9:37 ` Christoph Manszewski [this message]
2023-06-14  8:25   ` [igt-dev] [PATCH i-g-t 2/2] lib: Apply rightmost execution mask to xehp gpu walker Grzegorzek, Dominik
2023-06-09 10:25 ` [igt-dev] ✗ GitLab.Pipeline: warning for series starting with [i-g-t,1/2] lib: Apply x/y offsets to GPGPU fill Patchwork
2023-06-09 17:31 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-06-10 22:27 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-06-14  8:24 ` [igt-dev] [PATCH i-g-t 1/2] " Grzegorzek, Dominik

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=20230609093719.2076046-2-christoph.manszewski@intel.com \
    --to=christoph.manszewski@intel.com \
    --cc=chris.p.wilson@intel.com \
    --cc=igt-dev@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