[PATCH i-g-t 06/11] lib/intel_compute: Use constant for binding table address

Thomas Hellström thomas.hellstrom at linux.intel.com
Thu Mar 13 14:41:28 UTC 2025


On Tue, 2025-03-11 at 16:21 +0100, Francois Dugast wrote:
> The binding address is the same, no need to duplicate its definition
> for each pipeline.
> 
> Signed-off-by: Francois Dugast <francois.dugast at intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>

> ---
>  lib/intel_compute.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/intel_compute.c b/lib/intel_compute.c
> index 302a1d35c..79c0f0f00 100644
> --- a/lib/intel_compute.c
> +++ b/lib/intel_compute.c
> @@ -42,6 +42,7 @@
>  #define ADDR_SURFACE_STATE_BASE		0x400000ULL
>  #define ADDR_DYNAMIC_STATE_BASE		0x500000ULL
>  #define ADDR_INDIRECT_OBJECT_BASE	0x100000000
> +#define ADDR_BINDING_TABLE		(ADDR_SURFACE_STATE_BASE +
> OFFSET_BINDING_TABLE)
>  #define OFFSET_INDIRECT_DATA_START	0xFFFD0000
>  #define OFFSET_KERNEL			0xFFFE0000
>  
> @@ -995,7 +996,7 @@ static void xehp_compute_exec(int fd, const
> unsigned char *kernel,
>  		{ .addr = ADDR_GENERAL_STATE_BASE,
>  		  .size = SIZE_GENERAL_STATE,
>  		  .name = "general state base" },
> -		{ .addr = ADDR_SURFACE_STATE_BASE +
> OFFSET_BINDING_TABLE,
> +		{ .addr = ADDR_BINDING_TABLE,
>  		  .size = SIZE_BINDING_TABLE,
>  		  .name = "binding table" },
>  		{ .addr = ADDR_BATCH, .size = SIZE_BATCH,
> @@ -1572,7 +1573,7 @@ static void xelpg_compute_exec(int fd, const
> unsigned char *kernel,
>  		{ .addr = ADDR_GENERAL_STATE_BASE,
>  		  .size = SIZE_GENERAL_STATE,
>  		  .name = "general state base" },
> -		{ .addr = ADDR_SURFACE_STATE_BASE +
> OFFSET_BINDING_TABLE,
> +		{ .addr = ADDR_BINDING_TABLE,
>  		  .size = SIZE_BINDING_TABLE,
>  		  .name = "binding table" },
>  		{ .addr = ADDR_BATCH,
> @@ -1663,7 +1664,7 @@ static void xe2lpg_compute_exec(int fd, const
> unsigned char *kernel,
>  		{ .addr = ADDR_GENERAL_STATE_BASE,
>  		  .size = SIZE_GENERAL_STATE,
>  		  .name = "general state base" },
> -		{ .addr = ADDR_SURFACE_STATE_BASE +
> OFFSET_BINDING_TABLE,
> +		{ .addr = ADDR_BINDING_TABLE,
>  		  .size = SIZE_BINDING_TABLE,
>  		  .name = "binding table" },
>  		{ .addr = ADDR_BATCH,
> @@ -1915,7 +1916,7 @@ static void xe2lpg_compute_preempt_exec(int fd,
> const unsigned char *long_kernel
>  		{ .addr = ADDR_GENERAL_STATE_BASE,
>  		  .size = SIZE_GENERAL_STATE,
>  		  .name = "general state base" },
> -		{ .addr = ADDR_SURFACE_STATE_BASE +
> OFFSET_BINDING_TABLE,
> +		{ .addr = ADDR_BINDING_TABLE,
>  		  .size = SIZE_BINDING_TABLE,
>  		  .name = "binding table" },
>  		{ .addr = ADDR_BATCH,



More information about the igt-dev mailing list