]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe: Utilize for_each_gt_with_type() for type-specific GT loops
authorMatt Roper <matthew.d.roper@intel.com>
Thu, 5 Mar 2026 22:59:28 +0000 (14:59 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Mon, 9 Mar 2026 21:19:45 +0000 (14:19 -0700)
commit57c554332c8654c2fc2b62459f6eecaff6afca85
tree94e89b4abd93356a6f3e65763ad3522cfd523dd1
parent9f3e77cf204ebb5755e092136c880a6c2d942568
drm/xe: Utilize for_each_gt_with_type() for type-specific GT loops

Convert existing loops with Coccinelle via the following semantic patch:

    @@
    identifier GT, XE, ID;
    iterator name for_each_gt, for_each_gt_with_type;
    @@
    - for_each_gt(GT, XE, ID) {
    + for_each_gt_with_type(GT, XE, ID, BIT(XE_GT_TYPE_MAIN)) {
    -         if (xe_gt_is_media_type(GT))
    -                 continue;
              ...
      }

    @@
    identifier GT, XE, ID;
    iterator name for_each_gt, for_each_gt_with_type;
    @@
    - for_each_gt(GT, XE, ID) {
    + for_each_gt_with_type(GT, XE, ID, BIT(XE_GT_TYPE_MEDIA)) {
    -         if (xe_gt_is_main_type(GT))
    -                 continue;
              ...
      }

    @@
    identifier GT, XE, ID;
    iterator name for_each_gt, for_each_gt_with_type;
    @@
    - for_each_gt(GT, XE, ID) {
    + for_each_gt_with_type(GT, XE, ID, BIT(XE_GT_TYPE_MAIN)) {
    -         if (!xe_gt_is_main_type(GT))
    -                 continue;
              ...
      }

    @@
    identifier GT, XE, ID;
    iterator name for_each_gt, for_each_gt_with_type;
    @@
    - for_each_gt(GT, XE, ID) {
    + for_each_gt_with_type(GT, XE, ID, BIT(XE_GT_TYPE_MEDIA)) {
    -         if (xe_gt_is_media_type(GT))
    -                 continue;
              ...
      }

No functional change expected.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20260305-gt-type-loops-v1-2-aa42e9fc3f06@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_device.c
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c