public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Execlists prep-work (II)
@ 2014-06-26 13:24 oscar.mateo
  2014-06-26 13:24 ` [PATCH 1/8] drm/i915: Extract context backing object allocation oscar.mateo
                   ` (7 more replies)
  0 siblings, 8 replies; 35+ messages in thread
From: oscar.mateo @ 2014-06-26 13:24 UTC (permalink / raw)
  To: intel-gfx

From: Oscar Mateo <oscar.mateo@intel.com>

These patches contain more refactoring and preparatory work for Execlists [1].

[1] http://lists.freedesktop.org/archives/intel-gfx/2014-June/047138.html

Oscar Mateo (8):
  drm/i915: Extract context backing object allocation
  drm/i915: Rename ctx->obj to ctx->rcs_state
  drm/i915: Rename ctx->is_initialized to ctx->rcs_is_initialized
  drm/i915: Rename ctx->id to ctx->handle
  drm/i915: Extract ringbuffer destroy & generalize alloc to take a
    ringbuf
  drm/i915: Generalize ring_space to take a ringbuf
  drm/i915: Generalize intel_ring_get_tail to take a ringbuf
  drm/i915: Extract the actual workload submission mechanism from
    execbuffer

 drivers/gpu/drm/i915/i915_debugfs.c        |   8 +-
 drivers/gpu/drm/i915/i915_drv.h            |  10 +-
 drivers/gpu/drm/i915/i915_gem.c            |   4 +-
 drivers/gpu/drm/i915/i915_gem_context.c    | 132 +++++++------
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 300 ++++++++++++++++-------------
 drivers/gpu/drm/i915/intel_ringbuffer.c    |  39 ++--
 drivers/gpu/drm/i915/intel_ringbuffer.h    |   4 +-
 drivers/gpu/drm/i915/intel_uncore.c        |   2 +-
 8 files changed, 273 insertions(+), 226 deletions(-)

-- 
1.9.0

^ permalink raw reply	[flat|nested] 35+ messages in thread
* [PATCH 1/8] drm/i915: Extract context backing object allocation
@ 2014-07-03 15:27 oscar.mateo
  2014-07-08  9:39 ` Chris Wilson
  0 siblings, 1 reply; 35+ messages in thread
From: oscar.mateo @ 2014-07-03 15:27 UTC (permalink / raw)
  To: intel-gfx

From: Oscar Mateo <oscar.mateo@intel.com>

This is preparatory work for Execlists: we plan to use it later to
allocate our own context objects (since Logical Ring Contexts do
not have the same kind of backing objects).

No functional changes.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 54 +++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 0d2c75b..9f8d78b 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -198,6 +198,36 @@ void i915_gem_context_free(struct kref *ctx_ref)
 	kfree(ctx);
 }
 
+static struct drm_i915_gem_object *
+i915_gem_alloc_context_obj(struct drm_device *dev, size_t size)
+{
+	struct drm_i915_gem_object *obj;
+	int ret;
+
+	obj = i915_gem_alloc_object(dev, size);
+	if (obj == NULL)
+		return ERR_PTR(-ENOMEM);
+
+	/*
+	 * Try to make the context utilize L3 as well as LLC.
+	 *
+	 * On VLV we don't have L3 controls in the PTEs so we
+	 * shouldn't touch the cache level, especially as that
+	 * would make the object snooped which might have a
+	 * negative performance impact.
+	 */
+	if (INTEL_INFO(dev)->gen >= 7 && !IS_VALLEYVIEW(dev)) {
+		ret = i915_gem_object_set_cache_level(obj, I915_CACHE_L3_LLC);
+		/* Failure shouldn't ever happen this early */
+		if (WARN_ON(ret)) {
+			drm_gem_object_unreference(&obj->base);
+			return ERR_PTR(ret);
+		}
+	}
+
+	return obj;
+}
+
 static struct i915_hw_ppgtt *
 create_vm_for_ctx(struct drm_device *dev, struct intel_context *ctx)
 {
@@ -234,27 +264,13 @@ __create_hw_context(struct drm_device *dev,
 	list_add_tail(&ctx->link, &dev_priv->context_list);
 
 	if (dev_priv->hw_context_size) {
-		ctx->obj = i915_gem_alloc_object(dev, dev_priv->hw_context_size);
-		if (ctx->obj == NULL) {
-			ret = -ENOMEM;
+		struct drm_i915_gem_object *obj =
+				i915_gem_alloc_context_obj(dev, dev_priv->hw_context_size);
+		if (IS_ERR(obj)) {
+			ret = PTR_ERR(obj);
 			goto err_out;
 		}
-
-		/*
-		 * Try to make the context utilize L3 as well as LLC.
-		 *
-		 * On VLV we don't have L3 controls in the PTEs so we
-		 * shouldn't touch the cache level, especially as that
-		 * would make the object snooped which might have a
-		 * negative performance impact.
-		 */
-		if (INTEL_INFO(dev)->gen >= 7 && !IS_VALLEYVIEW(dev)) {
-			ret = i915_gem_object_set_cache_level(ctx->obj,
-							      I915_CACHE_L3_LLC);
-			/* Failure shouldn't ever happen this early */
-			if (WARN_ON(ret))
-				goto err_out;
-		}
+		ctx->obj = obj;
 	}
 
 	/* Default context will never have a file_priv */
-- 
1.9.0

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

end of thread, other threads:[~2014-07-08 10:31 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-26 13:24 [PATCH 0/8] Execlists prep-work (II) oscar.mateo
2014-06-26 13:24 ` [PATCH 1/8] drm/i915: Extract context backing object allocation oscar.mateo
2014-06-30 20:46   ` Jesse Barnes
2014-06-26 13:24 ` [PATCH 2/8] drm/i915: Rename ctx->obj to ctx->rcs_state oscar.mateo
2014-06-30 20:49   ` Jesse Barnes
2014-07-03  9:46   ` Chris Wilson
2014-07-03 12:08     ` Mateo Lozano, Oscar
2014-07-03 12:28       ` Chris Wilson
2014-07-03 14:06         ` Mateo Lozano, Oscar
2014-06-26 13:24 ` [PATCH 3/8] drm/i915: Rename ctx->is_initialized to ctx->rcs_is_initialized oscar.mateo
2014-06-30 20:50   ` Jesse Barnes
2014-07-03  9:49   ` Chris Wilson
2014-07-03 12:09     ` Mateo Lozano, Oscar
2014-06-26 13:24 ` [PATCH 4/8] drm/i915: Rename ctx->id to ctx->handle oscar.mateo
2014-06-30 20:53   ` Jesse Barnes
2014-07-01 15:46     ` Mateo Lozano, Oscar
2014-07-01 16:07       ` Jesse Barnes
2014-07-03  9:30   ` Chris Wilson
2014-07-03  9:52     ` Chris Wilson
2014-07-03 12:01       ` Mateo Lozano, Oscar
2014-07-07 15:48         ` Daniel Vetter
2014-06-26 13:24 ` [PATCH 5/8] drm/i915: Extract ringbuffer destroy & generalize alloc to take a ringbuf oscar.mateo
2014-06-30 20:57   ` Jesse Barnes
2014-06-26 13:24 ` [PATCH 6/8] drm/i915: Generalize ring_space " oscar.mateo
2014-06-30 20:58   ` Jesse Barnes
2014-06-26 13:24 ` [PATCH 7/8] drm/i915: Generalize intel_ring_get_tail " oscar.mateo
2014-06-30 20:59   ` Jesse Barnes
2014-06-26 13:24 ` [PATCH 8/8] drm/i915: Extract the actual workload submission mechanism from execbuffer oscar.mateo
2014-06-30 21:02   ` Jesse Barnes
2014-07-03  7:32   ` Chris Wilson
2014-07-03  9:07     ` Mateo Lozano, Oscar
2014-07-03  9:28       ` Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2014-07-03 15:27 [PATCH 1/8] drm/i915: Extract context backing object allocation oscar.mateo
2014-07-08  9:39 ` Chris Wilson
2014-07-08 10:31   ` Daniel Vetter

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