Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ee01b6a

Browse files
Andi Shytijnikula
authored andcommitted
drm/i915/gt: Fix CCS id's calculation for CCS mode setting
The whole point of the previous fixes has been to change the CCS hardware configuration to generate only one stream available to the compute users. We did this by changing the info.engine_mask that is set during device probe, reset during the detection of the fused engines, and finally reset again when choosing the CCS mode. We can't use the engine_mask variable anymore, as with the current configuration, it imposes only one CCS no matter what the hardware configuration is. Before changing the engine_mask for the third time, save it and use it for calculating the CCS mode. After the previous changes, the user reported a performance drop to around 1/4. We have tested that the compute operations, with the current patch, have improved by the same factor. Fixes: 6db3125 ("drm/i915/gt: Enable only one CCS for compute workload") Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> Cc: Chris Wilson <chris.p.wilson@linux.intel.com> Cc: Gnattu OC <gnattuoc@me.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Tested-by: Jian Ye <jian.ye@intel.com> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Tested-by: Gnattu OC <gnattuoc@me.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240517090616.242529-1-andi.shyti@linux.intel.com (cherry picked from commit a09d232) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 659a306 commit ee01b6a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,12 @@ static intel_engine_mask_t init_engine_mask(struct intel_gt *gt)
885885
if (IS_DG2(gt->i915)) {
886886
u8 first_ccs = __ffs(CCS_MASK(gt));
887887

888+
/*
889+
* Store the number of active cslices before
890+
* changing the CCS engine configuration
891+
*/
892+
gt->ccs.cslices = CCS_MASK(gt);
893+
888894
/* Mask off all the CCS engine */
889895
info->engine_mask &= ~GENMASK(CCS3, CCS0);
890896
/* Put back in the first CCS engine */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ unsigned int intel_gt_apply_ccs_mode(struct intel_gt *gt)
1919

2020
/* Build the value for the fixed CCS load balancing */
2121
for (cslice = 0; cslice < I915_MAX_CCS; cslice++) {
22-
if (CCS_MASK(gt) & BIT(cslice))
22+
if (gt->ccs.cslices & BIT(cslice))
2323
/*
2424
* If available, assign the cslice
2525
* to the first available engine...

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ struct intel_gt {
207207
[MAX_ENGINE_INSTANCE + 1];
208208
enum intel_submission_method submission_method;
209209

210+
struct {
211+
/*
212+
* Mask of the non fused CCS slices
213+
* to be used for the load balancing
214+
*/
215+
intel_engine_mask_t cslices;
216+
} ccs;
217+
210218
/*
211219
* Default address space (either GGTT or ppGTT depending on arch).
212220
*

0 commit comments

Comments
 (0)