Commit 7065b19b authored by Michal Wajdeczko's avatar Michal Wajdeczko

drm/xe/guc: Allow to initialize submission with limited set of IDs

While PF and native drivers may initialize submission code to use
all available GuC contexts IDs, the VF driver may only use limited
number of IDs. Update init function to accept number of context
IDs available for use.
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240521092518.624-2-michal.wajdeczko@intel.com
parent f7e20cfb
......@@ -358,7 +358,7 @@ int xe_guc_init_post_hwconfig(struct xe_guc *guc)
guc_init_params_post_hwconfig(guc);
ret = xe_guc_submit_init(guc);
ret = xe_guc_submit_init(guc, ~0);
if (ret)
return ret;
......
......@@ -278,7 +278,20 @@ static void primelockdep(struct xe_guc *guc)
fs_reclaim_release(GFP_KERNEL);
}
int xe_guc_submit_init(struct xe_guc *guc)
/**
* xe_guc_submit_init() - Initialize GuC submission.
* @guc: the &xe_guc to initialize
* @num_ids: number of GuC context IDs to use
*
* The bare-metal or PF driver can pass ~0 as &num_ids to indicate that all
* GuC context IDs supported by the GuC firmware should be used for submission.
*
* Only VF drivers will have to provide explicit number of GuC context IDs
* that they can use for submission.
*
* Return: 0 on success or a negative error code on failure.
*/
int xe_guc_submit_init(struct xe_guc *guc, unsigned int num_ids)
{
struct xe_device *xe = guc_to_xe(guc);
struct xe_gt *gt = guc_to_gt(guc);
......@@ -288,7 +301,7 @@ int xe_guc_submit_init(struct xe_guc *guc)
if (err)
return err;
err = xe_guc_id_mgr_init(&guc->submission_state.idm, ~0);
err = xe_guc_id_mgr_init(&guc->submission_state.idm, num_ids);
if (err)
return err;
......
......@@ -12,7 +12,7 @@ struct drm_printer;
struct xe_exec_queue;
struct xe_guc;
int xe_guc_submit_init(struct xe_guc *guc);
int xe_guc_submit_init(struct xe_guc *guc, unsigned int num_ids);
int xe_guc_submit_reset_prepare(struct xe_guc *guc);
void xe_guc_submit_reset_wait(struct xe_guc *guc);
......
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