All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 05/17] drm/i915: Pin the pages whilst operating on them
Date: Mon, 22 Aug 2016 09:03:38 +0100	[thread overview]
Message-ID: <20160822080350.4964-6-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20160822080350.4964-1-chris@chris-wilson.co.uk>

As a safety precaution, whilst we operate on the object's pages
(clflushing them, updating the LRU) make sure we hold a pin on those
pages to prevent them disappearing underneath us.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index de895c7ef9e6..e601b74c19f9 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3251,6 +3251,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
 	if (ret)
 		return ret;
 
+	i915_gem_object_pin_pages(obj);
 	i915_gem_object_flush_cpu_write_domain(obj);
 
 	/* Serialise direct access to this object with the barriers for
@@ -3280,6 +3281,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
 
 	/* And bump the LRU for this access */
 	i915_gem_object_bump_inactive_ggtt(obj);
+	i915_gem_object_unpin_pages(obj);
 
 	return 0;
 }
-- 
2.9.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-08-22  8:04 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-22  8:03 Execbuf fixes and major tuning Chris Wilson
2016-08-22  8:03 ` [PATCH 01/17] drm/i915: Skip holding an object reference for execbuf preparation Chris Wilson
2016-08-22 11:21   ` Joonas Lahtinen
2016-08-22 11:56     ` Chris Wilson
2016-08-22  8:03 ` [PATCH 02/17] drm/i915: Defer active reference until required Chris Wilson
2016-08-22  8:03 ` [PATCH 03/17] drm/i915: Allow the user to pass a context to any ring Chris Wilson
2016-08-22 11:23   ` Joonas Lahtinen
2016-08-22 12:23     ` Chris Wilson
2016-08-23 13:28       ` John Harrison
2016-08-23 13:33         ` John Harrison
2016-08-25 15:28           ` John Harrison
2016-08-29 12:21             ` Joonas Lahtinen
2016-08-22  8:03 ` [PATCH 04/17] drm/i915: Fix i915_gem_evict_for_vma (soft-pinning) Chris Wilson
2016-08-22  8:03 ` Chris Wilson [this message]
2016-08-23 11:54   ` [PATCH 05/17] drm/i915: Pin the pages whilst operating on them Joonas Lahtinen
2016-08-22  8:03 ` [PATCH 06/17] drm/i915: Move obj->dirty:1 to obj->flags Chris Wilson
2016-08-23 12:01   ` Joonas Lahtinen
2016-09-06 11:37   ` Dave Gordon
2016-09-06 13:16     ` Chris Wilson
2016-08-22  8:03 ` [PATCH 07/17] drm/i915: Use the precomputed value for whether to enable command parsing Chris Wilson
2016-08-24 14:33   ` John Harrison
2016-08-27  9:12     ` Chris Wilson
2016-08-22  8:03 ` [PATCH 08/17] drm/i915: Drop spinlocks around adding to the client request list Chris Wilson
2016-08-24 13:16   ` Mika Kuoppala
2016-08-24 13:25     ` Chris Wilson
2016-08-26  9:13   ` Mika Kuoppala
2016-09-02 10:30   ` John Harrison
2016-09-02 10:59     ` Chris Wilson
2016-09-02 11:02       ` Chris Wilson
2016-09-02 13:20         ` John Harrison
2016-09-02 13:38           ` Chris Wilson
2016-08-22  8:03 ` [PATCH 09/17] drm/i915: Amalgamate execbuffer parameter structures Chris Wilson
2016-08-24 13:20   ` John Harrison
2016-08-22  8:03 ` [PATCH 10/17] drm/i915: Use vma->exec_entry as our double-entry placeholder Chris Wilson
2016-08-22  8:03 ` [PATCH 11/17] drm/i915: Store a direct lookup from object handle to vma Chris Wilson
2016-08-22  8:03 ` [PATCH 12/17] drm/i915: Pass vma to relocate entry Chris Wilson
2016-08-22  8:03 ` [PATCH 13/17] drm/i915: Eliminate lots of iterations over the execobjects array Chris Wilson
2016-08-25  6:03   ` [PATCH v2] " Chris Wilson
2016-08-22  8:03 ` [PATCH 14/17] drm/i915: First try the previous execbuffer location Chris Wilson
2016-08-22  8:03 ` [PATCH 15/17] drm/i915: Wait upon userptr get-user-pages within execbuffer Chris Wilson
2016-08-23 10:53   ` Joonas Lahtinen
2016-08-23 11:14     ` Chris Wilson
2016-08-22  8:03 ` [PATCH 16/17] drm/i915: Remove superfluous i915_add_request_no_flush() helper Chris Wilson
2016-08-23 10:21   ` Joonas Lahtinen
2016-08-22  8:03 ` [PATCH 17/17] drm/i915: Use the MRU stack search after evicting Chris Wilson
2016-08-23 13:52 ` ✗ Fi.CI.BAT: failure for series starting with [01/17] drm/i915: Skip holding an object reference for execbuf preparation Patchwork
2016-08-25  6:51 ` ✗ Fi.CI.BAT: warning for series starting with [01/17] drm/i915: Skip holding an object reference for execbuf preparation (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160822080350.4964-6-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.