Skip to content

Commit e09be87

Browse files
mwajdeczdanvet
authored andcommitted
drm/i915/guc: Early initialization of GuC send registers
Base offset and count of the GuC scratch registers, used for sending MMIO messages to GuC, can be initialized earlier with other GuC members that also depends on platform. Signed-off-by: Michal Wajdeczko <[email protected]> Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8d99e09 commit e09be87

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/gpu/drm/i915/gt/uc/intel_guc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,8 @@ void intel_guc_init_send_regs(struct intel_guc *guc)
6060
enum forcewake_domains fw_domains = 0;
6161
unsigned int i;
6262

63-
if (INTEL_GEN(gt->i915) >= 11) {
64-
guc->send_regs.base =
65-
i915_mmio_reg_offset(GEN11_SOFT_SCRATCH(0));
66-
guc->send_regs.count = GEN11_SOFT_SCRATCH_COUNT;
67-
} else {
68-
guc->send_regs.base = i915_mmio_reg_offset(SOFT_SCRATCH(0));
69-
guc->send_regs.count = GUC_MAX_MMIO_MSG_LEN;
70-
BUILD_BUG_ON(GUC_MAX_MMIO_MSG_LEN > SOFT_SCRATCH_COUNT);
71-
}
63+
GEM_BUG_ON(!guc->send_regs.base);
64+
GEM_BUG_ON(!guc->send_regs.count);
7265

7366
for (i = 0; i < guc->send_regs.count; i++) {
7467
fw_domains |= intel_uncore_forcewake_for_reg(gt->uncore,
@@ -172,11 +165,18 @@ void intel_guc_init_early(struct intel_guc *guc)
172165
guc->interrupts.reset = gen11_reset_guc_interrupts;
173166
guc->interrupts.enable = gen11_enable_guc_interrupts;
174167
guc->interrupts.disable = gen11_disable_guc_interrupts;
168+
guc->send_regs.base =
169+
i915_mmio_reg_offset(GEN11_SOFT_SCRATCH(0));
170+
guc->send_regs.count = GEN11_SOFT_SCRATCH_COUNT;
171+
175172
} else {
176173
guc->notify_reg = GUC_SEND_INTERRUPT;
177174
guc->interrupts.reset = gen9_reset_guc_interrupts;
178175
guc->interrupts.enable = gen9_enable_guc_interrupts;
179176
guc->interrupts.disable = gen9_disable_guc_interrupts;
177+
guc->send_regs.base = i915_mmio_reg_offset(SOFT_SCRATCH(0));
178+
guc->send_regs.count = GUC_MAX_MMIO_MSG_LEN;
179+
BUILD_BUG_ON(GUC_MAX_MMIO_MSG_LEN > SOFT_SCRATCH_COUNT);
180180
}
181181
}
182182

0 commit comments

Comments
 (0)