]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/xe/guc: Allow to initialize submission with limited set of IDs
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 21 May 2024 09:25:17 +0000 (11:25 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 22 May 2024 10:53:43 +0000 (12:53 +0200)
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: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240521092518.624-2-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_guc.c
drivers/gpu/drm/xe/xe_guc_submit.c
drivers/gpu/drm/xe/xe_guc_submit.h

index e52b544ac690f8b50e803370bdeb34ad509a966c..807ad53449e460a05f77245b0da44367e46c9f2e 100644 (file)
@@ -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;
 
index ad2b8067d071920c9f69e1a04bf30b04450ea468..b041b7676c086af975625d7c226cc05b34a9fcab 100644 (file)
@@ -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;
 
index 4275b7da9df5f908834e34dd002150464f8883a5..4ad5f4c1b08428ac7ac21cf90292e8d93bb3092a 100644 (file)
@@ -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);