Skip to content

Commit 5794d2f

Browse files
committed
Merge tag 'drm-xe-next-fixes-2024-03-04' of ssh://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes: - Fix kunit link failure with built-in xe - Fix one more 32-bit build failure with ARM compiler - Fix initialization order of topology struct - Cleanup unused fields in struct xe_vm - Fix xe_vm leak when handling page fault on a VM not in fault mode - Drop use of "grouped target" feature in Makefile since that's only available in make >= 4.3 Signed-off-by: Dave Airlie <airlied@redhat.com> From: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/kaypobelrl7u7rtnu6hg5czs3vptbhs4rp24vnwuo2ajoxysto@l5u7377hz4es
2 parents 098ca76 + e62d2e0 commit 5794d2f

File tree

7 files changed

+13
-33
lines changed

7 files changed

+13
-33
lines changed

drivers/gpu/drm/xe/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config DRM_XE
1010
select DRM_BUDDY
1111
select DRM_EXEC
1212
select DRM_KMS_HELPER
13+
select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n
1314
select DRM_PANEL
1415
select DRM_SUBALLOC_HELPER
1516
select DRM_DISPLAY_DP_HELPER

drivers/gpu/drm/xe/Kconfig.debug

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST
7676
depends on DRM_XE && KUNIT && DEBUG_FS
7777
default KUNIT_ALL_TESTS
7878
select DRM_EXPORT_FOR_TESTS if m
79-
select DRM_KUNIT_TEST_HELPERS
8079
help
8180
Choose this option to allow the driver to perform selftests under
8281
the kunit framework

drivers/gpu/drm/xe/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ generated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h
4242
quiet_cmd_wa_oob = GEN $(notdir $(generated_oob))
4343
cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob)
4444

45-
$(generated_oob) &: $(obj)/xe_gen_wa_oob $(srctree)/$(src)/xe_wa_oob.rules
45+
$(obj)/generated/%_wa_oob.c $(obj)/generated/%_wa_oob.h: $(obj)/xe_gen_wa_oob \
46+
$(srctree)/$(src)/xe_wa_oob.rules
4647
$(call cmd,wa_oob)
4748

4849
uses_generated_oob := \
@@ -158,8 +159,10 @@ xe-$(CONFIG_PCI_IOV) += \
158159
xe_lmtt_2l.o \
159160
xe_lmtt_ml.o
160161

161-
xe-$(CONFIG_DRM_XE_KUNIT_TEST) += \
162-
tests/xe_kunit_helpers.o
162+
# include helpers for tests even when XE is built-in
163+
ifdef CONFIG_DRM_XE_KUNIT_TEST
164+
xe-y += tests/xe_kunit_helpers.o
165+
endif
163166

164167
# i915 Display compat #defines and #includes
165168
subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \

drivers/gpu/drm/xe/xe_gt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,6 @@ int xe_gt_init_early(struct xe_gt *gt)
314314
if (err)
315315
return err;
316316

317-
xe_gt_topology_init(gt);
318-
319317
err = xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
320318
if (err)
321319
return err;
@@ -502,6 +500,7 @@ int xe_gt_init_hwconfig(struct xe_gt *gt)
502500
if (err)
503501
goto out;
504502

503+
xe_gt_topology_init(gt);
505504
xe_gt_mcr_init(gt);
506505
xe_pat_init(gt);
507506

drivers/gpu/drm/xe/xe_gt_pagefault.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,12 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
146146
/* ASID to VM */
147147
mutex_lock(&xe->usm.lock);
148148
vm = xa_load(&xe->usm.asid_to_vm, pf->asid);
149-
if (vm)
149+
if (vm && xe_vm_in_fault_mode(vm))
150150
xe_vm_get(vm);
151+
else
152+
vm = NULL;
151153
mutex_unlock(&xe->usm.lock);
152-
if (!vm || !xe_vm_in_fault_mode(vm))
154+
if (!vm)
153155
return -EINVAL;
154156

155157
retry_userptr:

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static u32 pte_update_size(struct xe_migrate *m,
462462
} else {
463463
/* Clip L0 to available size */
464464
u64 size = min(*L0, (u64)avail_pts * SZ_2M);
465-
u64 num_4k_pages = DIV_ROUND_UP(size, XE_PAGE_SIZE);
465+
u32 num_4k_pages = (size + XE_PAGE_SIZE - 1) >> XE_PTE_SHIFT;
466466

467467
*L0 = size;
468468
*L0_ofs = xe_migrate_vm_addr(pt_ofs, 0);

drivers/gpu/drm/xe/xe_vm_types.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -189,30 +189,6 @@ struct xe_vm {
189189
*/
190190
struct xe_range_fence_tree rftree[XE_MAX_TILES_PER_DEVICE];
191191

192-
/** @async_ops: async VM operations (bind / unbinds) */
193-
struct {
194-
/** @list: list of pending async VM ops */
195-
struct list_head pending;
196-
/** @work: worker to execute async VM ops */
197-
struct work_struct work;
198-
/** @lock: protects list of pending async VM ops and fences */
199-
spinlock_t lock;
200-
/** @fence: fence state */
201-
struct {
202-
/** @context: context of async fence */
203-
u64 context;
204-
/** @seqno: seqno of async fence */
205-
u32 seqno;
206-
} fence;
207-
/** @error: error state for async VM ops */
208-
int error;
209-
/**
210-
* @munmap_rebind_inflight: an munmap style VM bind is in the
211-
* middle of a set of ops which requires a rebind at the end.
212-
*/
213-
bool munmap_rebind_inflight;
214-
} async_ops;
215-
216192
const struct xe_pt_ops *pt_ops;
217193

218194
/** @userptr: user pointer state */

0 commit comments

Comments
 (0)