]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/guc: Unblock GuC submission on Gen11+
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Tue, 27 Jul 2021 00:23:48 +0000 (17:23 -0700)
committerJohn Harrison <John.C.Harrison@Intel.com>
Wed, 28 Jul 2021 00:32:30 +0000 (17:32 -0700)
Unblock GuC submission on Gen11+ platforms.

v2:
 (Martin Peres / John H)
  - Delete debug message when GuC is disabled by default on certain
    platforms

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210727002348.97202-34-matthew.brost@intel.com
drivers/gpu/drm/i915/gt/uc/intel_guc.h
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h
drivers/gpu/drm/i915/gt/uc/intel_uc.c

index 8ab70a2223b03642af1ce96606523169f5b0df51..a9547069ee7eda78b12eac7104b305dc3481b190 100644 (file)
@@ -55,6 +55,7 @@ struct intel_guc {
        struct ida guc_ids;
        struct list_head guc_id_list;
 
+       bool submission_supported;
        bool submission_selected;
 
        struct i915_vma *ads_vma;
index b760cbf6ca0ef9705ce47559cdadff5a742fb3cb..89ff0e4b4bc70f3749939876e1b47255add3c412 100644 (file)
@@ -2543,6 +2543,13 @@ void intel_guc_submission_disable(struct intel_guc *guc)
        /* Note: By the time we're here, GuC may have already been reset */
 }
 
+static bool __guc_submission_supported(struct intel_guc *guc)
+{
+       /* GuC submission is unavailable for pre-Gen11 */
+       return intel_guc_is_supported(guc) &&
+              GRAPHICS_VER(guc_to_gt(guc)->i915) >= 11;
+}
+
 static bool __guc_submission_selected(struct intel_guc *guc)
 {
        struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
@@ -2555,6 +2562,7 @@ static bool __guc_submission_selected(struct intel_guc *guc)
 
 void intel_guc_submission_init_early(struct intel_guc *guc)
 {
+       guc->submission_supported = __guc_submission_supported(guc);
        guc->submission_selected = __guc_submission_selected(guc);
 }
 
index 03bc1c83a4d2cb4d384b97e4a858809412f7697b..c7ef44fa0c369f457dfa752b3474919b92bffe0f 100644 (file)
@@ -38,8 +38,7 @@ int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
 
 static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
 {
-       /* XXX: GuC submission is unavailable for now */
-       return false;
+       return guc->submission_supported;
 }
 
 static inline bool intel_guc_submission_is_wanted(struct intel_guc *guc)
index 7a69c3c027e9df65b972562592c05a840916f37c..da57d18d9f6b3deafa681f7e95d2fb39ef0095b6 100644 (file)
@@ -34,8 +34,14 @@ static void uc_expand_default_options(struct intel_uc *uc)
                return;
        }
 
-       /* Default: enable HuC authentication only */
-       i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+       /* Intermediate platforms are HuC authentication only */
+       if (IS_DG1(i915) || IS_ALDERLAKE_S(i915)) {
+               i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
+               return;
+       }
+
+       /* Default: enable HuC authentication and GuC submission */
+       i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION;
 }
 
 /* Reset GuC providing us with fresh state for both GuC and HuC.
@@ -313,9 +319,6 @@ static int __uc_init(struct intel_uc *uc)
        if (i915_inject_probe_failure(uc_to_gt(uc)->i915))
                return -ENOMEM;
 
-       /* XXX: GuC submission is unavailable for now */
-       GEM_BUG_ON(intel_uc_uses_guc_submission(uc));
-
        ret = intel_guc_init(guc);
        if (ret)
                return ret;