[PATCH v5 1/2] lib/xe/xe_spin: move the spinner related functions to lib

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Dec 10 11:12:11 UTC 2024


Hi Pravalika,
On 2024-12-06 at 16:40:31 +0530, Pravalika Gurram wrote:
> move spin_ctx_init,spin_ctx_start,spin_ctx_end,spin_ctx_destroy
> to xe spin lib to avoid code redundancy.
> removed xe_cork*  functions to avoid duplicate spinner code.
> 
> Signed-off-by: Pravalika Gurram <pravalika.gurram at intel.com>
> ---
>  lib/xe/xe_spin.c            | 160 +++++++++++++++++++----------
>  lib/xe/xe_spin.h            |  56 ++++++----
>  tests/intel/xe_drm_fdinfo.c | 200 +++++++-----------------------------
>  tests/intel/xe_vm.c         |  17 +--
>  4 files changed, 188 insertions(+), 245 deletions(-)
> 
> diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c
> index 3adacc3a8..f9b18dfc0 100644
> --- a/lib/xe/xe_spin.c
> +++ b/lib/xe/xe_spin.c
> @@ -292,77 +292,125 @@ void xe_spin_free(int fd, struct igt_spin *spin)
>  	free(spin);
>  }
>  
> -void xe_cork_init(int fd, struct drm_xe_engine_class_instance *hwe,
> -		  struct xe_cork *cork)
> +struct xe_cork *
> +xe_cork_create(int fd, struct drm_xe_engine_class_instance *hwe,
> +		uint32_t vm, uint16_t width, uint16_t num_placements,
> +		struct xe_cork_opts *opts)

While you changed public library functions definitions please
also add descriptions to all, see for example lib/drmtest.c or
lib/xe/xe_gt.c

Regards,
Kamil

>  {
> -	uint64_t addr = xe_get_default_alignment(fd);
> -	size_t bo_size = xe_bb_size(fd, SZ_4K);
> -	uint32_t vm, bo, exec_queue, syncobj;

...cut...



More information about the igt-dev mailing list