drm/xe/multi_queue: Refactor check for multi queue support for engine class

xe exec queue code is using a check to see if a class of engines support
multi queue. This check is also needed by other code, so move it to
xe_gt and export it for others.

Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Link: https://patch.msgid.link/20260507162016.3888309-17-umesh.nerlige.ramappa@intel.com
This commit is contained in:
Umesh Nerlige Ramappa 2026-05-07 09:20:21 -07:00
parent d243ef6a39
commit 11ea979e19
2 changed files with 16 additions and 6 deletions

View File

@ -852,11 +852,6 @@ static int xe_exec_queue_group_init(struct xe_device *xe, struct xe_exec_queue *
return 0;
}
static inline bool xe_exec_queue_supports_multi_queue(struct xe_exec_queue *q)
{
return q->gt->info.multi_queue_engine_class_mask & BIT(q->class);
}
static int xe_exec_queue_group_validate(struct xe_device *xe, struct xe_exec_queue *q,
u32 primary_id)
{
@ -931,7 +926,7 @@ static void xe_exec_queue_group_delete(struct xe_device *xe, struct xe_exec_queu
static int exec_queue_set_multi_group(struct xe_device *xe, struct xe_exec_queue *q,
u64 value)
{
if (XE_IOCTL_DBG(xe, !xe_exec_queue_supports_multi_queue(q)))
if (XE_IOCTL_DBG(xe, !xe_gt_supports_multi_queue(q->gt, q->class)))
return -ENODEV;
if (XE_IOCTL_DBG(xe, !xe_device_uc_enabled(xe)))

View File

@ -155,4 +155,19 @@ static inline bool xe_gt_recovery_pending(struct xe_gt *gt)
xe_gt_sriov_vf_recovery_pending(gt);
}
/**
* xe_gt_supports_multi_queue() - Check if gt supports multi queue for the
* specified engine class.
*
* @gt: the GT object
* @class: hwe class type
*
* Return: true if the hw engine class supports multi queue, else false
*/
static inline bool xe_gt_supports_multi_queue(const struct xe_gt *gt,
enum xe_engine_class class)
{
return gt->info.multi_queue_engine_class_mask & BIT(class);
}
#endif