drm/xe: Fix GT looping for standalone media
authorRiana Tauro <riana.tauro@intel.com>
Tue, 13 Jun 2023 09:42:32 +0000 (15:12 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:34:38 +0000 (11:34 -0500)
gt_count is only being incremented when initializing the primary GT;
since the media GT sets the ID directly, gt_count is not incremented
again, resulting in an incorrect count on MTL.  Use autoincrement while
assigning the media GTs ID to ensure gt_count is correct on MTL and
other future platforms with standalone media.

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Link: https://lore.kernel.org/r/20230613094232.3703549-1-riana.tauro@intel.com
[mattrope: Tweaked commit message to focus on gt_count importance]
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_pci.c

index 208dc7a63f88c31b659c07092409a33005741e86..71be80274683dcb14f3a475ae773d99da38ad229 100644 (file)
@@ -569,7 +569,7 @@ static int xe_info_init(struct xe_device *xe,
                 * up with platforms that support both together.
                 */
                drm_WARN_ON(&xe->drm, id != 0);
-               gt->info.id = 1;
+               gt->info.id = xe->info.gt_count++;
        }
 
        return 0;