Commit 41d1d0c5 authored by Dave Airlie's avatar Dave Airlie
Browse files

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

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

 into drm-next

Driver Changes:

- Prepare for local/device memory support on DG1 by starting
  to use it for kernel internal allocations: context, ring
  and engine scratch (Matt A, CQ, Abdiel, Imre)
- Sandybridge fix to avoid hard hang on ring resume (Chris)
- Limit imported dma-buf size to int32 (Matt A)
- Double check heartbeat timeout before resetting (Chris)

- Use new tasklet API for execution list (Emil)
- Fix SPDX checkpats warnings (Chris)
- Fixes for various checkpatch warnings (Chris)
- Selftest improvements (Chris)
- Move the defer_request waiter active assertion to correct spot (Chris)
- Make local-memory probing a GT operation (Matt, Tvrtko)
- Protect against request freeing during cancellation on wedging (Chris)
- Retire unexpected starting state error dumping (Chris)
- Distinction of memory regions in debugging (Zbigniew)
- Always flush the submission queue on checking for idle (Chris)

- Consolidate 2big error check to helper (Matt)
- Decrease number of subplatform bits (Tvrtko)
- Remove unused internal request priority levels (Chris)
- Document the unused internal header bits in buddy allocator (Matt)
- Cleanup the region class/instance encoding (Matt)

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

From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/YGxksaZGXHnFxlwg@jlahtine-mobl.ger.corp.intel.com
parents 0c799717 2da21daa
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -11404,9 +11404,7 @@ int
intel_prepare_plane_fb(struct drm_plane *_plane,
		       struct drm_plane_state *_new_plane_state)
{
	struct i915_sched_attr attr = {
		.priority = I915_USER_PRIORITY(I915_PRIORITY_DISPLAY),
	};
	struct i915_sched_attr attr = { .priority = I915_PRIORITY_DISPLAY };
	struct intel_plane *plane = to_intel_plane(_plane);
	struct intel_plane_state *new_plane_state =
		to_intel_plane_state(_new_plane_state);
+3 −3
Original line number Diff line number Diff line
@@ -649,7 +649,7 @@ __create_context(struct drm_i915_private *i915)

	kref_init(&ctx->ref);
	ctx->i915 = i915;
	ctx->sched.priority = I915_USER_PRIORITY(I915_PRIORITY_NORMAL);
	ctx->sched.priority = I915_PRIORITY_NORMAL;
	mutex_init(&ctx->mutex);
	INIT_LIST_HEAD(&ctx->link);

@@ -1966,7 +1966,7 @@ static int set_priority(struct i915_gem_context *ctx,
	    !capable(CAP_SYS_NICE))
		return -EPERM;

	ctx->sched.priority = I915_USER_PRIORITY(priority);
	ctx->sched.priority = priority;
	context_apply_all(ctx, __apply_priority, ctx);

	return 0;
@@ -2470,7 +2470,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,

	case I915_CONTEXT_PARAM_PRIORITY:
		args->size = 0;
		args->value = ctx->sched.priority >> I915_USER_PRIORITY_SHIFT;
		args->value = ctx->sched.priority;
		break;

	case I915_CONTEXT_PARAM_SSEU:
+3 −0
Original line number Diff line number Diff line
@@ -250,6 +250,9 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev,
		}
	}

	if (i915_gem_object_size_2big(dma_buf->size))
		return ERR_PTR(-E2BIG);

	/* need to attach */
	attach = dma_buf_attach(dma_buf, dev->dev);
	if (IS_ERR(attach))
+26 −0
Original line number Diff line number Diff line
@@ -16,6 +16,32 @@
#include "i915_gem_gtt.h"
#include "i915_vma_types.h"

/*
 * XXX: There is a prevalence of the assumption that we fit the
 * object's page count inside a 32bit _signed_ variable. Let's document
 * this and catch if we ever need to fix it. In the meantime, if you do
 * spot such a local variable, please consider fixing!
 *
 * Aside from our own locals (for which we have no excuse!):
 * - sg_table embeds unsigned int for num_pages
 * - get_user_pages*() mixed ints with longs
 */
#define GEM_CHECK_SIZE_OVERFLOW(sz) \
	GEM_WARN_ON((sz) >> PAGE_SHIFT > INT_MAX)

static inline bool i915_gem_object_size_2big(u64 size)
{
	struct drm_i915_gem_object *obj;

	if (GEM_CHECK_SIZE_OVERFLOW(size))
		return true;

	if (overflows_type(size, obj->base.size))
		return true;

	return false;
}

void i915_gem_init__objects(struct drm_i915_private *i915);

struct drm_i915_gem_object *i915_gem_object_alloc(void);
+1 −11
Original line number Diff line number Diff line
@@ -159,17 +159,7 @@ i915_gem_object_create_region(struct intel_memory_region *mem,
	GEM_BUG_ON(!size);
	GEM_BUG_ON(!IS_ALIGNED(size, I915_GTT_MIN_ALIGNMENT));

	/*
	 * XXX: There is a prevalence of the assumption that we fit the
	 * object's page count inside a 32bit _signed_ variable. Let's document
	 * this and catch if we ever need to fix it. In the meantime, if you do
	 * spot such a local variable, please consider fixing!
	 */

	if (size >> PAGE_SHIFT > INT_MAX)
		return ERR_PTR(-E2BIG);

	if (overflows_type(size, obj->base.size))
	if (i915_gem_object_size_2big(size))
		return ERR_PTR(-E2BIG);

	obj = i915_gem_object_alloc();
Loading