Lines Matching defs:sseu

14 void intel_sseu_set_info(struct sseu_dev_info *sseu, u8 max_slices,
17 sseu->max_slices = max_slices;
18 sseu->max_subslices = max_subslices;
19 sseu->max_eus_per_subslice = max_eus_per_subslice;
23 intel_sseu_subslice_total(const struct sseu_dev_info *sseu)
27 if (sseu->has_xehp_dss)
28 return bitmap_weight(sseu->subslice_mask.xehp,
29 XEHP_BITMAP_BITS(sseu->subslice_mask));
31 for (i = 0; i < ARRAY_SIZE(sseu->subslice_mask.hsw); i++)
32 total += hweight8(sseu->subslice_mask.hsw[i]);
38 intel_sseu_get_hsw_subslices(const struct sseu_dev_info *sseu, u8 slice)
40 WARN_ON(sseu->has_xehp_dss);
41 if (WARN_ON(slice >= sseu->max_slices))
44 return sseu->subslice_mask.hsw[slice];
47 static u16 sseu_get_eus(const struct sseu_dev_info *sseu, int slice,
50 if (sseu->has_xehp_dss) {
52 return sseu->eu_mask.xehp[subslice];
54 return sseu->eu_mask.hsw[slice][subslice];
58 static void sseu_set_eus(struct sseu_dev_info *sseu, int slice, int subslice,
61 GEM_WARN_ON(eu_mask && __fls(eu_mask) >= sseu->max_eus_per_subslice);
62 if (sseu->has_xehp_dss) {
64 sseu->eu_mask.xehp[subslice] = eu_mask;
66 sseu->eu_mask.hsw[slice][subslice] = eu_mask;
70 static u16 compute_eu_total(const struct sseu_dev_info *sseu)
74 for (s = 0; s < sseu->max_slices; s++)
75 for (ss = 0; ss < sseu->max_subslices; ss++)
76 if (sseu->has_xehp_dss)
77 total += hweight16(sseu->eu_mask.xehp[ss]);
79 total += hweight16(sseu->eu_mask.hsw[s][ss]);
87 * @sseu: SSEU structure containing EU mask to copy
95 const struct sseu_dev_info *sseu)
98 int eu_stride = GEN_SSEU_STRIDE(sseu->max_eus_per_subslice);
99 int len = sseu->max_slices * sseu->max_subslices * eu_stride;
102 for (s = 0; s < sseu->max_slices; s++) {
103 for (ss = 0; ss < sseu->max_subslices; ss++) {
105 s * sseu->max_subslices * eu_stride +
107 u16 mask = sseu_get_eus(sseu, s, ss);
121 * @sseu: SSEU structure containing subslice mask to copy
129 const struct sseu_dev_info *sseu)
132 int ss_stride = GEN_SSEU_STRIDE(sseu->max_subslices);
133 int len = sseu->max_slices * ss_stride;
136 for (s = 0; s < sseu->max_slices; s++) {
137 for (ss = 0; ss < sseu->max_subslices; ss++) {
140 if (!intel_sseu_has_subslice(sseu, s, ss))
150 static void gen11_compute_sseu_info(struct sseu_dev_info *sseu,
153 u32 valid_ss_mask = GENMASK(sseu->max_subslices - 1, 0);
156 sseu->slice_mask |= BIT(0);
157 sseu->subslice_mask.hsw[0] = ss_en & valid_ss_mask;
159 for (ss = 0; ss < sseu->max_subslices; ss++)
160 if (intel_sseu_has_subslice(sseu, 0, ss))
161 sseu_set_eus(sseu, 0, ss, eu_en);
163 sseu->eu_per_subslice = hweight16(eu_en);
164 sseu->eu_total = compute_eu_total(sseu);
167 static void xehp_compute_sseu_info(struct sseu_dev_info *sseu,
172 sseu->slice_mask |= BIT(0);
174 bitmap_or(sseu->subslice_mask.xehp,
175 sseu->compute_subslice_mask.xehp,
176 sseu->geometry_subslice_mask.xehp,
177 XEHP_BITMAP_BITS(sseu->subslice_mask));
179 for (ss = 0; ss < sseu->max_subslices; ss++)
180 if (intel_sseu_has_subslice(sseu, 0, ss))
181 sseu_set_eus(sseu, 0, ss, eu_en);
183 sseu->eu_per_subslice = hweight16(eu_en);
184 sseu->eu_total = compute_eu_total(sseu);
210 struct sseu_dev_info *sseu = &gt->info.sseu;
226 intel_sseu_set_info(sseu, 1,
229 sseu->has_xehp_dss = 1;
231 xehp_load_dss_mask(uncore, &sseu->geometry_subslice_mask,
234 xehp_load_dss_mask(uncore, &sseu->compute_subslice_mask,
245 for (eu = 0; eu < sseu->max_eus_per_subslice / 2; eu++)
249 xehp_compute_sseu_info(sseu, eu_en);
254 struct sseu_dev_info *sseu = &gt->info.sseu;
267 intel_sseu_set_info(sseu, 1, 6, 16);
283 for (eu = 0; eu < sseu->max_eus_per_subslice / 2; eu++)
287 gen11_compute_sseu_info(sseu, g_dss_en, eu_en);
290 sseu->has_slice_pg = 1;
295 struct sseu_dev_info *sseu = &gt->info.sseu;
302 intel_sseu_set_info(sseu, 1, 4, 8);
304 intel_sseu_set_info(sseu, 1, 8, 8);
319 gen11_compute_sseu_info(sseu, ss_en, eu_en);
322 sseu->has_slice_pg = 1;
323 sseu->has_subslice_pg = 1;
324 sseu->has_eu_pg = 1;
329 struct sseu_dev_info *sseu = &gt->info.sseu;
334 sseu->slice_mask = BIT(0);
335 intel_sseu_set_info(sseu, 1, 2, 8);
342 sseu->subslice_mask.hsw[0] |= BIT(0);
343 sseu_set_eus(sseu, 0, 0, ~disabled_mask & 0xFF);
351 sseu->subslice_mask.hsw[0] |= BIT(1);
352 sseu_set_eus(sseu, 0, 1, ~disabled_mask & 0xFF);
355 sseu->eu_total = compute_eu_total(sseu);
361 sseu->eu_per_subslice = intel_sseu_subslice_total(sseu) ?
362 sseu->eu_total /
363 intel_sseu_subslice_total(sseu) :
370 sseu->has_slice_pg = 0;
371 sseu->has_subslice_pg = intel_sseu_subslice_total(sseu) > 1;
372 sseu->has_eu_pg = (sseu->eu_per_subslice > 2);
378 struct sseu_dev_info *sseu = &gt->info.sseu;
385 sseu->slice_mask = REG_FIELD_GET(GEN8_F2_S_ENA_MASK, fuse2);
388 intel_sseu_set_info(sseu, IS_GEN9_LP(i915) ? 1 : 3,
395 subslice_mask = (1 << sseu->max_subslices) - 1;
402 for (s = 0; s < sseu->max_slices; s++) {
403 if (!(sseu->slice_mask & BIT(s)))
407 sseu->subslice_mask.hsw[s] = subslice_mask;
410 for (ss = 0; ss < sseu->max_subslices; ss++) {
414 if (!intel_sseu_has_subslice(sseu, s, ss))
420 sseu_set_eus(sseu, s, ss, ~eu_disabled_mask & eu_mask);
422 eu_per_ss = sseu->max_eus_per_subslice -
431 sseu->subslice_7eu[s] |= BIT(ss);
435 sseu->eu_total = compute_eu_total(sseu);
444 sseu->eu_per_subslice =
445 intel_sseu_subslice_total(sseu) ?
446 DIV_ROUND_UP(sseu->eu_total, intel_sseu_subslice_total(sseu)) :
457 sseu->has_slice_pg =
458 !IS_GEN9_LP(i915) && hweight8(sseu->slice_mask) > 1;
459 sseu->has_subslice_pg =
460 IS_GEN9_LP(i915) && intel_sseu_subslice_total(sseu) > 1;
461 sseu->has_eu_pg = sseu->eu_per_subslice > 2;
464 #define IS_SS_DISABLED(ss) (!(sseu->subslice_mask.hsw[0] & BIT(ss)))
465 RUNTIME_INFO(i915)->has_pooled_eu = hweight8(sseu->subslice_mask.hsw[0]) == 3;
467 sseu->min_eu_in_pool = 0;
470 sseu->min_eu_in_pool = 3;
472 sseu->min_eu_in_pool = 6;
474 sseu->min_eu_in_pool = 9;
482 struct sseu_dev_info *sseu = &gt->info.sseu;
489 sseu->slice_mask = REG_FIELD_GET(GEN8_F2_S_ENA_MASK, fuse2);
490 intel_sseu_set_info(sseu, 3, 3, 8);
496 subslice_mask = GENMASK(sseu->max_subslices - 1, 0);
514 for (s = 0; s < sseu->max_slices; s++) {
515 if (!(sseu->slice_mask & BIT(s)))
519 sseu->subslice_mask.hsw[s] = subslice_mask;
521 for (ss = 0; ss < sseu->max_subslices; ss++) {
525 if (!intel_sseu_has_subslice(sseu, s, ss))
530 eu_disable[s] >> (ss * sseu->max_eus_per_subslice);
532 sseu_set_eus(sseu, s, ss, ~eu_disabled_mask & 0xFF);
539 if (sseu->max_eus_per_subslice - n_disabled == 7)
540 sseu->subslice_7eu[s] |= 1 << ss;
544 sseu->eu_total = compute_eu_total(sseu);
551 sseu->eu_per_subslice =
552 intel_sseu_subslice_total(sseu) ?
553 DIV_ROUND_UP(sseu->eu_total, intel_sseu_subslice_total(sseu)) :
560 sseu->has_slice_pg = hweight8(sseu->slice_mask) > 1;
561 sseu->has_subslice_pg = 0;
562 sseu->has_eu_pg = 0;
568 struct sseu_dev_info *sseu = &gt->info.sseu;
582 sseu->slice_mask = BIT(0);
586 sseu->slice_mask = BIT(0);
590 sseu->slice_mask = BIT(0) | BIT(1);
601 sseu->eu_per_subslice = 10;
604 sseu->eu_per_subslice = 8;
607 sseu->eu_per_subslice = 6;
611 intel_sseu_set_info(sseu, hweight8(sseu->slice_mask),
613 sseu->eu_per_subslice);
615 for (s = 0; s < sseu->max_slices; s++) {
616 sseu->subslice_mask.hsw[s] = subslice_mask;
618 for (ss = 0; ss < sseu->max_subslices; ss++) {
619 sseu_set_eus(sseu, s, ss,
620 (1UL << sseu->eu_per_subslice) - 1);
624 sseu->eu_total = compute_eu_total(sseu);
627 sseu->has_slice_pg = 0;
628 sseu->has_subslice_pg = 0;
629 sseu->has_eu_pg = 0;
656 const struct sseu_dev_info *sseu = &gt->info.sseu;
657 bool subslice_pg = sseu->has_subslice_pg;
673 req_sseu = &gt->perf.sseu;
705 subslices > min_t(u8, 4, hweight8(sseu->subslice_mask.hsw[0]) / 2)) {
718 if (sseu->has_slice_pg) {
746 if (sseu->has_eu_pg) {
767 void intel_sseu_dump(const struct sseu_dev_info *sseu, struct drm_printer *p)
771 if (sseu->has_xehp_dss) {
773 intel_sseu_subslice_total(sseu));
775 XEHP_BITMAP_BITS(sseu->geometry_subslice_mask),
776 sseu->geometry_subslice_mask.xehp);
778 XEHP_BITMAP_BITS(sseu->compute_subslice_mask),
779 sseu->compute_subslice_mask.xehp);
782 hweight8(sseu->slice_mask), sseu->slice_mask);
784 intel_sseu_subslice_total(sseu));
786 for (s = 0; s < sseu->max_slices; s++) {
787 u8 ss_mask = sseu->subslice_mask.hsw[s];
794 drm_printf(p, "EU total: %u\n", sseu->eu_total);
795 drm_printf(p, "EU per subslice: %u\n", sseu->eu_per_subslice);
797 str_yes_no(sseu->has_slice_pg));
799 str_yes_no(sseu->has_subslice_pg));
801 str_yes_no(sseu->has_eu_pg));
804 static void sseu_print_hsw_topology(const struct sseu_dev_info *sseu,
809 for (s = 0; s < sseu->max_slices; s++) {
810 u8 ss_mask = sseu->subslice_mask.hsw[s];
815 for (ss = 0; ss < sseu->max_subslices; ss++) {
816 u16 enabled_eus = sseu_get_eus(sseu, s, ss);
824 static void sseu_print_xehp_topology(const struct sseu_dev_info *sseu,
829 for (dss = 0; dss < sseu->max_subslices; dss++) {
830 u16 enabled_eus = sseu_get_eus(sseu, 0, dss);
833 str_yes_no(test_bit(dss, sseu->geometry_subslice_mask.xehp)),
834 str_yes_no(test_bit(dss, sseu->compute_subslice_mask.xehp)),
840 const struct sseu_dev_info *sseu,
843 if (sseu->max_slices == 0)
846 sseu_print_xehp_topology(sseu, p);
848 sseu_print_hsw_topology(sseu, p);
852 const struct sseu_dev_info *sseu,
857 if (sseu->has_xehp_dss) {
859 bitmap_weight(sseu->geometry_subslice_mask.xehp,
860 XEHP_BITMAP_BITS(sseu->geometry_subslice_mask)));
862 bitmap_weight(sseu->compute_subslice_mask.xehp,
863 XEHP_BITMAP_BITS(sseu->compute_subslice_mask)));
865 for (s = 0; s < fls(sseu->slice_mask); s++)
867 s, hweight8(sseu->subslice_mask.hsw[s]));