Commit 3bce3cc6 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-xe-fixes-2024-12-23' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes



UAPI Changes:
- Revert some devcoredump file format changes
  breaking a mesa debug tool (John)

Driver Changes:
- Fixes around waits when moving to system (Nirmoy)
- Fix a typo when checking for LMEM provisioning (Michal)
- Fix a fault on fd close after unbind (Lucas)

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

From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Z2mjt7OTfH76cgua@fedora
parents fc033cf2 fe39b222
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -724,7 +724,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
	    new_mem->mem_type == XE_PL_SYSTEM) {
		long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,
						     DMA_RESV_USAGE_BOOKKEEP,
						     true,
						     false,
						     MAX_SCHEDULE_TIMEOUT);
		if (timeout < 0) {
			ret = timeout;
@@ -848,8 +848,16 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,

out:
	if ((!ttm_bo->resource || ttm_bo->resource->mem_type == XE_PL_SYSTEM) &&
	    ttm_bo->ttm)
	    ttm_bo->ttm) {
		long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,
						     DMA_RESV_USAGE_KERNEL,
						     false,
						     MAX_SCHEDULE_TIMEOUT);
		if (timeout < 0)
			ret = timeout;

		xe_tt_unmap_sg(ttm_bo->ttm);
	}

	return ret;
}
+14 −1
Original line number Diff line number Diff line
@@ -109,7 +109,11 @@ static ssize_t __xe_devcoredump_read(char *buffer, size_t count,
	drm_puts(&p, "\n**** GuC CT ****\n");
	xe_guc_ct_snapshot_print(ss->guc.ct, &p);

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

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

	/*
	 * Splitting blobs across multiple lines is not compatible with the mesa
	 * debug decoder tool. Note that even dropping the explicit '\n' below
	 * doesn't help because the GuC log is so big some underlying implementation
	 * still splits the lines at 512K characters. So just bail completely for
	 * the moment.
	 */
	return;

#define DMESG_MAX_LINE_LEN	800
#define MIN_SPACE		(ASCII85_BUFSZ + 2)		/* 85 + "\n\0" */

+9 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include <linux/nospec.h>

#include <drm/drm_device.h>
#include <drm/drm_drv.h>
#include <drm/drm_file.h>
#include <uapi/drm/xe_drm.h>

@@ -762,9 +763,11 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
 */
void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
{
	struct xe_device *xe = gt_to_xe(q->gt);
	struct xe_file *xef;
	struct xe_lrc *lrc;
	u32 old_ts, new_ts;
	int idx;

	/*
	 * Jobs that are run during driver load may use an exec_queue, but are
@@ -774,6 +777,10 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
	if (!q->vm || !q->vm->xef)
		return;

	/* Synchronize with unbind while holding the xe file open */
	if (!drm_dev_enter(&xe->drm, &idx))
		return;

	xef = q->vm->xef;

	/*
@@ -787,6 +794,8 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
	lrc = q->lrc[0];
	new_ts = xe_lrc_update_timestamp(lrc, &old_ts);
	xef->run_ticks[q->class] += (new_ts - old_ts) * q->width;

	drm_dev_exit(idx);
}

/**
+1 −1
Original line number Diff line number Diff line
@@ -2046,7 +2046,7 @@ static int pf_validate_vf_config(struct xe_gt *gt, unsigned int vfid)
	valid_any = valid_any || (valid_ggtt && is_primary);

	if (IS_DGFX(xe)) {
		bool valid_lmem = pf_get_vf_config_ggtt(primary_gt, vfid);
		bool valid_lmem = pf_get_vf_config_lmem(primary_gt, vfid);

		valid_any = valid_any || (valid_lmem && is_primary);
		valid_all = valid_all && valid_lmem;