Skip to content

Commit 9cc3e4e

Browse files
committed
Merge tag 'drm-xe-next-2025-01-07' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
UAPI Changes: - OA new property: 'unblock after N reports' (Ashutosh) i915 display Changes: - UHBR rates for Thunderbolt (Kahola) Driver Changes: - IRQ related fixes and improvements (Ilia) - Revert some changes that break a mesa debug tool (John) - Fix migration issues (Nirmoy) - Enable GuC's WA_DUAL_QUEUE for newer platforms (Daniele) - Move shrink test out of xe_bo (Nirmoy) - SRIOV PF: Use correct function to check LMEM provisioning (Michal) - Fix a false-positive "Missing outer runtime PM protection" warning (Rodrigo) - Make GSCCS disabling message less alarming (Daniele) - Fix DG1 power gate sequence (Rodrigo) - Xe files fixes (Lucas) - Fix a potential TP_printk UAF (Thomas) - OA Fixes (Umesh) - Fix tlb invalidation when wedging (Lucas) - Documentation fix (Lucas) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 0739b8b + 6acea03 commit 9cc3e4e

36 files changed

+589
-281
lines changed

drivers/gpu/drm/i915/display/intel_cx0_phy.c

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,7 +3070,10 @@ int intel_mtl_tbt_calc_port_clock(struct intel_encoder *encoder)
30703070

30713071
val = intel_de_read(display, XELPDP_PORT_CLOCK_CTL(display, encoder->port));
30723072

3073-
clock = REG_FIELD_GET(XELPDP_DDI_CLOCK_SELECT_MASK, val);
3073+
if (DISPLAY_VER(display) >= 30)
3074+
clock = REG_FIELD_GET(XE3_DDI_CLOCK_SELECT_MASK, val);
3075+
else
3076+
clock = REG_FIELD_GET(XELPDP_DDI_CLOCK_SELECT_MASK, val);
30743077

30753078
drm_WARN_ON(display->drm, !(val & XELPDP_FORWARD_CLOCK_UNGATE));
30763079
drm_WARN_ON(display->drm, !(val & XELPDP_TBT_CLOCK_REQUEST));
@@ -3085,13 +3088,18 @@ int intel_mtl_tbt_calc_port_clock(struct intel_encoder *encoder)
30853088
return 540000;
30863089
case XELPDP_DDI_CLOCK_SELECT_TBT_810:
30873090
return 810000;
3091+
case XELPDP_DDI_CLOCK_SELECT_TBT_312_5:
3092+
return 1000000;
3093+
case XELPDP_DDI_CLOCK_SELECT_TBT_625:
3094+
return 2000000;
30883095
default:
30893096
MISSING_CASE(clock);
30903097
return 162000;
30913098
}
30923099
}
30933100

3094-
static int intel_mtl_tbt_clock_select(int clock)
3101+
static int intel_mtl_tbt_clock_select(struct intel_display *display,
3102+
int clock)
30953103
{
30963104
switch (clock) {
30973105
case 162000:
@@ -3102,6 +3110,18 @@ static int intel_mtl_tbt_clock_select(int clock)
31023110
return XELPDP_DDI_CLOCK_SELECT_TBT_540;
31033111
case 810000:
31043112
return XELPDP_DDI_CLOCK_SELECT_TBT_810;
3113+
case 1000000:
3114+
if (DISPLAY_VER(display) < 30) {
3115+
drm_WARN_ON(display->drm, "UHBR10 not supported for the platform\n");
3116+
return XELPDP_DDI_CLOCK_SELECT_TBT_162;
3117+
}
3118+
return XELPDP_DDI_CLOCK_SELECT_TBT_312_5;
3119+
case 2000000:
3120+
if (DISPLAY_VER(display) < 30) {
3121+
drm_WARN_ON(display->drm, "UHBR20 not supported for the platform\n");
3122+
return XELPDP_DDI_CLOCK_SELECT_TBT_162;
3123+
}
3124+
return XELPDP_DDI_CLOCK_SELECT_TBT_625;
31053125
default:
31063126
MISSING_CASE(clock);
31073127
return XELPDP_DDI_CLOCK_SELECT_TBT_162;
@@ -3114,15 +3134,26 @@ static void intel_mtl_tbt_pll_enable(struct intel_encoder *encoder,
31143134
struct intel_display *display = to_intel_display(encoder);
31153135
enum phy phy = intel_encoder_to_phy(encoder);
31163136
u32 val = 0;
3137+
u32 mask;
31173138

31183139
/*
31193140
* 1. Program PORT_CLOCK_CTL REGISTER to configure
31203141
* clock muxes, gating and SSC
31213142
*/
3122-
val |= XELPDP_DDI_CLOCK_SELECT(intel_mtl_tbt_clock_select(crtc_state->port_clock));
3143+
3144+
if (DISPLAY_VER(display) >= 30) {
3145+
mask = XE3_DDI_CLOCK_SELECT_MASK;
3146+
val |= XE3_DDI_CLOCK_SELECT(intel_mtl_tbt_clock_select(display, crtc_state->port_clock));
3147+
} else {
3148+
mask = XELPDP_DDI_CLOCK_SELECT_MASK;
3149+
val |= XELPDP_DDI_CLOCK_SELECT(intel_mtl_tbt_clock_select(display, crtc_state->port_clock));
3150+
}
3151+
3152+
mask |= XELPDP_FORWARD_CLOCK_UNGATE;
31233153
val |= XELPDP_FORWARD_CLOCK_UNGATE;
3154+
31243155
intel_de_rmw(display, XELPDP_PORT_CLOCK_CTL(display, encoder->port),
3125-
XELPDP_DDI_CLOCK_SELECT_MASK | XELPDP_FORWARD_CLOCK_UNGATE, val);
3156+
mask, val);
31263157

31273158
/* 2. Read back PORT_CLOCK_CTL REGISTER */
31283159
val = intel_de_read(display, XELPDP_PORT_CLOCK_CTL(display, encoder->port));

drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,18 @@
187187
#define XELPDP_TBT_CLOCK_REQUEST REG_BIT(19)
188188
#define XELPDP_TBT_CLOCK_ACK REG_BIT(18)
189189
#define XELPDP_DDI_CLOCK_SELECT_MASK REG_GENMASK(15, 12)
190+
#define XE3_DDI_CLOCK_SELECT_MASK REG_GENMASK(16, 12)
190191
#define XELPDP_DDI_CLOCK_SELECT(val) REG_FIELD_PREP(XELPDP_DDI_CLOCK_SELECT_MASK, val)
192+
#define XE3_DDI_CLOCK_SELECT(val) REG_FIELD_PREP(XE3_DDI_CLOCK_SELECT_MASK, val)
191193
#define XELPDP_DDI_CLOCK_SELECT_NONE 0x0
192194
#define XELPDP_DDI_CLOCK_SELECT_MAXPCLK 0x8
193195
#define XELPDP_DDI_CLOCK_SELECT_DIV18CLK 0x9
194196
#define XELPDP_DDI_CLOCK_SELECT_TBT_162 0xc
195197
#define XELPDP_DDI_CLOCK_SELECT_TBT_270 0xd
196198
#define XELPDP_DDI_CLOCK_SELECT_TBT_540 0xe
197199
#define XELPDP_DDI_CLOCK_SELECT_TBT_810 0xf
200+
#define XELPDP_DDI_CLOCK_SELECT_TBT_312_5 0x18
201+
#define XELPDP_DDI_CLOCK_SELECT_TBT_625 0x19
198202
#define XELPDP_FORWARD_CLOCK_UNGATE REG_BIT(10)
199203
#define XELPDP_LANE1_PHY_CLOCK_SELECT REG_BIT(8)
200204
#define XELPDP_SSC_ENABLE_PLLA REG_BIT(1)

drivers/gpu/drm/xe/regs/xe_engine_regs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
#define RING_IMR(base) XE_REG((base) + 0xa8)
8484
#define RING_INT_STATUS_RPT_PTR(base) XE_REG((base) + 0xac)
8585

86+
#define CS_INT_VEC(base) XE_REG((base) + 0x1b8)
87+
8688
#define RING_EIR(base) XE_REG((base) + 0xb0)
8789
#define RING_EMR(base) XE_REG((base) + 0xb4)
8890
#define RING_ESR(base) XE_REG((base) + 0xb8)
@@ -138,6 +140,7 @@
138140

139141
#define RING_MODE(base) XE_REG((base) + 0x29c)
140142
#define GFX_DISABLE_LEGACY_MODE REG_BIT(3)
143+
#define GFX_MSIX_INTERRUPT_ENABLE REG_BIT(13)
141144

142145
#define RING_TIMESTAMP(base) XE_REG((base) + 0x358)
143146

drivers/gpu/drm/xe/regs/xe_lrc_layout.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#define CTX_INT_SRC_REPORT_REG (CTX_LRI_INT_REPORT_PTR + 3)
2626
#define CTX_INT_SRC_REPORT_PTR (CTX_LRI_INT_REPORT_PTR + 4)
2727

28+
#define CTX_CS_INT_VEC_REG 0x5a
29+
#define CTX_CS_INT_VEC_DATA (CTX_CS_INT_VEC_REG + 1)
30+
2831
#define INDIRECT_CTX_RING_HEAD (0x02 + 1)
2932
#define INDIRECT_CTX_RING_TAIL (0x04 + 1)
3033
#define INDIRECT_CTX_RING_START (0x06 + 1)

drivers/gpu/drm/xe/tests/xe_bo.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,6 @@ static void xe_bo_shrink_kunit(struct kunit *test)
606606
static struct kunit_case xe_bo_tests[] = {
607607
KUNIT_CASE_PARAM(xe_ccs_migrate_kunit, xe_pci_live_device_gen_param),
608608
KUNIT_CASE_PARAM(xe_bo_evict_kunit, xe_pci_live_device_gen_param),
609-
KUNIT_CASE_PARAM_ATTR(xe_bo_shrink_kunit, xe_pci_live_device_gen_param,
610-
{.speed = KUNIT_SPEED_SLOW}),
611609
{}
612610
};
613611

@@ -618,3 +616,17 @@ struct kunit_suite xe_bo_test_suite = {
618616
.init = xe_kunit_helper_xe_device_live_test_init,
619617
};
620618
EXPORT_SYMBOL_IF_KUNIT(xe_bo_test_suite);
619+
620+
static struct kunit_case xe_bo_shrink_test[] = {
621+
KUNIT_CASE_PARAM_ATTR(xe_bo_shrink_kunit, xe_pci_live_device_gen_param,
622+
{.speed = KUNIT_SPEED_SLOW}),
623+
{}
624+
};
625+
626+
VISIBLE_IF_KUNIT
627+
struct kunit_suite xe_bo_shrink_test_suite = {
628+
.name = "xe_bo_shrink",
629+
.test_cases = xe_bo_shrink_test,
630+
.init = xe_kunit_helper_xe_device_live_test_init,
631+
};
632+
EXPORT_SYMBOL_IF_KUNIT(xe_bo_shrink_test_suite);

drivers/gpu/drm/xe/tests/xe_live_test_mod.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
#include <kunit/test.h>
77

88
extern struct kunit_suite xe_bo_test_suite;
9+
extern struct kunit_suite xe_bo_shrink_test_suite;
910
extern struct kunit_suite xe_dma_buf_test_suite;
1011
extern struct kunit_suite xe_migrate_test_suite;
1112
extern struct kunit_suite xe_mocs_test_suite;
1213

1314
kunit_test_suite(xe_bo_test_suite);
15+
kunit_test_suite(xe_bo_shrink_test_suite);
1416
kunit_test_suite(xe_dma_buf_test_suite);
1517
kunit_test_suite(xe_migrate_test_suite);
1618
kunit_test_suite(xe_mocs_test_suite);

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
733733
new_mem->mem_type == XE_PL_SYSTEM) {
734734
long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,
735735
DMA_RESV_USAGE_BOOKKEEP,
736-
true,
736+
false,
737737
MAX_SCHEDULE_TIMEOUT);
738738
if (timeout < 0) {
739739
ret = timeout;
@@ -857,8 +857,16 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
857857

858858
out:
859859
if ((!ttm_bo->resource || ttm_bo->resource->mem_type == XE_PL_SYSTEM) &&
860-
ttm_bo->ttm)
860+
ttm_bo->ttm) {
861+
long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,
862+
DMA_RESV_USAGE_KERNEL,
863+
false,
864+
MAX_SCHEDULE_TIMEOUT);
865+
if (timeout < 0)
866+
ret = timeout;
867+
861868
xe_tt_unmap_sg(ttm_bo->ttm);
869+
}
862870

863871
return ret;
864872
}

drivers/gpu/drm/xe/xe_devcoredump.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ static ssize_t __xe_devcoredump_read(char *buffer, size_t count,
119119
drm_puts(&p, "\n**** GuC CT ****\n");
120120
xe_guc_ct_snapshot_print(ss->guc.ct, &p);
121121

122-
drm_puts(&p, "\n**** Contexts ****\n");
122+
/*
123+
* Don't add a new section header here because the mesa debug decoder
124+
* tool expects the context information to be in the 'GuC CT' section.
125+
*/
126+
/* drm_puts(&p, "\n**** Contexts ****\n"); */
123127
xe_guc_exec_queue_snapshot_print(ss->ge, &p);
124128

125129
drm_puts(&p, "\n**** Job ****\n");
@@ -416,6 +420,15 @@ void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
416420
char buff[ASCII85_BUFSZ], *line_buff;
417421
size_t line_pos = 0;
418422

423+
/*
424+
* Splitting blobs across multiple lines is not compatible with the mesa
425+
* debug decoder tool. Note that even dropping the explicit '\n' below
426+
* doesn't help because the GuC log is so big some underlying implementation
427+
* still splits the lines at 512K characters. So just bail completely for
428+
* the moment.
429+
*/
430+
return;
431+
419432
#define DMESG_MAX_LINE_LEN 800
420433
#define MIN_SPACE (ASCII85_BUFSZ + 2) /* 85 + "\n\0" */
421434

drivers/gpu/drm/xe/xe_device.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,9 @@ struct xe_device *xe_device_create(struct pci_dev *pdev,
325325
xe->info.revid = pdev->revision;
326326
xe->info.force_execlist = xe_modparam.force_execlist;
327327

328-
spin_lock_init(&xe->irq.lock);
328+
err = xe_irq_init(xe);
329+
if (err)
330+
goto err;
329331

330332
init_waitqueue_head(&xe->ufence_wq);
331333

drivers/gpu/drm/xe/xe_device.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ static inline bool xe_device_has_sriov(struct xe_device *xe)
157157

158158
static inline bool xe_device_has_msix(struct xe_device *xe)
159159
{
160-
/* TODO: change this when MSI-X support is fully integrated */
161-
return false;
160+
return xe->irq.msix.nvec > 0;
162161
}
163162

164163
static inline bool xe_device_has_memirq(struct xe_device *xe)

0 commit comments

Comments
 (0)