Commit 2ef8d63d authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-xe-next-2024-09-05' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next



Cross-subsystem Changes:
- Split dma fence array creation into alloc and arm (Matthew Brost)

Driver Changes:
- Move kernel_lrc to execlist backend (Ilia)
- Fix type width for pcode coommand (Karthik)
- Make xe_drm.h include unambiguous (Jani)
- Fixes and debug improvements for GSC load (Daniele)
- Track resources and VF state by PF (Michal Wajdeczko)
- Fix memory leak on error path (Nirmoy)
- Cleanup header includes (Matt Roper)
- Move pcode logic to tile scope (Matt Roper)
- Move hwmon logic to device scope (Matt Roper)
- Fix media TLB invalidation (Matthew Brost)
- Threshold config fixes for PF (Michal Wajdeczko)
- Remove extra "[drm]" from logs (Michal Wajdeczko)
- Add missing runtime ref (Rodrigo Vivi)
- Fix circular locking on runtime suspend (Rodrigo Vivi)
- Fix rpm in TTM swapout path (Thomas)

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

From: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/eirx5vdvoflbbqlrzi5cip6bpu3zjojm2pxseufu3rlq4pp6xv@eytjvhizfyu6
parents af04e65f 34bb7b81
Loading
Loading
Loading
Loading
+57 −21
Original line number Diff line number Diff line
@@ -144,37 +144,38 @@ const struct dma_fence_ops dma_fence_array_ops = {
EXPORT_SYMBOL(dma_fence_array_ops);

/**
 * dma_fence_array_create - Create a custom fence array
 * dma_fence_array_alloc - Allocate a custom fence array
 * @num_fences:		[in]	number of fences to add in the array
 *
 * Return dma fence array on success, NULL on failure
 */
struct dma_fence_array *dma_fence_array_alloc(int num_fences)
{
	struct dma_fence_array *array;

	return kzalloc(struct_size(array, callbacks, num_fences), GFP_KERNEL);
}
EXPORT_SYMBOL(dma_fence_array_alloc);

/**
 * dma_fence_array_init - Init a custom fence array
 * @array:		[in]	dma fence array to arm
 * @num_fences:		[in]	number of fences to add in the array
 * @fences:		[in]	array containing the fences
 * @context:		[in]	fence context to use
 * @seqno:		[in]	sequence number to use
 * @signal_on_any:	[in]	signal on any fence in the array
 *
 * Allocate a dma_fence_array object and initialize the base fence with
 * dma_fence_init().
 * In case of error it returns NULL.
 *
 * The caller should allocate the fences array with num_fences size
 * and fill it with the fences it wants to add to the object. Ownership of this
 * array is taken and dma_fence_put() is used on each fence on release.
 *
 * If @signal_on_any is true the fence array signals if any fence in the array
 * signals, otherwise it signals when all fences in the array signal.
 * Implementation of @dma_fence_array_create without allocation. Useful to init
 * a preallocated dma fence array in the path of reclaim or dma fence signaling.
 */
struct dma_fence_array *dma_fence_array_create(int num_fences,
					       struct dma_fence **fences,
void dma_fence_array_init(struct dma_fence_array *array,
			  int num_fences, struct dma_fence **fences,
			  u64 context, unsigned seqno,
			  bool signal_on_any)
{
	struct dma_fence_array *array;

	WARN_ON(!num_fences || !fences);

	array = kzalloc(struct_size(array, callbacks, num_fences), GFP_KERNEL);
	if (!array)
		return NULL;

	array->num_fences = num_fences;

	spin_lock_init(&array->lock);
@@ -200,6 +201,41 @@ struct dma_fence_array *dma_fence_array_create(int num_fences,
	 */
	while (num_fences--)
		WARN_ON(dma_fence_is_container(fences[num_fences]));
}
EXPORT_SYMBOL(dma_fence_array_init);

/**
 * dma_fence_array_create - Create a custom fence array
 * @num_fences:		[in]	number of fences to add in the array
 * @fences:		[in]	array containing the fences
 * @context:		[in]	fence context to use
 * @seqno:		[in]	sequence number to use
 * @signal_on_any:	[in]	signal on any fence in the array
 *
 * Allocate a dma_fence_array object and initialize the base fence with
 * dma_fence_init().
 * In case of error it returns NULL.
 *
 * The caller should allocate the fences array with num_fences size
 * and fill it with the fences it wants to add to the object. Ownership of this
 * array is taken and dma_fence_put() is used on each fence on release.
 *
 * If @signal_on_any is true the fence array signals if any fence in the array
 * signals, otherwise it signals when all fences in the array signal.
 */
struct dma_fence_array *dma_fence_array_create(int num_fences,
					       struct dma_fence **fences,
					       u64 context, unsigned seqno,
					       bool signal_on_any)
{
	struct dma_fence_array *array;

	array = dma_fence_array_alloc(num_fences);
	if (!array)
		return NULL;

	dma_fence_array_init(array, num_fences, fences,
			     context, seqno, signal_on_any);

	return array;
}
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ xe-y += xe_bb.o \
	xe_ggtt.o \
	xe_gpu_scheduler.o \
	xe_gsc.o \
	xe_gsc_debugfs.o \
	xe_gsc_proxy.o \
	xe_gsc_submit.o \
	xe_gt.o \
+4 −4
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ static inline int
snb_pcode_write_timeout(struct intel_uncore *uncore, u32 mbox, u32 val,
			int fast_timeout_us, int slow_timeout_ms)
{
	return xe_pcode_write_timeout(__compat_uncore_to_gt(uncore), mbox, val,
	return xe_pcode_write_timeout(__compat_uncore_to_tile(uncore), mbox, val,
				      slow_timeout_ms ?: 1);
}

@@ -21,13 +21,13 @@ static inline int
snb_pcode_write(struct intel_uncore *uncore, u32 mbox, u32 val)
{

	return xe_pcode_write(__compat_uncore_to_gt(uncore), mbox, val);
	return xe_pcode_write(__compat_uncore_to_tile(uncore), mbox, val);
}

static inline int
snb_pcode_read(struct intel_uncore *uncore, u32 mbox, u32 *val, u32 *val1)
{
	return xe_pcode_read(__compat_uncore_to_gt(uncore), mbox, val, val1);
	return xe_pcode_read(__compat_uncore_to_tile(uncore), mbox, val, val1);
}

static inline int
@@ -35,7 +35,7 @@ skl_pcode_request(struct intel_uncore *uncore, u32 mbox,
		  u32 request, u32 reply_mask, u32 reply,
		  int timeout_base_ms)
{
	return xe_pcode_request(__compat_uncore_to_gt(uncore), mbox, request, reply_mask, reply,
	return xe_pcode_request(__compat_uncore_to_tile(uncore), mbox, request, reply_mask, reply,
				timeout_base_ms);
}

+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,13 @@ static inline struct xe_gt *__compat_uncore_to_gt(struct intel_uncore *uncore)
	return xe_root_mmio_gt(xe);
}

static inline struct xe_tile *__compat_uncore_to_tile(struct intel_uncore *uncore)
{
	struct xe_device *xe = container_of(uncore, struct xe_device, uncore);

	return xe_device_get_root_tile(xe);
}

static inline u32 intel_uncore_read(struct intel_uncore *uncore,
				    i915_reg_t i915_reg)
{
+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
#include "intel_display_types.h"
#include "intel_fbdev_fb.h"
#include "xe_bo.h"
#include "xe_gt.h"
#include "xe_ttm_stolen_mgr.h"
#include "xe_wa.h"

Loading