Commit f8628656 authored by Daniel Vetter's avatar Daniel Vetter
Browse files

Merge tag 'drm-intel-gt-next-2023-04-06' of...

Merge tag 'drm-intel-gt-next-2023-04-06' of git://anongit.freedesktop.org/drm/drm-intel

 into drm-next

UAPI Changes:

- (Build-time only, should not have any impact)
  drm/i915/uapi: Replace fake flex-array with flexible-array member

  "Zero-length arrays as fake flexible arrays are deprecated and we are
  moving towards adopting C99 flexible-array members instead."

  This is on core kernel request moving towards GCC 13.

Driver Changes:

- Fix context runtime accounting on sysfs fdinfo for heavy workloads (Tvrtko)
- Add support for OA media units on MTL (Umesh)
- Add new workarounds for Meteorlake (Daniele, Radhakrishna, Haridhar)
- Fix sysfs to read actual frequency for MTL and Gen6 and earlier
  (Ashutosh)
- Synchronize i915/BIOS on C6 enabling on MTL (Vinay)
- Fix DMAR error noise due to GPU error capture (Andrej)
- Fix forcewake during BAR resize on discrete (Andrzej)
- Flush lmem contents after construction on discrete (Chris)
- Fix GuC loading timeout on systems where IFWI programs low boot
  frequency (John)
- Fix race condition UAF in i915_perf_add_config_ioctl (Min)

- Sanitycheck MMIO access early in driver load and during forcewake
  (Matt)
- Wakeref fixes for GuC RC error scenario and active VM tracking (Chris)
- Cancel HuC delayed load timer on reset (Daniele)
- Limit double GT reset to pre-MTL (Daniele)
- Use i915 instead of dev_priv insied the file_priv structure (Andi)
- Improve GuC load error reporting (John)
- Simplify VCS/BSD engine selection logic (Tvrtko)
- Perform uc late init after probe error injection (Andrzej)
- Fix format for perf_limit_reasons in debugfs (Vinay)
- Create per-gt debugfs files (Andi)

- Documentation and kerneldoc fixes (Nirmoy, Lee)
- Selftest improvements (Fei, Jonathan)

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZC6APj/feB+jBf2d@jlahtine-mobl.ger.corp.intel.com
parents 1138398d 4b51210f
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ static int set_proto_ctx_vm(struct drm_i915_file_private *fpriv,
			    struct i915_gem_proto_context *pc,
			    const struct drm_i915_gem_context_param *args)
{
	struct drm_i915_private *i915 = fpriv->dev_priv;
	struct drm_i915_private *i915 = fpriv->i915;
	struct i915_address_space *vm;

	if (args->size)
@@ -733,7 +733,7 @@ static int set_proto_ctx_engines(struct drm_i915_file_private *fpriv,
			         struct i915_gem_proto_context *pc,
			         const struct drm_i915_gem_context_param *args)
{
	struct drm_i915_private *i915 = fpriv->dev_priv;
	struct drm_i915_private *i915 = fpriv->i915;
	struct set_proto_ctx_engines set = { .i915 = i915 };
	struct i915_context_param_engines __user *user =
		u64_to_user_ptr(args->value);
@@ -813,7 +813,7 @@ static int set_proto_ctx_sseu(struct drm_i915_file_private *fpriv,
			      struct i915_gem_proto_context *pc,
			      struct drm_i915_gem_context_param *args)
{
	struct drm_i915_private *i915 = fpriv->dev_priv;
	struct drm_i915_private *i915 = fpriv->i915;
	struct drm_i915_gem_context_param_sseu user_sseu;
	struct intel_sseu *sseu;
	int ret;
@@ -913,7 +913,7 @@ static int set_proto_ctx_param(struct drm_i915_file_private *fpriv,
		break;

	case I915_CONTEXT_PARAM_PRIORITY:
		ret = validate_priority(fpriv->dev_priv, args);
		ret = validate_priority(fpriv->i915, args);
		if (!ret)
			pc->sched.priority = args->value;
		break;
@@ -934,12 +934,12 @@ static int set_proto_ctx_param(struct drm_i915_file_private *fpriv,
		if (args->size)
			ret = -EINVAL;
		else
			ret = proto_context_set_persistence(fpriv->dev_priv, pc,
			ret = proto_context_set_persistence(fpriv->i915, pc,
							    args->value);
		break;

	case I915_CONTEXT_PARAM_PROTECTED_CONTENT:
		ret = proto_context_set_protected(fpriv->dev_priv, pc,
		ret = proto_context_set_protected(fpriv->i915, pc,
						  args->value);
		break;

@@ -1770,7 +1770,7 @@ void i915_gem_context_close(struct drm_file *file)
	unsigned long idx;

	xa_for_each(&file_priv->proto_context_xa, idx, pc)
		proto_context_close(file_priv->dev_priv, pc);
		proto_context_close(file_priv->i915, pc);
	xa_destroy(&file_priv->proto_context_xa);
	mutex_destroy(&file_priv->proto_context_lock);

@@ -2206,7 +2206,7 @@ finalize_create_context_locked(struct drm_i915_file_private *file_priv,

	lockdep_assert_held(&file_priv->proto_context_lock);

	ctx = i915_gem_create_context(file_priv->dev_priv, pc);
	ctx = i915_gem_create_context(file_priv->i915, pc);
	if (IS_ERR(ctx))
		return ctx;

@@ -2223,7 +2223,7 @@ finalize_create_context_locked(struct drm_i915_file_private *file_priv,

	old = xa_erase(&file_priv->proto_context_xa, id);
	GEM_BUG_ON(old != pc);
	proto_context_close(file_priv->dev_priv, pc);
	proto_context_close(file_priv->i915, pc);

	return ctx;
}
@@ -2352,7 +2352,7 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
	GEM_WARN_ON(ctx && pc);

	if (pc)
		proto_context_close(file_priv->dev_priv, pc);
		proto_context_close(file_priv->i915, pc);

	if (ctx)
		context_close(ctx);
@@ -2505,7 +2505,7 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,
			 * GEM_CONTEXT_CREATE starting with graphics
			 * version 13.
			 */
			WARN_ON(GRAPHICS_VER(file_priv->dev_priv) > 12);
			WARN_ON(GRAPHICS_VER(file_priv->i915) > 12);
			ret = set_proto_ctx_param(file_priv, pc, args);
		} else {
			ret = -ENOENT;
+4 −3
Original line number Diff line number Diff line
@@ -144,7 +144,8 @@ __i915_gem_object_create_user_ext(struct drm_i915_private *i915, u64 size,
}

/**
 * Creates a new object using the same path as DRM_I915_GEM_CREATE_EXT
 * __i915_gem_object_create_user - Creates a new object using the same path as
 *                                 DRM_I915_GEM_CREATE_EXT
 * @i915: i915 private
 * @size: size of the buffer, in bytes
 * @placements: possible placement regions, in priority order
@@ -215,7 +216,7 @@ i915_gem_dumb_create(struct drm_file *file,
}

/**
 * Creates a new mm object and returns a handle to it.
 * i915_gem_create_ioctl - Creates a new mm object and returns a handle to it.
 * @dev: drm device pointer
 * @data: ioctl data blob
 * @file: drm file pointer
@@ -399,7 +400,7 @@ static const i915_user_extension_fn create_extensions[] = {
};

/**
 * Creates a new mm object and returns a handle to it.
 * i915_gem_create_ext_ioctl - Creates a new mm object and returns a handle to it.
 * @dev: drm device pointer
 * @data: ioctl data blob
 * @file: drm file pointer
+9 −5
Original line number Diff line number Diff line
@@ -116,7 +116,8 @@ void i915_gem_object_flush_if_display_locked(struct drm_i915_gem_object *obj)
}

/**
 * Moves a single object to the WC read, and possibly write domain.
 * i915_gem_object_set_to_wc_domain - Moves a single object to the WC read, and
 *                                    possibly write domain.
 * @obj: object to act on
 * @write: ask for write access or read only
 *
@@ -177,7 +178,8 @@ i915_gem_object_set_to_wc_domain(struct drm_i915_gem_object *obj, bool write)
}

/**
 * Moves a single object to the GTT read, and possibly write domain.
 * i915_gem_object_set_to_gtt_domain - Moves a single object to the GTT read,
 *                                     and possibly write domain.
 * @obj: object to act on
 * @write: ask for write access or read only
 *
@@ -246,7 +248,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
}

/**
 * Changes the cache-level of an object across all VMA.
 * i915_gem_object_set_cache_level - Changes the cache-level of an object across all VMA.
 * @obj: object to act on
 * @cache_level: new cache level to set for the object
 *
@@ -467,7 +469,8 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
}

/**
 * Moves a single object to the CPU read, and possibly write domain.
 * i915_gem_object_set_to_cpu_domain - Moves a single object to the CPU read,
 *                                     and possibly write domain.
 * @obj: object to act on
 * @write: requesting write or read-only access
 *
@@ -511,7 +514,8 @@ i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write)
}

/**
 * Called when user space prepares to use an object with the CPU, either
 * i915_gem_set_domain_ioctl - Called when user space prepares to use an
 *                             object with the CPU, either
 * through the mmap ioctl's mapping or a GTT mapping.
 * @dev: drm device
 * @data: ioctl data blob
+3 −7
Original line number Diff line number Diff line
@@ -2449,11 +2449,6 @@ static int eb_submit(struct i915_execbuffer *eb)
	return err;
}

static int num_vcs_engines(struct drm_i915_private *i915)
{
	return hweight_long(VDBOX_MASK(to_gt(i915)));
}

/*
 * Find one BSD ring to dispatch the corresponding BSD command.
 * The engine index is returned.
@@ -2467,7 +2462,7 @@ gen8_dispatch_bsd_engine(struct drm_i915_private *dev_priv,
	/* Check whether the file_priv has already selected one ring. */
	if ((int)file_priv->bsd_engine < 0)
		file_priv->bsd_engine =
			get_random_u32_below(num_vcs_engines(dev_priv));
			get_random_u32_below(dev_priv->engine_uabi_class_count[I915_ENGINE_CLASS_VIDEO]);

	return file_priv->bsd_engine;
}
@@ -2655,7 +2650,8 @@ eb_select_legacy_ring(struct i915_execbuffer *eb)
		return -1;
	}

	if (user_ring_id == I915_EXEC_BSD && num_vcs_engines(i915) > 1) {
	if (user_ring_id == I915_EXEC_BSD &&
	    i915->engine_uabi_class_count[I915_ENGINE_CLASS_VIDEO] > 1) {
		unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;

		if (bsd_idx == I915_EXEC_BSD_DEFAULT) {
+2 −1
Original line number Diff line number Diff line
@@ -127,7 +127,8 @@ i915_gem_object_create_lmem_from_data(struct drm_i915_private *i915,

	memcpy(map, data, size);

	i915_gem_object_unpin_map(obj);
	i915_gem_object_flush_map(obj);
	__i915_gem_object_release_map(obj);

	return obj;
}
Loading