Commit 4f577bed authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-xe-next-fixes-2025-06-05' of...

Merge tag 'drm-xe-next-fixes-2025-06-05' of https://gitlab.freedesktop.org/drm/xe/kernel

 into drm-next

Driver Changes:
- A couple of vm init fixes (Matt Auld)
- Hwmon fixes (Karthik)
- Drop reduntant conversion to bool (Raag)
- Fix CONFIG_INTEL_VSEC dependency (Arnd)
- Rework eviction rejection of bound external bos (Thomas)
- Stop re-submitting signalled jobs (Matt Auld)
- A couple of pxp fixes (Daniele)
- Add back a fix that got lost in a merge (Matt Auld)
- Create LRC bo without VM (Niranjana)
- Fix for the above fix (Maciej)

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://lore.kernel.org/r/aEHq44uIAZwfK-mG@fedora
parents 27bba886 7c7c5cb5
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -60,26 +60,26 @@ Description: RO. Package default power limit (default TDP setting).

		Only supported for particular Intel Xe graphics platforms.

What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power2_crit
Date:		February 2024
KernelVersion:	6.8
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power1_crit
Date:		May 2025
KernelVersion:	6.15
Contact:	intel-xe@lists.freedesktop.org
Description:	RW. Package reactive critical (I1) power limit in microwatts.
Description:	RW. Card reactive critical (I1) power limit in microwatts.

		Package reactive critical (I1) power limit in microwatts is exposed
		Card reactive critical (I1) power limit in microwatts is exposed
		for client products. The power controller will throttle the
		operating frequency if the power averaged over a window exceeds
		this limit.

		Only supported for particular Intel Xe graphics platforms.

What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/curr2_crit
Date:		February 2024
KernelVersion:	6.8
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/curr1_crit
Date:		May 2025
KernelVersion:	6.15
Contact:	intel-xe@lists.freedesktop.org
Description:	RW. Package reactive critical (I1) power limit in milliamperes.
Description:	RW. Card reactive critical (I1) power limit in milliamperes.

		Package reactive critical (I1) power limit in milliamperes is
		Card reactive critical (I1) power limit in milliamperes is
		exposed for server products. The power controller will throttle
		the operating frequency if the power averaged over a window
		exceeds this limit.
+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
config DRM_XE
	tristate "Intel Xe Graphics"
	depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
	depends on INTEL_VSEC || !INTEL_VSEC
	depends on X86_PLATFORM_DEVICES || !(X86 && ACPI)
	select INTERVAL_TREE
	# we need shmfs for the swappable backing store, and in particular
	# the shmem_readpage() which depends upon tmpfs
@@ -27,7 +29,6 @@ config DRM_XE
	select BACKLIGHT_CLASS_DEVICE if ACPI
	select INPUT if ACPI
	select ACPI_VIDEO if X86 && ACPI
	select X86_PLATFORM_DEVICES if X86 && ACPI
	select ACPI_WMI if X86 && ACPI
	select SYNC_FILE
	select IOSF_MBI
+5 −5
Original line number Diff line number Diff line
@@ -38,10 +38,10 @@
#define   TEMP_MASK				REG_GENMASK(7, 0)

#define PCU_CR_PACKAGE_RAPL_LIMIT		XE_REG(MCHBAR_MIRROR_BASE_SNB + 0x59a0)
#define   PKG_PWR_LIM_1				REG_GENMASK(14, 0)
#define   PKG_PWR_LIM_1_EN			REG_BIT(15)
#define   PKG_PWR_LIM_1_TIME			REG_GENMASK(23, 17)
#define   PKG_PWR_LIM_1_TIME_X			REG_GENMASK(23, 22)
#define   PKG_PWR_LIM_1_TIME_Y			REG_GENMASK(21, 17)
#define   PWR_LIM_VAL				REG_GENMASK(14, 0)
#define   PWR_LIM_EN				REG_BIT(15)
#define   PWR_LIM_TIME				REG_GENMASK(23, 17)
#define   PWR_LIM_TIME_X			REG_GENMASK(23, 22)
#define   PWR_LIM_TIME_Y			REG_GENMASK(21, 17)

#endif /* _XE_MCHBAR_REGS_H_ */
+0 −4
Original line number Diff line number Diff line
@@ -18,16 +18,12 @@
#define PVC_GT0_PLATFORM_ENERGY_STATUS          XE_REG(0x28106c)
#define PVC_GT0_PACKAGE_POWER_SKU               XE_REG(0x281080)

#define BMG_PACKAGE_POWER_SKU			XE_REG(0x138098)
#define BMG_PACKAGE_POWER_SKU_UNIT		XE_REG(0x1380dc)
#define BMG_PACKAGE_ENERGY_STATUS		XE_REG(0x138120)
#define BMG_FAN_1_SPEED				XE_REG(0x138140)
#define BMG_FAN_2_SPEED				XE_REG(0x138170)
#define BMG_FAN_3_SPEED				XE_REG(0x1381a0)
#define BMG_VRAM_TEMPERATURE			XE_REG(0x1382c0)
#define BMG_PACKAGE_TEMPERATURE			XE_REG(0x138434)
#define BMG_PACKAGE_RAPL_LIMIT			XE_REG(0x138440)
#define BMG_PLATFORM_ENERGY_STATUS		XE_REG(0x138458)
#define BMG_PLATFORM_POWER_LIMIT		XE_REG(0x138460)

#endif /* _XE_PCODE_REGS_H_ */
+29 −19
Original line number Diff line number Diff line
@@ -841,21 +841,6 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
		goto out;
	}

	/* Reject BO eviction if BO is bound to current VM. */
	if (evict && ctx->resv) {
		struct drm_gpuvm_bo *vm_bo;

		drm_gem_for_each_gpuvm_bo(vm_bo, &bo->ttm.base) {
			struct xe_vm *vm = gpuvm_to_vm(vm_bo->vm);

			if (xe_vm_resv(vm) == ctx->resv &&
			    xe_vm_in_preempt_fence_mode(vm)) {
				ret = -EBUSY;
				goto out;
			}
		}
	}

	/*
	 * Failed multi-hop where the old_mem is still marked as
	 * TTM_PL_FLAG_TEMPORARY, should just be a dummy move.
@@ -1013,6 +998,25 @@ static long xe_bo_shrink_purge(struct ttm_operation_ctx *ctx,
	return lret;
}

static bool
xe_bo_eviction_valuable(struct ttm_buffer_object *bo, const struct ttm_place *place)
{
	struct drm_gpuvm_bo *vm_bo;

	if (!ttm_bo_eviction_valuable(bo, place))
		return false;

	if (!xe_bo_is_xe_bo(bo))
		return true;

	drm_gem_for_each_gpuvm_bo(vm_bo, &bo->base) {
		if (xe_vm_is_validating(gpuvm_to_vm(vm_bo->vm)))
			return false;
	}

	return true;
}

/**
 * xe_bo_shrink() - Try to shrink an xe bo.
 * @ctx: The struct ttm_operation_ctx used for shrinking.
@@ -1047,7 +1051,7 @@ long xe_bo_shrink(struct ttm_operation_ctx *ctx, struct ttm_buffer_object *bo,
	    (flags.purge && !xe_tt->purgeable))
		return -EBUSY;

	if (!ttm_bo_eviction_valuable(bo, &place))
	if (!xe_bo_eviction_valuable(bo, &place))
		return -EBUSY;

	if (!xe_bo_is_xe_bo(bo) || !xe_bo_get_unless_zero(xe_bo))
@@ -1588,7 +1592,7 @@ const struct ttm_device_funcs xe_ttm_funcs = {
	.io_mem_pfn = xe_ttm_io_mem_pfn,
	.access_memory = xe_ttm_access_memory,
	.release_notify = xe_ttm_bo_release_notify,
	.eviction_valuable = ttm_bo_eviction_valuable,
	.eviction_valuable = xe_bo_eviction_valuable,
	.delete_mem_notify = xe_ttm_bo_delete_mem_notify,
	.swap_notify = xe_ttm_bo_swap_notify,
};
@@ -2431,6 +2435,8 @@ int xe_bo_validate(struct xe_bo *bo, struct xe_vm *vm, bool allow_res_evict)
		.no_wait_gpu = false,
		.gfp_retry_mayfail = true,
	};
	struct pin_cookie cookie;
	int ret;

	if (vm) {
		lockdep_assert_held(&vm->lock);
@@ -2440,8 +2446,12 @@ int xe_bo_validate(struct xe_bo *bo, struct xe_vm *vm, bool allow_res_evict)
		ctx.resv = xe_vm_resv(vm);
	}

	cookie = xe_vm_set_validating(vm, allow_res_evict);
	trace_xe_bo_validate(bo);
	return ttm_bo_validate(&bo->ttm, &bo->placement, &ctx);
	ret = ttm_bo_validate(&bo->ttm, &bo->placement, &ctx);
	xe_vm_clear_validating(vm, allow_res_evict, cookie);

	return ret;
}

bool xe_bo_is_xe_bo(struct ttm_buffer_object *bo)
@@ -2557,7 +2567,7 @@ typedef int (*xe_gem_create_set_property_fn)(struct xe_device *xe,
					     u64 value);

static const xe_gem_create_set_property_fn gem_create_set_property_funcs[] = {
	[DRM_XE_GEM_CREATE_EXTENSION_SET_PROPERTY] = gem_create_set_pxp_type,
	[DRM_XE_GEM_CREATE_SET_PROPERTY_PXP_TYPE] = gem_create_set_pxp_type,
};

static int gem_create_user_ext_set_property(struct xe_device *xe,
Loading