Skip to content

Commit 90a5cf0

Browse files
author
Lucas De Marchi
committed
drm/xe/irq: Rename fuse mask variables
It's confusing to refer to some masks as the interrupt masks and others as the fuse masks. Rename the fuse one to make it clearer. Note that the most important role they play here is that the call to xe_hw_engine_mask_per_class() will not only limit the engines according to the fuses, but also by what is available in the specific architecture - the latter is more important information to know what interrupts should be enabled. Add a comment about that. Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://lore.kernel.org/r/20251016-xe3p-v3-17-3dd173a3097a@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent be614ea commit 90a5cf0

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

drivers/gpu/drm/xe/xe_irq.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ void xe_irq_enable_hwe(struct xe_gt *gt)
139139
{
140140
struct xe_device *xe = gt_to_xe(gt);
141141
struct xe_mmio *mmio = &gt->mmio;
142-
u32 ccs_mask, bcs_mask;
143142
u32 irqs, dmask, smask;
144143
u32 gsc_mask = 0;
145144
u32 heci_mask = 0;
@@ -157,36 +156,43 @@ void xe_irq_enable_hwe(struct xe_gt *gt)
157156
GT_WAIT_SEMAPHORE_INTERRUPT;
158157
}
159158

160-
ccs_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_COMPUTE);
161-
bcs_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_COPY);
162-
163159
dmask = irqs << 16 | irqs;
164160
smask = irqs << 16;
165161

166162
if (xe_gt_is_main_type(gt)) {
163+
/*
164+
* For enabling the interrupts, the information about fused off
165+
* engines doesn't matter much, but this also allows to check if
166+
* the engine is available architecturally in the platform
167+
*/
168+
u32 ccs_fuse_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_COMPUTE);
169+
u32 bcs_fuse_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_COPY);
170+
167171
/* Enable interrupts for each engine class */
168172
xe_mmio_write32(mmio, RENDER_COPY_INTR_ENABLE, dmask);
169-
if (ccs_mask)
173+
if (ccs_fuse_mask)
170174
xe_mmio_write32(mmio, CCS_RSVD_INTR_ENABLE, smask);
171175

172176
/* Unmask interrupts for each engine instance */
173177
xe_mmio_write32(mmio, RCS0_RSVD_INTR_MASK, ~smask);
174178
xe_mmio_write32(mmio, BCS_RSVD_INTR_MASK, ~smask);
175-
if (bcs_mask & (BIT(1)|BIT(2)))
179+
if (bcs_fuse_mask & (BIT(1)|BIT(2)))
176180
xe_mmio_write32(mmio, XEHPC_BCS1_BCS2_INTR_MASK, ~dmask);
177-
if (bcs_mask & (BIT(3)|BIT(4)))
181+
if (bcs_fuse_mask & (BIT(3)|BIT(4)))
178182
xe_mmio_write32(mmio, XEHPC_BCS3_BCS4_INTR_MASK, ~dmask);
179-
if (bcs_mask & (BIT(5)|BIT(6)))
183+
if (bcs_fuse_mask & (BIT(5)|BIT(6)))
180184
xe_mmio_write32(mmio, XEHPC_BCS5_BCS6_INTR_MASK, ~dmask);
181-
if (bcs_mask & (BIT(7)|BIT(8)))
185+
if (bcs_fuse_mask & (BIT(7)|BIT(8)))
182186
xe_mmio_write32(mmio, XEHPC_BCS7_BCS8_INTR_MASK, ~dmask);
183-
if (ccs_mask & (BIT(0)|BIT(1)))
187+
if (ccs_fuse_mask & (BIT(0)|BIT(1)))
184188
xe_mmio_write32(mmio, CCS0_CCS1_INTR_MASK, ~dmask);
185-
if (ccs_mask & (BIT(2)|BIT(3)))
189+
if (ccs_fuse_mask & (BIT(2)|BIT(3)))
186190
xe_mmio_write32(mmio, CCS2_CCS3_INTR_MASK, ~dmask);
187191
}
188192

189193
if (xe_gt_is_media_type(gt) || MEDIA_VER(xe) < 13) {
194+
u32 other_fuse_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_OTHER);
195+
190196
/* Enable interrupts for each engine class */
191197
xe_mmio_write32(mmio, VCS_VECS_INTR_ENABLE, dmask);
192198

@@ -199,7 +205,7 @@ void xe_irq_enable_hwe(struct xe_gt *gt)
199205
* the heci2 interrupt is enabled via the same register as the
200206
* GSCCS interrupts, but it has its own mask register.
201207
*/
202-
if (xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_OTHER)) {
208+
if (other_fuse_mask) {
203209
gsc_mask = irqs | GSC_ER_COMPLETE;
204210
heci_mask = GSC_IRQ_INTF(1);
205211
} else if (xe->info.has_heci_gscfi) {

0 commit comments

Comments
 (0)