Commit 74d6c8ea authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-intel-fixes-2023-02-02' of...

Merge tag 'drm-intel-fixes-2023-02-02' of git://anongit.freedesktop.org/drm/drm-intel

 into drm-fixes

- Fixes for potential use-after-free and double-free (Rob)
- GuC locking and refcount fixes (John)
- Display's reference clock value fix (Chaitanya)

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

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Y9u5pHjOYcxzS5Z7@intel.com
parents abf301e1 47a2bd9d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1319,7 +1319,7 @@ static const struct intel_cdclk_vals adlp_cdclk_table[] = {
	{ .refclk = 24000, .cdclk = 192000, .divider = 2, .ratio = 16 },
	{ .refclk = 24000, .cdclk = 312000, .divider = 2, .ratio = 26 },
	{ .refclk = 24000, .cdclk = 552000, .divider = 2, .ratio = 46 },
	{ .refclk = 24400, .cdclk = 648000, .divider = 2, .ratio = 54 },
	{ .refclk = 24000, .cdclk = 648000, .divider = 2, .ratio = 54 },

	{ .refclk = 38400, .cdclk = 179200, .divider = 3, .ratio = 14 },
	{ .refclk = 38400, .cdclk = 192000, .divider = 2, .ratio = 10 },
+11 −3
Original line number Diff line number Diff line
@@ -1861,11 +1861,19 @@ static int get_ppgtt(struct drm_i915_file_private *file_priv,
	vm = ctx->vm;
	GEM_BUG_ON(!vm);

	/*
	 * Get a reference for the allocated handle.  Once the handle is
	 * visible in the vm_xa table, userspace could try to close it
	 * from under our feet, so we need to hold the extra reference
	 * first.
	 */
	i915_vm_get(vm);

	err = xa_alloc(&file_priv->vm_xa, &id, vm, xa_limit_32b, GFP_KERNEL);
	if (err)
	if (err) {
		i915_vm_put(vm);
		return err;

	i915_vm_get(vm);
	}

	GEM_BUG_ON(id == 0); /* reserved for invalid/unassigned ppgtt */
	args->value = id;
+5 −4
Original line number Diff line number Diff line
@@ -305,10 +305,6 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,
	spin_unlock(&obj->vma.lock);

	obj->tiling_and_stride = tiling | stride;
	i915_gem_object_unlock(obj);

	/* Force the fence to be reacquired for GTT access */
	i915_gem_object_release_mmap_gtt(obj);

	/* Try to preallocate memory required to save swizzling on put-pages */
	if (i915_gem_object_needs_bit17_swizzle(obj)) {
@@ -321,6 +317,11 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,
		obj->bit_17 = NULL;
	}

	i915_gem_object_unlock(obj);

	/* Force the fence to be reacquired for GTT access */
	i915_gem_object_release_mmap_gtt(obj);

	return 0;
}

+3 −1
Original line number Diff line number Diff line
@@ -528,7 +528,7 @@ struct i915_request *intel_context_create_request(struct intel_context *ce)
	return rq;
}

struct i915_request *intel_context_find_active_request(struct intel_context *ce)
struct i915_request *intel_context_get_active_request(struct intel_context *ce)
{
	struct intel_context *parent = intel_context_to_parent(ce);
	struct i915_request *rq, *active = NULL;
@@ -552,6 +552,8 @@ struct i915_request *intel_context_find_active_request(struct intel_context *ce)

		active = rq;
	}
	if (active)
		active = i915_request_get_rcu(active);
	spin_unlock_irqrestore(&parent->guc_state.lock, flags);

	return active;
+1 −2
Original line number Diff line number Diff line
@@ -268,8 +268,7 @@ int intel_context_prepare_remote_request(struct intel_context *ce,

struct i915_request *intel_context_create_request(struct intel_context *ce);

struct i915_request *
intel_context_find_active_request(struct intel_context *ce);
struct i915_request *intel_context_get_active_request(struct intel_context *ce);

static inline bool intel_context_is_barrier(const struct intel_context *ce)
{
Loading