mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 18:51:21 +02:00
drm/xe/pf: Add functions to bulk configure EQ/PT on GT
We already have functions to bulk configure 'hard' resources like GGTT, LMEM or GuC context/doorbells IDs. Now add functions for the 'soft' scheduling parameters, as we will need them soon in the upcoming patches. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patch.msgid.link/20251030222348.186658-9-michal.wajdeczko@intel.com
This commit is contained in:
parent
3c54ef9121
commit
4610da71fc
|
|
@ -1810,6 +1810,34 @@ u32 xe_gt_sriov_pf_config_get_exec_quantum(struct xe_gt *gt, unsigned int vfid)
|
|||
return pf_get_exec_quantum(gt, vfid);
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_gt_sriov_pf_config_bulk_set_exec_quantum_locked() - Configure EQ for PF and VFs.
|
||||
* @gt: the &xe_gt to configure
|
||||
* @exec_quantum: requested execution quantum in milliseconds (0 is infinity)
|
||||
*
|
||||
* This function can only be called on PF with the master mutex hold.
|
||||
*
|
||||
* Return: 0 on success or a negative error code on failure.
|
||||
*/
|
||||
int xe_gt_sriov_pf_config_bulk_set_exec_quantum_locked(struct xe_gt *gt, u32 exec_quantum)
|
||||
{
|
||||
unsigned int totalvfs = xe_gt_sriov_pf_get_totalvfs(gt);
|
||||
unsigned int n;
|
||||
int err = 0;
|
||||
|
||||
lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt));
|
||||
|
||||
for (n = 0; n <= totalvfs; n++) {
|
||||
err = pf_provision_exec_quantum(gt, VFID(n), exec_quantum);
|
||||
if (err)
|
||||
break;
|
||||
}
|
||||
|
||||
return pf_config_bulk_set_u32_done(gt, 0, 1 + totalvfs, exec_quantum,
|
||||
pf_get_exec_quantum, "execution quantum",
|
||||
exec_quantum_unit, n, err);
|
||||
}
|
||||
|
||||
static const char *preempt_timeout_unit(u32 preempt_timeout)
|
||||
{
|
||||
return preempt_timeout ? "us" : "(infinity)";
|
||||
|
|
@ -1912,6 +1940,34 @@ u32 xe_gt_sriov_pf_config_get_preempt_timeout(struct xe_gt *gt, unsigned int vfi
|
|||
return pf_get_preempt_timeout(gt, vfid);
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_gt_sriov_pf_config_bulk_set_preempt_timeout_locked() - Configure PT for PF and VFs.
|
||||
* @gt: the &xe_gt to configure
|
||||
* @preempt_timeout: requested preemption timeout in microseconds (0 is infinity)
|
||||
*
|
||||
* This function can only be called on PF with the master mutex hold.
|
||||
*
|
||||
* Return: 0 on success or a negative error code on failure.
|
||||
*/
|
||||
int xe_gt_sriov_pf_config_bulk_set_preempt_timeout_locked(struct xe_gt *gt, u32 preempt_timeout)
|
||||
{
|
||||
unsigned int totalvfs = xe_gt_sriov_pf_get_totalvfs(gt);
|
||||
unsigned int n;
|
||||
int err = 0;
|
||||
|
||||
lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt));
|
||||
|
||||
for (n = 0; n <= totalvfs; n++) {
|
||||
err = pf_provision_preempt_timeout(gt, VFID(n), preempt_timeout);
|
||||
if (err)
|
||||
break;
|
||||
}
|
||||
|
||||
return pf_config_bulk_set_u32_done(gt, 0, 1 + totalvfs, preempt_timeout,
|
||||
pf_get_preempt_timeout, "preemption timeout",
|
||||
preempt_timeout_unit, n, err);
|
||||
}
|
||||
|
||||
static const char *sched_priority_unit(u32 priority)
|
||||
{
|
||||
return priority == GUC_SCHED_PRIORITY_LOW ? "(low)" :
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ int xe_gt_sriov_pf_config_set_exec_quantum(struct xe_gt *gt, unsigned int vfid,
|
|||
u32 xe_gt_sriov_pf_config_get_exec_quantum_locked(struct xe_gt *gt, unsigned int vfid);
|
||||
int xe_gt_sriov_pf_config_set_exec_quantum_locked(struct xe_gt *gt, unsigned int vfid,
|
||||
u32 exec_quantum);
|
||||
int xe_gt_sriov_pf_config_bulk_set_exec_quantum_locked(struct xe_gt *gt, u32 exec_quantum);
|
||||
|
||||
u32 xe_gt_sriov_pf_config_get_preempt_timeout(struct xe_gt *gt, unsigned int vfid);
|
||||
int xe_gt_sriov_pf_config_set_preempt_timeout(struct xe_gt *gt, unsigned int vfid,
|
||||
|
|
@ -51,6 +52,7 @@ int xe_gt_sriov_pf_config_set_preempt_timeout(struct xe_gt *gt, unsigned int vfi
|
|||
u32 xe_gt_sriov_pf_config_get_preempt_timeout_locked(struct xe_gt *gt, unsigned int vfid);
|
||||
int xe_gt_sriov_pf_config_set_preempt_timeout_locked(struct xe_gt *gt, unsigned int vfid,
|
||||
u32 preempt_timeout);
|
||||
int xe_gt_sriov_pf_config_bulk_set_preempt_timeout_locked(struct xe_gt *gt, u32 preempt_timeout);
|
||||
|
||||
u32 xe_gt_sriov_pf_config_get_sched_priority(struct xe_gt *gt, unsigned int vfid);
|
||||
int xe_gt_sriov_pf_config_set_sched_priority(struct xe_gt *gt, unsigned int vfid, u32 priority);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user