Skip to content

Commit 05b78d2

Browse files
matt-auldmattrope
authored andcommitted
drm/i915/xehp: Changes to ss/eu definitions
Xe_HP no longer has "slices" in the same way that old platforms did. There are new concepts (gslices, cslices, mslices) that apply in various contexts, but for the purposes of fusing slices no longer exist and we just have one large pool of dual-subslices (DSS) to work with. Furthermore, the meaning of the DSS fuse is inverted compared to past platforms --- it now specifies which DSS are enabled rather than which ones are disabled. Cc: Rodrigo Vivi <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Radhakrishna Sripada <[email protected]> Signed-off-by: Stuart Summers <[email protected]> Signed-off-by: Matt Roper <[email protected]> Signed-off-by: Prasad Nallani <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e053163 commit 05b78d2

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,33 @@ static void gen12_sseu_info_init(struct intel_gt *gt)
139139
* Gen12 has Dual-Subslices, which behave similarly to 2 gen11 SS.
140140
* Instead of splitting these, provide userspace with an array
141141
* of DSS to more closely represent the hardware resource.
142+
*
143+
* In addition, the concept of slice has been removed in Xe_HP.
144+
* To be compatible with prior generations, assume a single slice
145+
* across the entire device. Then calculate out the DSS for each
146+
* workload type within that software slice.
142147
*/
143148
intel_sseu_set_info(sseu, 1, 6, 16);
144149

145-
s_en = intel_uncore_read(uncore, GEN11_GT_SLICE_ENABLE) &
146-
GEN11_GT_S_ENA_MASK;
150+
/*
151+
* As mentioned above, Xe_HP does not have the concept of a slice.
152+
* Enable one for software backwards compatibility.
153+
*/
154+
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 50))
155+
s_en = 0x1;
156+
else
157+
s_en = intel_uncore_read(uncore, GEN11_GT_SLICE_ENABLE) &
158+
GEN11_GT_S_ENA_MASK;
147159

148160
dss_en = intel_uncore_read(uncore, GEN12_GT_DSS_ENABLE);
149161

150162
/* one bit per pair of EUs */
151-
eu_en_fuse = ~(intel_uncore_read(uncore, GEN11_EU_DISABLE) &
152-
GEN11_EU_DIS_MASK);
163+
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 50))
164+
eu_en_fuse = intel_uncore_read(uncore, XEHP_EU_ENABLE) & XEHP_EU_ENA_MASK;
165+
else
166+
eu_en_fuse = ~(intel_uncore_read(uncore, GEN11_EU_DISABLE) &
167+
GEN11_EU_DIS_MASK);
168+
153169
for (eu = 0; eu < sseu->max_eus_per_subslice / 2; eu++)
154170
if (eu_en_fuse & BIT(eu))
155171
eu_en |= BIT(eu * 2) | BIT(eu * 2 + 1);

drivers/gpu/drm/i915/i915_getparam.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
1515
struct pci_dev *pdev = to_pci_dev(dev->dev);
1616
const struct sseu_dev_info *sseu = &i915->gt.info.sseu;
1717
drm_i915_getparam_t *param = data;
18-
int value;
18+
int value = 0;
1919

2020
switch (param->param) {
2121
case I915_PARAM_IRQ_ACTIVE:
@@ -150,7 +150,9 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
150150
return -ENODEV;
151151
break;
152152
case I915_PARAM_SUBSLICE_MASK:
153-
value = sseu->subslice_mask[0];
153+
/* Only copy bits from the first slice */
154+
memcpy(&value, sseu->subslice_mask,
155+
min(sseu->ss_stride, (u8)sizeof(value)));
154156
if (!value)
155157
return -ENODEV;
156158
break;

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,6 +3156,9 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
31563156

31573157
#define GEN12_GT_DSS_ENABLE _MMIO(0x913C)
31583158

3159+
#define XEHP_EU_ENABLE _MMIO(0x9134)
3160+
#define XEHP_EU_ENA_MASK 0xFF
3161+
31593162
#define GEN6_BSD_SLEEP_PSMI_CONTROL _MMIO(0x12050)
31603163
#define GEN6_BSD_SLEEP_MSG_DISABLE (1 << 0)
31613164
#define GEN6_BSD_SLEEP_FLUSH_DISABLE (1 << 2)

0 commit comments

Comments
 (0)