public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 0/8] [RESEND] VMA patches
@ 2013-08-30 23:43 Ben Widawsky
  2013-08-30 23:43 ` [PATCH 1/8] drm/i915: Synchronize pread/pwrite with wait_rendering Ben Widawsky
                   ` (7 more replies)
  0 siblings, 8 replies; 31+ messages in thread
From: Ben Widawsky @ 2013-08-30 23:43 UTC (permalink / raw)
  To: Intel GFX; +Cc: Ben Widawsky

Now that [hopefully all] of the fallout from the last round of VMA merging has
been taken care of - Resending the remaining VMA patches which are required for
the full PPGTT support.

Some of these patches are new as a result of the last round of review. For the
ones which are just a RESEND, I've only rebased and un on an IVB.

Ben Widawsky (8):
  drm/i915: Synchronize pread/pwrite with wait_rendering
  drm/i915: Extract vm specific part of eviction
  drm/i915: evict VM instead of everything
  drm/1915: trace vm eviction instead of everything
  drm/i915: Convert active API to VMA
  drm/i915: Add bind/unbind object functions to VM
  drm/i915: Use the new vm [un]bind functions
  drm/i915: eliminate vm->insert_entries()

 drivers/gpu/drm/i915/i915_drv.h            |  84 ++++++++++-----------
 drivers/gpu/drm/i915/i915_gem.c            |  61 +++++++--------
 drivers/gpu/drm/i915/i915_gem_context.c    |  16 ++--
 drivers/gpu/drm/i915/i915_gem_evict.c      |  47 ++++++++++--
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  40 +++++-----
 drivers/gpu/drm/i915/i915_gem_gtt.c        | 116 ++++++++++++++++++++---------
 drivers/gpu/drm/i915/i915_trace.h          |  12 +--
 7 files changed, 228 insertions(+), 148 deletions(-)

-- 
1.8.4

^ permalink raw reply	[flat|nested] 31+ messages in thread
* [PATCH 1/8] drm/i915: Synchronize pread/pwrite with wait_rendering
@ 2013-09-11 21:57 Ben Widawsky
  2013-09-11 21:57 ` [PATCH 6/8] drm/i915: Add bind/unbind object functions to VM Ben Widawsky
  0 siblings, 1 reply; 31+ messages in thread
From: Ben Widawsky @ 2013-09-11 21:57 UTC (permalink / raw)
  To: Intel GFX; +Cc: Ben Widawsky, Ben Widawsky

lifted from Daniel:
pread/pwrite isn't about the object's domain at all, but purely about
synchronizing for outstanding rendering. Replacing the call to
set_to_gtt_domain with a wait_rendering would imo improve code
readability. Furthermore we could pimp pread to only block for
outstanding writes and not for reads.

Since you're not the first one to trip over this: Can I volunteer you
for a follow-up patch to fix this?

Recommended-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---

Notes:
    v2: Switch the pwrite patch to use \!read_only. This was a typo in the original code. (Chris, Daniel)

 drivers/gpu/drm/i915/i915_gem.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5b510a3..0a99979 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -41,6 +41,9 @@ static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *o
 static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj,
 						   bool force);
 static __must_check int
+i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj,
+			       bool readonly);
+static __must_check int
 i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
 			   struct i915_address_space *vm,
 			   unsigned alignment,
@@ -430,11 +433,9 @@ i915_gem_shmem_pread(struct drm_device *dev,
 		 * optimizes for the case when the gpu will dirty the data
 		 * anyway again before the next pread happens. */
 		needs_clflush = !cpu_cache_is_coherent(dev, obj->cache_level);
-		if (i915_gem_obj_bound_any(obj)) {
-			ret = i915_gem_object_set_to_gtt_domain(obj, false);
-			if (ret)
-				return ret;
-		}
+		ret = i915_gem_object_wait_rendering(obj, false);
+		if (ret)
+			return ret;
 	}
 
 	ret = i915_gem_object_get_pages(obj);
@@ -746,11 +747,9 @@ i915_gem_shmem_pwrite(struct drm_device *dev,
 		 * optimizes for the case when the gpu will use the data
 		 * right away and we therefore have to clflush anyway. */
 		needs_clflush_after = cpu_write_needs_clflush(obj);
-		if (i915_gem_obj_bound_any(obj)) {
-			ret = i915_gem_object_set_to_gtt_domain(obj, true);
-			if (ret)
-				return ret;
-		}
+		ret = i915_gem_object_wait_rendering(obj, true);
+		if (ret)
+			return ret;
 	}
 	/* Same trick applies to invalidate partially written cachelines read
 	 * before writing. */
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2013-09-11 22:49 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30 23:43 [PATCH 0/8] [RESEND] VMA patches Ben Widawsky
2013-08-30 23:43 ` [PATCH 1/8] drm/i915: Synchronize pread/pwrite with wait_rendering Ben Widawsky
2013-08-30 23:50   ` Chris Wilson
2013-08-31  3:39     ` Ben Widawsky
2013-09-02  6:32       ` Daniel Vetter
2013-09-02 13:14         ` Chris Wilson
2013-09-02 14:12           ` Daniel Vetter
2013-09-03 16:08             ` Daniel Vetter
2013-09-03 23:53               ` Ben Widawsky
2013-08-30 23:43 ` [PATCH 2/8] drm/i915: Extract vm specific part of eviction Ben Widawsky
2013-08-30 23:52   ` Chris Wilson
2013-08-31  3:39     ` Ben Widawsky
2013-08-30 23:43 ` [PATCH 3/8] drm/i915: evict VM instead of everything Ben Widawsky
2013-08-31  0:04   ` Chris Wilson
2013-08-30 23:43 ` [PATCH 4/8] drm/i915: trace vm eviction " Ben Widawsky
2013-08-31  0:06   ` Chris Wilson
2013-08-31  3:40     ` Ben Widawsky
2013-08-30 23:43 ` [PATCH 5/8] drm/i915: Convert active API to VMA Ben Widawsky
2013-08-31  0:08   ` Chris Wilson
2013-08-30 23:43 ` [PATCH 6/8] drm/i915: Add bind/unbind object functions to VM Ben Widawsky
2013-08-31  0:12   ` Chris Wilson
2013-08-31  3:40     ` Ben Widawsky
2013-09-03 14:48       ` Chris Wilson
2013-09-02 12:46   ` Ville Syrjälä
2013-09-04  0:20     ` Ben Widawsky
2013-09-04  7:31       ` Ville Syrjälä
2013-08-30 23:44 ` [PATCH 7/8] drm/i915: Use the new vm [un]bind functions Ben Widawsky
2013-08-30 23:44 ` [PATCH 8/8] drm/i915: eliminate vm->insert_entries() Ben Widawsky
  -- strict thread matches above, loose matches on Subject: below --
2013-09-11 21:57 [PATCH 1/8] drm/i915: Synchronize pread/pwrite with wait_rendering Ben Widawsky
2013-09-11 21:57 ` [PATCH 6/8] drm/i915: Add bind/unbind object functions to VM Ben Widawsky
2013-09-11 22:25   ` Chris Wilson
2013-09-11 22:49     ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox