]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/i915/gt: Automate CCS Mode setting during engine resets
authorAndi Shyti <andi.shyti@linux.intel.com>
Fri, 26 Apr 2024 00:07:23 +0000 (02:07 +0200)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Mon, 6 May 2024 18:15:24 +0000 (14:15 -0400)
We missed setting the CCS mode during resume and engine resets.
Create a workaround to be added in the engine's workaround list.
This workaround sets the XEHP_CCS_MODE value at every reset.

The issue can be reproduced by running:

  $ clpeak --kernel-latency

Without resetting the CCS mode, we encounter a fence timeout:

  Fence expiration time out i915-0000:03:00.0:clpeak[2387]:2!

Fixes: 6db31251bb26 ("drm/i915/gt: Enable only one CCS for compute workload")
Reported-by: Gnattu OC <gnattuoc@me.com>
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10895
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Chris Wilson <chris.p.wilson@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: <stable@vger.kernel.org> # v6.2+
Tested-by: Gnattu OC <gnattuoc@me.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Tested-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240426000723.229296-1-andi.shyti@linux.intel.com
(cherry picked from commit 4cfca03f76413db115c3cc18f4370debb1b81b2b)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.c
drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.h
drivers/gpu/drm/i915/gt/intel_workarounds.c

index 044219c5960a5385b7c07b3ded67bc3c48db6330..99b71bb7da0a6bb8a1f905ab71fcdadf61037e78 100644 (file)
@@ -8,14 +8,14 @@
 #include "intel_gt_ccs_mode.h"
 #include "intel_gt_regs.h"
 
-void intel_gt_apply_ccs_mode(struct intel_gt *gt)
+unsigned int intel_gt_apply_ccs_mode(struct intel_gt *gt)
 {
        int cslice;
        u32 mode = 0;
        int first_ccs = __ffs(CCS_MASK(gt));
 
        if (!IS_DG2(gt->i915))
-               return;
+               return 0;
 
        /* Build the value for the fixed CCS load balancing */
        for (cslice = 0; cslice < I915_MAX_CCS; cslice++) {
@@ -35,5 +35,5 @@ void intel_gt_apply_ccs_mode(struct intel_gt *gt)
                                                     XEHP_CCS_MODE_CSLICE_MASK);
        }
 
-       intel_uncore_write(gt->uncore, XEHP_CCS_MODE, mode);
+       return mode;
 }
index 9e5549caeb269328c2f2a33a783b257dec3e5a8d..55547f2ff426a46040842617d34a50339b03d737 100644 (file)
@@ -8,6 +8,6 @@
 
 struct intel_gt;
 
-void intel_gt_apply_ccs_mode(struct intel_gt *gt);
+unsigned int intel_gt_apply_ccs_mode(struct intel_gt *gt);
 
 #endif /* __INTEL_GT_CCS_MODE_H__ */
index 6ec3582c97357780f823865cf0a9a9581b50d288..85c860ea9d7c2288983e417c1c258c309d4b599b 100644 (file)
@@ -2859,6 +2859,7 @@ add_render_compute_tuning_settings(struct intel_gt *gt,
 static void ccs_engine_wa_mode(struct intel_engine_cs *engine, struct i915_wa_list *wal)
 {
        struct intel_gt *gt = engine->gt;
+       u32 mode;
 
        if (!IS_DG2(gt->i915))
                return;
@@ -2875,7 +2876,8 @@ static void ccs_engine_wa_mode(struct intel_engine_cs *engine, struct i915_wa_li
         * After having disabled automatic load balancing we need to
         * assign all slices to a single CCS. We will call it CCS mode 1
         */
-       intel_gt_apply_ccs_mode(gt);
+       mode = intel_gt_apply_ccs_mode(gt);
+       wa_masked_en(wal, XEHP_CCS_MODE, mode);
 }
 
 /*