Skip to content

Commit b910f71

Browse files
committed
drm/i915/guc: define media GT GuC send regs
The media GT shares the G-unit with the root GT, so a second set of communication registers is required for the media GuC. Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Cc: John Harrison <[email protected]> Cc: Alan Previn <[email protected]> Reviewed-by: John Harrison <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ee71434 commit b910f71

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ static void gen11_disable_guc_interrupts(struct intel_guc *guc)
156156

157157
void intel_guc_init_early(struct intel_guc *guc)
158158
{
159-
struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
159+
struct intel_gt *gt = guc_to_gt(guc);
160+
struct drm_i915_private *i915 = gt->i915;
160161

161162
intel_uc_fw_init_early(&guc->fw, INTEL_UC_FW_TYPE_GUC);
162163
intel_guc_ct_init_early(&guc->ct);
@@ -168,12 +169,17 @@ void intel_guc_init_early(struct intel_guc *guc)
168169
mutex_init(&guc->send_mutex);
169170
spin_lock_init(&guc->irq_lock);
170171
if (GRAPHICS_VER(i915) >= 11) {
171-
guc->notify_reg = GEN11_GUC_HOST_INTERRUPT;
172172
guc->interrupts.reset = gen11_reset_guc_interrupts;
173173
guc->interrupts.enable = gen11_enable_guc_interrupts;
174174
guc->interrupts.disable = gen11_disable_guc_interrupts;
175-
guc->send_regs.base =
176-
i915_mmio_reg_offset(GEN11_SOFT_SCRATCH(0));
175+
if (gt->type == GT_MEDIA) {
176+
guc->notify_reg = MEDIA_GUC_HOST_INTERRUPT;
177+
guc->send_regs.base = i915_mmio_reg_offset(MEDIA_SOFT_SCRATCH(0));
178+
} else {
179+
guc->notify_reg = GEN11_GUC_HOST_INTERRUPT;
180+
guc->send_regs.base = i915_mmio_reg_offset(GEN11_SOFT_SCRATCH(0));
181+
}
182+
177183
guc->send_regs.count = GEN11_SOFT_SCRATCH_COUNT;
178184

179185
} else {

drivers/gpu/drm/i915/gt/uc/intel_guc_reg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define SOFT_SCRATCH_COUNT 16
3737

3838
#define GEN11_SOFT_SCRATCH(n) _MMIO(0x190240 + (n) * 4)
39+
#define MEDIA_SOFT_SCRATCH(n) _MMIO(0x190310 + (n) * 4)
3940
#define GEN11_SOFT_SCRATCH_COUNT 4
4041

4142
#define UOS_RSA_SCRATCH(i) _MMIO(0xc200 + (i) * 4)
@@ -101,6 +102,7 @@
101102
#define GUC_SEND_INTERRUPT _MMIO(0xc4c8)
102103
#define GUC_SEND_TRIGGER (1<<0)
103104
#define GEN11_GUC_HOST_INTERRUPT _MMIO(0x1901f0)
105+
#define MEDIA_GUC_HOST_INTERRUPT _MMIO(0x190304)
104106

105107
#define GEN12_GUC_SEM_INTR_ENABLES _MMIO(0xc71c)
106108
#define GUC_SEM_INTR_ROUTE_TO_GUC BIT(31)

0 commit comments

Comments
 (0)