Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dominik Karol Piatkowski <dominik.karol.piatkowski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Dominik Karol Piatkowski <dominik.karol.piatkowski@intel.com>,
	Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Subject: [PATCH i-g-t 1/2] lib/gpu_cmds: Fix hardcoded buffer size
Date: Wed, 26 Jun 2024 08:30:17 +0200	[thread overview]
Message-ID: <20240626063018.2931-2-dominik.karol.piatkowski@intel.com> (raw)
In-Reply-To: <20240626063018.2931-1-dominik.karol.piatkowski@intel.com>

This patch enables buffers larger than one page to be successfully
submitted, allowing for large shader execution.
Based on the find by Dominik Grzegorzek.

Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@intel.com>
Reviewed-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
---
 lib/gpu_cmds.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index 378fa9166..2a502505e 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -566,13 +566,13 @@ gen8_emit_state_base_address(struct intel_bb *ibb)
 	/* general state buffer size */
 	intel_bb_out(ibb, 0xfffff000 | 1);
 	/* dynamic state buffer size */
-	intel_bb_out(ibb, 1 << 12 | 1);
+	intel_bb_out(ibb, ALIGN(ibb->size, 1 << 12) | 1);
 	/* indirect object buffer size */
 	intel_bb_out(ibb, 0xfffff000 | 1);
 	/* instruction buffer size, must set modify enable bit, otherwise it may
 	 * result in GPU hang
 	 */
-	intel_bb_out(ibb, 1 << 12 | 1);
+	intel_bb_out(ibb, ALIGN(ibb->size, 1 << 12) | 1);
 }
 
 void
@@ -610,13 +610,13 @@ gen9_emit_state_base_address(struct intel_bb *ibb)
 	/* general state buffer size */
 	intel_bb_out(ibb, 0xfffff000 | 1);
 	/* dynamic state buffer size */
-	intel_bb_out(ibb, 1 << 12 | 1);
+	intel_bb_out(ibb, ALIGN(ibb->size, 1 << 12) | 1);
 	/* indirect object buffer size */
 	intel_bb_out(ibb, 0xfffff000 | 1);
 	/* intruction buffer size, must set modify enable bit, otherwise it may
 	 * result in GPU hang
 	 */
-	intel_bb_out(ibb, 1 << 12 | 1);
+	intel_bb_out(ibb, ALIGN(ibb->size, 1 << 12) | 1);
 
 	/* Bindless surface state base address */
 	intel_bb_out(ibb, 0 | BASE_ADDRESS_MODIFY);
@@ -1026,14 +1026,14 @@ xehp_emit_state_base_address(struct intel_bb *ibb)
 	/* general state buffer size */
 	intel_bb_out(ibb, 0xfffff000 | 1);                          //dw12
 	/* dynamic state buffer size */
-	intel_bb_out(ibb, 1 << 12 | 1);                             //dw13
+	intel_bb_out(ibb, ALIGN(ibb->size, 1 << 12) | 1);           //dw13
 	/* indirect object buffer size */
 	if (intel_graphics_ver(ibb->devid) >= IP_VER(20, 0))	    //dw14
 		intel_bb_out(ibb, 0);
 	else
 		intel_bb_out(ibb, 0xfffff000 | 1);
 	/* intruction buffer size */
-	intel_bb_out(ibb, 1 << 12 | 1);                             //dw15
+	intel_bb_out(ibb, ALIGN(ibb->size, 1 << 12) | 1);           //dw15
 
 	/* Bindless surface state base address */
 	intel_bb_out(ibb, 0 | BASE_ADDRESS_MODIFY);                 //dw16
-- 
2.34.1


  reply	other threads:[~2024-06-26  6:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26  6:30 [PATCH i-g-t 0/2] lib/gpu_cmds: Fix hardcoded buffer size Dominik Karol Piatkowski
2024-06-26  6:30 ` Dominik Karol Piatkowski [this message]
2024-06-26  6:30 ` [PATCH i-g-t 2/2] lib/gpu_cmds: Typo fix Dominik Karol Piatkowski
2024-06-26 11:24   ` Kamil Konieczny
2024-06-26 10:29 ` ✗ CI.xeBAT: failure for lib/gpu_cmds: Fix hardcoded buffer size (rev2) Patchwork
2024-06-26 10:55   ` Kamil Konieczny
2024-06-26 10:36 ` ✓ Fi.CI.BAT: success " Patchwork
2024-06-26 12:51 ` ✗ CI.xeFULL: failure " Patchwork
2024-06-27  0:19 ` ✓ Fi.CI.IGT: success " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-06-24 11:39 [PATCH i-g-t 0/1] lib/gpu_cmds: Fix hardcoded buffer size Dominik Karol Piatkowski
2024-06-25 12:31 ` [PATCH i-g-t 0/2] " Dominik Karol Piatkowski
2024-06-25 12:31   ` [PATCH i-g-t 1/2] " Dominik Karol Piatkowski

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=20240626063018.2931-2-dominik.karol.piatkowski@intel.com \
    --to=dominik.karol.piatkowski@intel.com \
    --cc=dominik.grzegorzek@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