]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/xe/guc: Rename xe_guc_register_exec_queue
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 8 Sep 2025 12:30:18 +0000 (14:30 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 9 Sep 2025 09:27:42 +0000 (11:27 +0200)
This function is dedicated for use by the VFs, we shouldn't use
name that might suggests it's general purpose. While there, update
asserts to better reflect intended usage.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Link: https://lore.kernel.org/r/20250908123025.747-2-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_guc_submit.c
drivers/gpu/drm/xe/xe_guc_submit.h
drivers/gpu/drm/xe/xe_sriov_vf_ccs.c

index 897f33ded8ec5d57cb43b1dbd43110edd74518b5..2b8da44493aeb33ee3f0c8153638629df8a64c57 100644 (file)
@@ -2528,7 +2528,7 @@ static void guc_exec_queue_print(struct xe_exec_queue *q, struct drm_printer *p)
 }
 
 /**
- * xe_guc_register_exec_queue - Register exec queue for a given context type.
+ * xe_guc_register_vf_exec_queue - Register exec queue for a given context type.
  * @q: Execution queue
  * @ctx_type: Type of the context
  *
@@ -2539,15 +2539,17 @@ static void guc_exec_queue_print(struct xe_exec_queue *q, struct drm_printer *p)
  *
  * Returns - None.
  */
-void xe_guc_register_exec_queue(struct xe_exec_queue *q, int ctx_type)
+void xe_guc_register_vf_exec_queue(struct xe_exec_queue *q, int ctx_type)
 {
        struct xe_guc *guc = exec_queue_to_guc(q);
        struct xe_device *xe = guc_to_xe(guc);
+       struct xe_gt *gt = guc_to_gt(guc);
 
-       xe_assert(xe, IS_SRIOV_VF(xe));
-       xe_assert(xe, !IS_DGFX(xe));
-       xe_assert(xe, (ctx_type > GUC_CONTEXT_NORMAL &&
-                      ctx_type < GUC_CONTEXT_COUNT));
+       xe_gt_assert(gt, IS_SRIOV_VF(xe));
+       xe_gt_assert(gt, !IS_DGFX(xe));
+       xe_gt_assert(gt, ctx_type == GUC_CONTEXT_COMPRESSION_SAVE ||
+                    ctx_type == GUC_CONTEXT_COMPRESSION_RESTORE);
+       xe_gt_assert(gt, GUC_SUBMIT_VER(guc) >= MAKE_GUC_VER(1, 23, 0));
 
        register_exec_queue(q, ctx_type);
        enable_scheduling(q);
index 6b5df5d0956b815fff3b65716e9fe1cd34a3ce5a..9e6f19b03e6542585f981e5bdb296cfa4327db21 100644 (file)
@@ -46,7 +46,7 @@ xe_guc_exec_queue_snapshot_print(struct xe_guc_submit_exec_queue_snapshot *snaps
 void
 xe_guc_exec_queue_snapshot_free(struct xe_guc_submit_exec_queue_snapshot *snapshot);
 void xe_guc_submit_print(struct xe_guc *guc, struct drm_printer *p);
-void xe_guc_register_exec_queue(struct xe_exec_queue *q, int ctx_type);
+void xe_guc_register_vf_exec_queue(struct xe_exec_queue *q, int ctx_type);
 
 int xe_guc_contexts_hwsp_rebase(struct xe_guc *guc, void *scratch);
 
index 908590fa79d4a4fda2544cea278b4ef19ad86296..19786f64a7da08bd7d426e76c1235bc21e38bd45 100644 (file)
@@ -186,7 +186,6 @@ static void ccs_rw_update_ring(struct xe_tile_vf_ccs *ctx)
 
 static int register_save_restore_context(struct xe_tile_vf_ccs *ctx)
 {
-       int err = -EINVAL;
        int ctx_type;
 
        switch (ctx->ctx_id) {
@@ -197,10 +196,10 @@ static int register_save_restore_context(struct xe_tile_vf_ccs *ctx)
                ctx_type = GUC_CONTEXT_COMPRESSION_RESTORE;
                break;
        default:
-               return err;
+               return -EINVAL;
        }
 
-       xe_guc_register_exec_queue(ctx->mig_q, ctx_type);
+       xe_guc_register_vf_exec_queue(ctx->mig_q, ctx_type);
        return 0;
 }