Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5bcd111 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-intel-fixes-2017-07-27' of...

Merge tag 'drm-intel-fixes-2017-07-27' of git://anongit.freedesktop.org/git/drm-intel into drm-fixes

i915 fixes for -rc3

Bit more than usual since we missed -rc2. 4x cc: stable, 2 gvt
patches, but all fairly minor stuff. Last minute rebase was to add a
few missing cc: stable, I did prep the pull this morning already and
made sure CI approves.

* tag 'drm-intel-fixes-2017-07-27' of git://anongit.freedesktop.org/git/drm-intel:
  drm/i915: Fix bad comparison in skl_compute_plane_wm.
  drm/i915: Force CPU synchronisation even if userspace requests ASYNC
  drm/i915: Only skip updating execobject.offset after error
  drm/i915: Only mark the execobject as pinned on success
  drm/i915: Remove assertion from raw __i915_vma_unpin()
  drm/i915/cnl: Fix loadgen select programming on ddi vswing sequence
  drm/i915: Fix scaler init during CRTC HW state readout
  drm/i915/selftests: Fix an error handling path in 'mock_gem_device()'
  drm/i915: Unbreak gpu reset vs. modeset locking
  drm/i915: Fix cursor updates on some platforms
  drm/i915: Fix user ptr check size in eb_relocate_vma()
  drm/i915/gvt: Extend KBL platform support in GVT-g
  drm/i915/gvt: Fix the vblank timer close issue after shutdown VMs in reverse
parents 2213b666 5fe220a1
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -323,27 +323,27 @@ void intel_gvt_check_vblank_emulation(struct intel_gvt *gvt)
{
	struct intel_gvt_irq *irq = &gvt->irq;
	struct intel_vgpu *vgpu;
	bool have_enabled_pipe = false;
	int pipe, id;

	if (WARN_ON(!mutex_is_locked(&gvt->lock)))
		return;

	hrtimer_cancel(&irq->vblank_timer.timer);

	for_each_active_vgpu(gvt, vgpu, id) {
		for (pipe = 0; pipe < I915_MAX_PIPES; pipe++) {
			have_enabled_pipe =
				pipe_is_enabled(vgpu, pipe);
			if (have_enabled_pipe)
				break;
			if (pipe_is_enabled(vgpu, pipe))
				goto out;
		}
	}

	if (have_enabled_pipe)
	/* all the pipes are disabled */
	hrtimer_cancel(&irq->vblank_timer.timer);
	return;

out:
	hrtimer_start(&irq->vblank_timer.timer,
		ktime_add_ns(ktime_get(), irq->vblank_timer.period),
		HRTIMER_MODE_ABS);

}

static void emulate_vblank_on_pipe(struct intel_vgpu *vgpu, int pipe)
+4 −3
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ i915_clflush_notify(struct i915_sw_fence *fence,
	return NOTIFY_DONE;
}

void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
bool i915_gem_clflush_object(struct drm_i915_gem_object *obj,
			     unsigned int flags)
{
	struct clflush *clflush;
@@ -128,7 +128,7 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
	 */
	if (!i915_gem_object_has_struct_page(obj)) {
		obj->cache_dirty = false;
		return;
		return false;
	}

	/* If the GPU is snooping the contents of the CPU cache,
@@ -140,7 +140,7 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
	 * tracking.
	 */
	if (!(flags & I915_CLFLUSH_FORCE) && obj->cache_coherent)
		return;
		return false;

	trace_i915_gem_object_clflush(obj);

@@ -179,4 +179,5 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
	}

	obj->cache_dirty = false;
	return true;
}
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
struct drm_i915_private;
struct drm_i915_gem_object;

void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
bool i915_gem_clflush_object(struct drm_i915_gem_object *obj,
			     unsigned int flags);
#define I915_CLFLUSH_FORCE BIT(0)
#define I915_CLFLUSH_SYNC BIT(1)
+13 −11
Original line number Diff line number Diff line
@@ -560,9 +560,6 @@ static int eb_reserve_vma(const struct i915_execbuffer *eb,
		eb->args->flags |= __EXEC_HAS_RELOC;
	}

	entry->flags |= __EXEC_OBJECT_HAS_PIN;
	GEM_BUG_ON(eb_vma_misplaced(entry, vma));

	if (unlikely(entry->flags & EXEC_OBJECT_NEEDS_FENCE)) {
		err = i915_vma_get_fence(vma);
		if (unlikely(err)) {
@@ -574,6 +571,9 @@ static int eb_reserve_vma(const struct i915_execbuffer *eb,
			entry->flags |= __EXEC_OBJECT_HAS_FENCE;
	}

	entry->flags |= __EXEC_OBJECT_HAS_PIN;
	GEM_BUG_ON(eb_vma_misplaced(entry, vma));

	return 0;
}

@@ -1458,7 +1458,7 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct i915_vma *vma)
	 * to read. However, if the array is not writable the user loses
	 * the updated relocation values.
	 */
	if (unlikely(!access_ok(VERIFY_READ, urelocs, remain*sizeof(urelocs))))
	if (unlikely(!access_ok(VERIFY_READ, urelocs, remain*sizeof(*urelocs))))
		return -EFAULT;

	do {
@@ -1775,7 +1775,7 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)
		}
	}

	return err ?: have_copy;
	return err;
}

static int eb_relocate(struct i915_execbuffer *eb)
@@ -1825,7 +1825,7 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)
	int err;

	for (i = 0; i < count; i++) {
		const struct drm_i915_gem_exec_object2 *entry = &eb->exec[i];
		struct drm_i915_gem_exec_object2 *entry = &eb->exec[i];
		struct i915_vma *vma = exec_to_vma(entry);
		struct drm_i915_gem_object *obj = vma->obj;

@@ -1841,12 +1841,14 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)
			eb->request->capture_list = capture;
		}

		if (unlikely(obj->cache_dirty && !obj->cache_coherent)) {
			if (i915_gem_clflush_object(obj, 0))
				entry->flags &= ~EXEC_OBJECT_ASYNC;
		}

		if (entry->flags & EXEC_OBJECT_ASYNC)
			goto skip_flushes;

		if (unlikely(obj->cache_dirty && !obj->cache_coherent))
			i915_gem_clflush_object(obj, 0);

		err = i915_gem_request_await_object
			(eb->request, obj, entry->flags & EXEC_OBJECT_WRITE);
		if (err)
@@ -2209,7 +2211,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
		goto err_unlock;

	err = eb_relocate(&eb);
	if (err)
	if (err) {
		/*
		 * If the user expects the execobject.offset and
		 * reloc.presumed_offset to be an exact match,
@@ -2218,8 +2220,8 @@ i915_gem_do_execbuffer(struct drm_device *dev,
		 * relocation.
		 */
		args->flags &= ~__EXEC_HAS_RELOC;
	if (err < 0)
		goto err_vma;
	}

	if (unlikely(eb.batch->exec_entry->flags & EXEC_OBJECT_WRITE)) {
		DRM_DEBUG("Attempting to use self-modifying batch buffer\n");
+1 −1
Original line number Diff line number Diff line
@@ -284,12 +284,12 @@ static inline void __i915_vma_pin(struct i915_vma *vma)

static inline void __i915_vma_unpin(struct i915_vma *vma)
{
	GEM_BUG_ON(!i915_vma_is_pinned(vma));
	vma->flags--;
}

static inline void i915_vma_unpin(struct i915_vma *vma)
{
	GEM_BUG_ON(!i915_vma_is_pinned(vma));
	GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
	__i915_vma_unpin(vma);
}
Loading