[PATCH i-g-t 2/2] tests/intel/xe_multi_tile: Multi-tile support in IGT

Dandamudi, Priyanka priyanka.dandamudi at intel.com
Wed Aug 6 10:46:35 UTC 2025



From: Dandamudi, Priyanka
Sent: 06 August 2025 04:11 PM
To: nishit.sharma at intel.com; igt-dev at lists.freedesktop.org; Brost, Matthew <matthew.brost at intel.com>; Sharma, Nishit <nishit.sharma at intel.com>
Cc: Roper, Matthew D <matthew.d.roper at intel.com>
Subject: RE: [PATCH i-g-t 2/2] tests/intel/xe_multi_tile: Multi-tile support in IGT






> -----Original Message-----

> From: igt-dev <igt-dev-bounces at lists.freedesktop.org<mailto:igt-dev-bounces at lists.freedesktop.org>> On Behalf Of

> nishit.sharma at intel.com<mailto:nishit.sharma at intel.com>

> Sent: 18 July 2025 11:19 AM

> To: igt-dev at lists.freedesktop.org<mailto:igt-dev at lists.freedesktop.org>; Brost, Matthew

> <matthew.brost at intel.com<mailto:matthew.brost at intel.com>>; Sharma, Nishit <nishit.sharma at intel.com<mailto:nishit.sharma at intel.com>>

> Cc: Roper, Matthew D <matthew.d.roper at intel.com<mailto:matthew.d.roper at intel.com>>

> Subject: [PATCH i-g-t 2/2] tests/intel/xe_multi_tile: Multi-tile support in IGT

>

> From: Nishit Sharma <nishit.sharma at intel.com<mailto:nishit.sharma at intel.com>>

>

> Test checks wether platform supports multi-tile or not. Test peforms sanity

> checks related to sysfs paths for GT IDs and Tile IDs. Test also checks whether

> tiles returned by UAPI are in order or out of order.

>

> Signed-off-by: Nishit Sharma <nishit.sharma at intel.com<mailto:nishit.sharma at intel.com>>

> ---

>  lib/igt_sysfs.c             |   7 +-

>  lib/xe/xe_query.h           |   7 ++

>  tests/intel/xe_multi_tile.c | 141 ++++++++++++++++++++++++++++++++++++

>  tests/meson.build           |   1 +

>  4 files changed, 155 insertions(+), 1 deletion(-)  create mode 100644

> tests/intel/xe_multi_tile.c

>

> diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c index af80e91ee..270120dd7 100644

> --- a/lib/igt_sysfs.c

> +++ b/lib/igt_sysfs.c

> @@ -308,8 +308,13 @@ bool xe_sysfs_gt_has_node(int xe_device, int gt,

> const char *node)  char *  xe_sysfs_engine_path(int xe_device, int gt, int class,

> char *path, int pathlen)  {

> +         int tile;

>            struct stat st;

> -          int tile = IS_PONTEVECCHIO(intel_get_drm_devid(xe_device)) ? gt : 0;

> +         struct xe_device *xe_dev = xe_device_get(xe_device);

> +

> +         igt_assert(xe_dev);

> +

> +         tile = IS_PONTEVECCHIO(intel_get_drm_devid(xe_device)) ?

> +drm_xe_get_tile(xe_dev, gt) : 0;

> Move all the lib code into previous patch and follow the same convention as xe_sysfs_gt_path.

>            if (xe_device < 0)

>                           return NULL;

> diff --git a/lib/xe/xe_query.h b/lib/xe/xe_query.h index 6ff8576b9..49b591334

> 100644

> --- a/lib/xe/xe_query.h

> +++ b/lib/xe/xe_query.h

> @@ -39,6 +39,9 @@ struct xe_device {

>            /** @gt_mask: bitmask of GT IDs */

>            uint64_t gt_mask;

>

> +         /** @tile_mask: bitmask of Tile IDs */

> +         uint64_t tile_mask;

> +

>            /** @memory_regions: bitmask of all memory regions */

>            uint64_t memory_regions;

>

> @@ -80,6 +83,10 @@ struct xe_device {

>            for (uint64_t igt_unique(__mask) = xe_device_get(__fd)->gt_mask; \

>                 __gt = ffsll(igt_unique(__mask)) - 1, igt_unique(__mask) != 0; \

>                 igt_unique(__mask) &= ~(1ull << __gt))

> +#define xe_for_each_tile(__fd, __tile) \

> +         for (uint64_t igt_unique(__mask) = xe_device_get(__fd)->tile_mask; \

> +              __tile = ffsll(igt_unique(__mask)) - 1, igt_unique(__mask) != 0; \

> +              igt_unique(__mask) &= ~(1ull << __tile))

One more thing is that I feel here it iterates through all available tiles but useful one would be for each tile it should iterate over all gt’s and then next tile same.

Move this lib to previous patch.

>  #define xe_for_each_mem_region(__fd, __memreg, __r) \

>            for (uint64_t igt_unique(__i) = 0; igt_unique(__i) < igt_fls(__memreg);

> igt_unique(__i)++) \

>                           for_if(__r = (__memreg & (1ull << igt_unique(__i)))) diff --git

> a/tests/intel/xe_multi_tile.c b/tests/intel/xe_multi_tile.c new file mode

> 100644 index 000000000..938a0b85a

> --- /dev/null

> +++ b/tests/intel/xe_multi_tile.c

> @@ -0,0 +1,141 @@

> +// SPDX-License-Identifier: MIT

> +/*

> + * Copyright © 2023 Intel Corporation

> + *

> + * Authors:

> + *    Nishit Sharma <nishit.sharma at intel.com<mailto:nishit.sharma at intel.com>>

> + *

> + */

> +

> +#include <dirent.h>

> +#include <fcntl.h>

> +#include <sys/types.h>

> +#include <sys/stat.h>

> +#include <unistd.h>

> +

> +#include "igt.h"

> +#include "igt_sysfs.h"

> +

> +#include "xe_drm.h"

> +#include "xe/xe_ioctl.h"

> +#include "xe/xe_query.h"

> +

> +/**

> + * TEST: To verify if multi-tile support available in platform

> + * Category: Core

> + * Mega feature: General Core features

> + * Functionality: Tile/GT operations

> + */

> +

> +/**

> + * SUBTEST: multi-tile-info

> + * Description: Test gathers Tile_ID/s,Tile_ID/s sys path,GT_ID/s path

> + * Test category: functionality test

> + */

> +

> +uint8_t tile_mis_count = -1;

> +

> +/*

> + * To check whether tiles are in order or not or if any tile order is

> + * skipped/missing as returned through UAPI

> + * Function returns 0 if all tiles in order or 1 otherwise  */ static

> +uint8_t xe_check_tile_order(struct xe_device *xe_dev) {

> +         int prev_tile = -1, tile_id;

> +

> +         xe_for_each_tile(xe_dev->fd, tile_id) {

> +                       printf("Tile ID :%d\n", tile_id);

> +                       if (prev_tile != tile_id) {

> +                                      if (++tile_mis_count != tile_id) {

> +                                                    igt_warn("Out of order TileID :%d available

> Tile_ID :%d\n",

> +                                                                     tile_mis_count, tile_id);

> +                                                    return tile_id;

> +                                      }

> +                       }

> +                       prev_tile = tile_id;

> +         }

> +         return prev_tile;

> +}

> +

> +static void

> +xe_create_tile_mask(struct xe_device *xe_dev) {

> +         /* GT IDs may be non-consecutive; keep a mask of valid Tile IDs */

Here rename it to Tile IDs above instead of GT IDs which is present in the starting of the comment.

Move this one to xe_device lib function under gt masks and in future if required it can be used anywhere.

> +         for (int gt = 0; gt < xe_dev->gt_list->num_gt; gt++)

> +                       xe_dev->tile_mask |= (1ull << xe_dev->gt_list-

> >gt_list[gt].tile_id);



> +}

> +

> +/*

> + * To check whether multi-tile supported in platform

> + * Function takes device descriptior and xe_device

> + * structure pointer

> + */

> +static int

This multitile plat support can be moved under lib code as the other tests which need to work for multi tile also can use this.

> +is_multitile_plat(struct xe_device *xe_dev) {

> +         int gt_id;

> +

> +         xe_for_each_gt(xe_dev->fd, gt_id)

> +                       if (xe_dev->gt_list->gt_list[gt_id].tile_id > 0)

> +                                      return true;

> +         return false;

> +}

> +

> +igt_main

> +{

> +         int fd, tile_id, sysfs_path;

> +         struct xe_device *xe_dev;

> +

> +         igt_fixture {

> +                       fd = drm_open_driver(DRIVER_XE);

> +                       xe_dev = xe_device_get(fd);

> +                       igt_assert(xe_dev);

> +         }

> +

> +         igt_subtest("multi-tile-info") {

> +

> +                       /** keep mask of valid Tile IDs **/

> +                       xe_create_tile_mask(xe_dev);

Multi tile platform check need to be made first instead of this mask.

> +

> +                       /** check multi-tile supported in platform **/

> +                       igt_skip_on_f(!is_multitile_plat(xe_dev),

> +                                                    "Multi-Tile not supported on this

> platform.\n");

> +

> +                       /* Sanity check for valid tile_id available

> +                       * Arbitrary gt_id passed as second argument

> +                       * returned negative tile_id

> +                       *

> +                       */

> +                       tile_id = drm_xe_get_tile(xe_dev, 1);

> +                       if (tile_id < 0) {

> +                                      tile_id = 0;

> +                                      igt_require(!tile_id);

> +                       }

> +

> +                       /** check tile order whether sequential or not**/

This check is not useful as you are already making all the tile ids consecutive using tile_mask. So, no need to check this.

> +                       tile_id = xe_check_tile_order(xe_dev);

> +                       if (tile_id != tile_mis_count)

> +                                      igt_warn("Expected tile_id :%d, Available :%d\n",

> tile_mis_count,

> +tile_id);

> +

> +                       /** Sanity to check valid GT path **/

> +                       sysfs_path = xe_sysfs_gt_open(fd, 1);

> +                       if (sysfs_path < 0)

> +                                      sysfs_path = 0;

> +                       igt_skip_on(!sysfs_path);

> +

> +                       /** Sanity to check valid Tile path **/

> +                       sysfs_path = xe_sysfs_tile_open(fd, 1);

> +                       if (sysfs_path < 0)

> +                                      sysfs_path = 0;

> +                       igt_skip_on(!sysfs_path);

> +

> +                       igt_info("Tile_id after iterating gt :%d\n",

> drm_xe_get_tile(xe_dev, 0));

> +         }

> + I believe this test is not required, as you are just validating sysfs paths and tile orders.

1. Tile orders are already made in sequence using tile mask.

2. gt sysfs paths are already being used in other existing tests. So, in that sanity checks are already made.

If at all you want to query gt's under each tile. You can add this tile thing as part of xe_query at query-gt-list or not needed only.

I suggest to first goahead with lib.



--Thanks

   Priyanka

> +         igt_fixture {

> +                       drm_close_driver(fd);

> +         }

> +}

> +

> diff --git a/tests/meson.build b/tests/meson.build index

> 9b87a0d24..b45695f09 100644

> --- a/tests/meson.build

> +++ b/tests/meson.build

> @@ -331,6 +331,7 @@ intel_xe_progs = [

>            'xe_sysfs_scheduler',

>          'xe_sysfs_timeslice_duration',

>          'xe_tlb',

> +        'xe_multi_tile',

>  ]

>

>  intel_xe_eudebug_progs = [

> --

> 2.43.0


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20250806/1fd4275a/attachment-0001.htm>


More information about the igt-dev mailing list