Skip to content

Commit 51c1b42

Browse files
Andi Shytirodrigovivi
authored andcommitted
drm/i915/gt: Automate CCS Mode setting during engine resets
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: 6db3125 ("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 4cfca03) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent dd5a440 commit 51c1b42

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
#include "intel_gt_ccs_mode.h"
99
#include "intel_gt_regs.h"
1010

11-
void intel_gt_apply_ccs_mode(struct intel_gt *gt)
11+
unsigned int intel_gt_apply_ccs_mode(struct intel_gt *gt)
1212
{
1313
int cslice;
1414
u32 mode = 0;
1515
int first_ccs = __ffs(CCS_MASK(gt));
1616

1717
if (!IS_DG2(gt->i915))
18-
return;
18+
return 0;
1919

2020
/* Build the value for the fixed CCS load balancing */
2121
for (cslice = 0; cslice < I915_MAX_CCS; cslice++) {
@@ -35,5 +35,5 @@ void intel_gt_apply_ccs_mode(struct intel_gt *gt)
3535
XEHP_CCS_MODE_CSLICE_MASK);
3636
}
3737

38-
intel_uncore_write(gt->uncore, XEHP_CCS_MODE, mode);
38+
return mode;
3939
}

drivers/gpu/drm/i915/gt/intel_gt_ccs_mode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
struct intel_gt;
1010

11-
void intel_gt_apply_ccs_mode(struct intel_gt *gt);
11+
unsigned int intel_gt_apply_ccs_mode(struct intel_gt *gt);
1212

1313
#endif /* __INTEL_GT_CCS_MODE_H__ */

drivers/gpu/drm/i915/gt/intel_workarounds.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2859,6 +2859,7 @@ add_render_compute_tuning_settings(struct intel_gt *gt,
28592859
static void ccs_engine_wa_mode(struct intel_engine_cs *engine, struct i915_wa_list *wal)
28602860
{
28612861
struct intel_gt *gt = engine->gt;
2862+
u32 mode;
28622863

28632864
if (!IS_DG2(gt->i915))
28642865
return;
@@ -2875,7 +2876,8 @@ static void ccs_engine_wa_mode(struct intel_engine_cs *engine, struct i915_wa_li
28752876
* After having disabled automatic load balancing we need to
28762877
* assign all slices to a single CCS. We will call it CCS mode 1
28772878
*/
2878-
intel_gt_apply_ccs_mode(gt);
2879+
mode = intel_gt_apply_ccs_mode(gt);
2880+
wa_masked_en(wal, XEHP_CCS_MODE, mode);
28792881
}
28802882

28812883
/*

0 commit comments

Comments
 (0)