Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Francois Dugast <francois.dugast@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 03/11] lib/intel_compute: Use common constant for indirect object size
Date: Thu, 13 Mar 2025 16:35:36 +0100	[thread overview]
Message-ID: <3808b4b77f7cb941e038588e6e5fb842a4bca1fd.camel@linux.intel.com> (raw)
In-Reply-To: <20250311152321.16497-4-francois.dugast@intel.com>

On Tue, 2025-03-11 at 16:21 +0100, Francois Dugast wrote:
> Reduce magic values in the code, homogenize the size which has no
> reason to be different among pipelines, define this value close to
> the addresses to make it easier to spot potential overlaps in the
> future.
> 
> Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

> ---
>  lib/intel_compute.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/intel_compute.c b/lib/intel_compute.c
> index b4b022ae7..e3c8cf244 100644
> --- a/lib/intel_compute.c
> +++ b/lib/intel_compute.c
> @@ -30,6 +30,7 @@
>  #define SIZE_BUFFER_OUTPUT		MAX(sizeof(float) *
> SIZE_DATA, 0x10000)
>  #define SIZE_SURFACE_STATE		0x10000
>  #define SIZE_DYNAMIC_STATE		0x100000
> +#define SIZE_INDIRECT_OBJECT		0x10000
>  
>  #define ADDR_SYNC			0x010000ULL
>  #define ADDR_SYNC2			0x020000ULL
> @@ -698,7 +699,7 @@ static void compute_exec(int fd, const unsigned
> char *kernel,
>  		  .size = SIZE_SURFACE_STATE,
>  		  .name = "surface state base" },
>  		{ .addr = ADDR_INDIRECT_OBJECT_BASE +
> OFFSET_INDIRECT_DATA_START,
> -		  .size =  0x10000,
> +		  .size = SIZE_INDIRECT_OBJECT,
>  		  .name = "indirect data start" },
>  		{ .addr = ADDR_INPUT,
>  		  .size = SIZE_BUFFER_INPUT,
> @@ -983,7 +984,7 @@ static void xehp_compute_exec(int fd, const
> unsigned char *kernel,
>  		  .size = SIZE_SURFACE_STATE,
>  		  .name = "surface state base"},
>  		{ .addr = ADDR_GENERAL_STATE_BASE +
> OFFSET_INDIRECT_DATA_START,
> -		  .size =  0x10000,
> +		  .size = SIZE_INDIRECT_OBJECT,
>  		  .name = "indirect object base"},
>  		{ .addr = ADDR_INPUT, .size = SIZE_BUFFER_INPUT,
>  		  .name = "addr input"},
> @@ -1200,7 +1201,7 @@ static void xehpc_compute_exec(int fd, const
> unsigned char *kernel,
>  		{ .addr = ADDR_INSTRUCTION_STATE_BASE +
> OFFSET_KERNEL,
>  		  .name = "instr state base"},
>  		{ .addr = ADDR_GENERAL_STATE_BASE +
> OFFSET_INDIRECT_DATA_START,
> -		  .size =  0x10000,
> +		  .size = SIZE_INDIRECT_OBJECT,
>  		  .name = "indirect object base"},
>  		{ .addr = ADDR_INPUT, .size = SIZE_BUFFER_INPUT,
>  		  .name = "addr input"},
> @@ -1558,7 +1559,7 @@ static void xelpg_compute_exec(int fd, const
> unsigned char *kernel,
>  		  .size = SIZE_SURFACE_STATE,
>  		  .name = "surface state base"},
>  		{ .addr = ADDR_GENERAL_STATE_BASE +
> OFFSET_INDIRECT_DATA_START,
> -		  .size =  0x1000,
> +		  .size = SIZE_INDIRECT_OBJECT,
>  		  .name = "indirect object base"},
>  		{ .addr = ADDR_INPUT, .size = SIZE_BUFFER_INPUT,
>  		  .name = "addr input"},
> @@ -1648,7 +1649,7 @@ static void xe2lpg_compute_exec(int fd, const
> unsigned char *kernel,
>  		  .size = SIZE_SURFACE_STATE,
>  		  .name = "surface state base"},
>  		{ .addr = ADDR_GENERAL_STATE_BASE +
> OFFSET_INDIRECT_DATA_START,
> -		  .size =  0x1000,
> +		  .size = SIZE_INDIRECT_OBJECT,
>  		  .name = "indirect object base"},
>  		{ .addr = ADDR_INPUT, .size = SIZE_BUFFER_INPUT,
>  		  .name = "addr input"},
> @@ -1899,7 +1900,7 @@ static void xe2lpg_compute_preempt_exec(int fd,
> const unsigned char *long_kernel
>  		  .size = SIZE_SURFACE_STATE,
>  		  .name = "surface state base"},
>  		{ .addr = ADDR_GENERAL_STATE_BASE +
> OFFSET_INDIRECT_DATA_START,
> -		  .size =  0x1000,
> +		  .size = SIZE_INDIRECT_OBJECT,
>  		  .name = "indirect object base"},
>  		{ .addr = ADDR_INPUT, .size = SIZE_BUFFER_INPUT,
>  		  .name = "addr input"},


  reply	other threads:[~2025-03-13 15:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 15:21 [PATCH i-g-t 00/11] Prepare lib/intel_compute for SVM/system allocator, part 2 Francois Dugast
2025-03-11 15:21 ` [PATCH i-g-t 01/11] lib/intel_compute: Use common constant for surface state size Francois Dugast
2025-03-13 14:28   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 02/11] lib/intel_compute: Use common constant for dynamic " Francois Dugast
2025-03-13 14:30   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 03/11] lib/intel_compute: Use common constant for indirect object size Francois Dugast
2025-03-13 15:35   ` Thomas Hellström [this message]
2025-03-11 15:21 ` [PATCH i-g-t 04/11] lib/intel_compute: Use common constant for binding table size Francois Dugast
2025-03-13 14:31   ` Thomas Hellström
2025-03-13 14:34   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 05/11] lib/intel_compute: Use common constant for general state size Francois Dugast
2025-03-13 14:35   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 06/11] lib/intel_compute: Use constant for binding table address Francois Dugast
2025-03-13 14:41   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 07/11] lib/intel_compute: Compact memory map Francois Dugast
2025-03-13 14:44   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 08/11] lib/intel_compute: Relocate input and output objects Francois Dugast
2025-03-13 14:45   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 09/11] lib/intel_compute: Fix enqueued local size in xehp Francois Dugast
2025-03-13 14:48   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 10/11] lib/intel_compute: Use constants for thread groups and local work size Francois Dugast
2025-03-13 15:09   ` Thomas Hellström
2025-03-11 15:21 ` [PATCH i-g-t 11/11] lib/intel_compute: Make array size a dynamic parameter Francois Dugast
2025-03-13 15:33   ` Thomas Hellström
2025-03-12  2:44 ` ✗ Xe.CI.BAT: failure for Prepare lib/intel_compute for SVM/system allocator, part 2 Patchwork
2025-03-12  3:08 ` ✓ i915.CI.BAT: success " Patchwork
2025-03-12 14:16 ` ✓ i915.CI.Full: " Patchwork
2025-03-12 18:21 ` ✗ Xe.CI.Full: 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=3808b4b77f7cb941e038588e6e5fb842a4bca1fd.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=francois.dugast@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