From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: [PATCH] [RFT] drm/i915: Don't waste our paultry cache on a context object Date: Fri, 20 Sep 2013 08:05:02 -0700 Message-ID: <1379689502-7462-1-git-send-email-benjamin.widawsky@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D57BE5F7E for ; Fri, 20 Sep 2013 08:05:20 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Intel GFX Cc: Eero Tamminen , Ben Widawsky , Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org Context save and restore is by definition a slow process, however it is also an infrequent process. Don't try to optimize the save restore at the cost of any of our precious cache space. Contexts begin to get quite large on HSW and beyond. At least for benchmarks people seem to care about, there is almost always only 1 context running, which means I don't expect this to do any harm. For benchmarks with many contexts, there could be performance degradation - but I have a sneaking suspicion the HW will do some fancy magic to speak up context save & restores anyway. CC: Chris Wilson CC: Eero Tamminen Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_gem_context.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 26c3fcc..593be55 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -153,13 +153,10 @@ create_hw_context(struct drm_device *dev, return ERR_PTR(-ENOMEM); } - if (INTEL_INFO(dev)->gen >= 7) { - 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; - } + ret = i915_gem_object_set_cache_level(ctx->obj, I915_CACHE_NONE); + /* Failure shouldn't ever happen this early */ + if (WARN_ON(ret)) + goto err_out; /* The ring associated with the context object is handled by the normal * object tracking code. We give an initial ring value simple to pass an -- 1.8.4