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 1/2] lib: Apply x/y offsets to GPGPU fill
Date: Fri, 9 Jun 2023 11:37:18 +0200 [thread overview]
Message-ID: <20230609093719.2076046-1-christoph.manszewski@intel.com> (raw)
Actually honour the caller provided destination region and pass the x/y
offsets to the thread group.
Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
Signed-off-by: Christoph Manszewski <christoph.manszewski@intel.com>
---
lib/gpgpu_fill.c | 4 +---
lib/gpu_cmds.c | 29 +++++++++++++++--------------
lib/gpu_cmds.h | 1 +
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
index d854fbf7..eed82187 100644
--- a/lib/gpgpu_fill.c
+++ b/lib/gpgpu_fill.c
@@ -315,8 +315,6 @@ __xehp_gpgpu_fillfunc(int i915,
{
struct intel_bb *ibb;
struct xehp_interface_descriptor_data idd;
- (void) x;
- (void) y;
ibb = intel_bb_create(i915, PAGE_SIZE);
intel_bb_add_intel_buf(ibb, buf, true);
@@ -335,7 +333,7 @@ __xehp_gpgpu_fillfunc(int i915,
xehp_emit_state_compute_mode(ibb);
xehp_emit_state_binding_table_pool_alloc(ibb);
xehp_emit_cfe_state(ibb, THREADS);
- xehp_emit_compute_walk(ibb, width, height, &idd, color);
+ xehp_emit_compute_walk(ibb, x, y, width, height, &idd, color);
intel_bb_out(ibb, MI_BATCH_BUFFER_END);
intel_bb_ptr_align(ibb, 32);
diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index 1f321ae4..aecba928 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -636,10 +636,10 @@ gen7_emit_gpgpu_walk(struct intel_bb *ibb,
* Then thread group X = width / 16 (aligned to 16)
* thread group Y = height;
*/
- x_dim = (width + 15) / 16;
- y_dim = height;
+ x_dim = (x + width + 15) / 16;
+ y_dim = y + height;
- tmp = width & 15;
+ tmp = (x + width) & 15;
if (tmp == 0)
right_mask = (1 << 16) - 1;
else
@@ -657,11 +657,11 @@ gen7_emit_gpgpu_walk(struct intel_bb *ibb,
0); /* width:1 */
/* thread group X */
- intel_bb_out(ibb, 0);
+ intel_bb_out(ibb, x / 16);
intel_bb_out(ibb, x_dim);
/* thread group Y */
- intel_bb_out(ibb, 0);
+ intel_bb_out(ibb, y);
intel_bb_out(ibb, y_dim);
/* thread group Z */
@@ -693,10 +693,10 @@ gen8_emit_gpgpu_walk(struct intel_bb *ibb,
* Then thread group X = width / 16 (aligned to 16)
* thread group Y = height;
*/
- x_dim = (width + 15) / 16;
- y_dim = height;
+ x_dim = (x + width + 15) / 16;
+ y_dim = y + height;
- tmp = width & 15;
+ tmp = (x + width) & 15;
if (tmp == 0)
right_mask = (1 << 16) - 1;
else
@@ -715,12 +715,12 @@ gen8_emit_gpgpu_walk(struct intel_bb *ibb,
0); /* width:1 */
/* thread group X */
- intel_bb_out(ibb, 0);
+ intel_bb_out(ibb, x / 16);
intel_bb_out(ibb, 0);
intel_bb_out(ibb, x_dim);
/* thread group Y */
- intel_bb_out(ibb, 0);
+ intel_bb_out(ibb, y);
intel_bb_out(ibb, 0);
intel_bb_out(ibb, y_dim);
@@ -948,6 +948,7 @@ xehp_emit_state_base_address(struct intel_bb *ibb)
void
xehp_emit_compute_walk(struct intel_bb *ibb,
+ unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
struct xehp_interface_descriptor_data *pidd,
uint8_t color)
@@ -965,8 +966,8 @@ xehp_emit_compute_walk(struct intel_bb *ibb,
* Then thread group X = width / 16 (aligned to 16)
* thread group Y = height;
*/
- x_dim = (width + 15) / 16;
- y_dim = height;
+ x_dim = (x + width + 15) / 16;
+ y_dim = y + height;
intel_bb_out(ibb, XEHP_COMPUTE_WALKER | 0x25);
@@ -994,8 +995,8 @@ xehp_emit_compute_walk(struct intel_bb *ibb,
intel_bb_out(ibb, 1); //dw9
/* group id x/y/z */
- intel_bb_out(ibb, 0); //dw10
- intel_bb_out(ibb, 0); //dw11
+ intel_bb_out(ibb, x / 16); //dw10
+ intel_bb_out(ibb, y); //dw11
intel_bb_out(ibb, 0); //dw12
/* partition id / partition size */
diff --git a/lib/gpu_cmds.h b/lib/gpu_cmds.h
index 92cbbde9..b7ed64f8 100644
--- a/lib/gpu_cmds.h
+++ b/lib/gpu_cmds.h
@@ -138,6 +138,7 @@ xehp_emit_state_base_address(struct intel_bb *ibb);
void
xehp_emit_compute_walk(struct intel_bb *ibb,
+ unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
struct xehp_interface_descriptor_data *pidd,
uint8_t color);
--
2.40.1
next 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 Christoph Manszewski [this message]
2023-06-09 9:37 ` [igt-dev] [PATCH i-g-t 2/2] lib: Apply rightmost execution mask to xehp gpu walker Christoph Manszewski
2023-06-14 8:25 ` 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-1-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