Commit 2a6d871b authored by Matt Roper's avatar Matt Roper Committed by Rodrigo Vivi

drm/xe: xe_engine_create_ioctl should check gt_count, not tile_count

Platforms like MTL only have a single tile, but multiple GTs.
Ensure XE_ENGINE_CREATE accepts engine creation on gt1 on such
platforms.
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20230725003433.1992137-4-matthew.d.roper@intel.comSigned-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 7a060d78
...@@ -416,7 +416,7 @@ find_hw_engine(struct xe_device *xe, ...@@ -416,7 +416,7 @@ find_hw_engine(struct xe_device *xe,
if (eci.engine_class > ARRAY_SIZE(user_to_xe_engine_class)) if (eci.engine_class > ARRAY_SIZE(user_to_xe_engine_class))
return NULL; return NULL;
if (eci.gt_id >= xe->info.tile_count) if (eci.gt_id >= xe->info.gt_count)
return NULL; return NULL;
idx = array_index_nospec(eci.engine_class, idx = array_index_nospec(eci.engine_class,
...@@ -539,7 +539,7 @@ int xe_engine_create_ioctl(struct drm_device *dev, void *data, ...@@ -539,7 +539,7 @@ int xe_engine_create_ioctl(struct drm_device *dev, void *data,
if (XE_IOCTL_DBG(xe, err)) if (XE_IOCTL_DBG(xe, err))
return -EFAULT; return -EFAULT;
if (XE_IOCTL_DBG(xe, eci[0].gt_id >= xe->info.tile_count)) if (XE_IOCTL_DBG(xe, eci[0].gt_id >= xe->info.gt_count))
return -EINVAL; return -EINVAL;
if (eci[0].engine_class == DRM_XE_ENGINE_CLASS_VM_BIND) { if (eci[0].engine_class == DRM_XE_ENGINE_CLASS_VM_BIND) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment