From patchwork Fri Sep 20 15:05:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2919311 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D73429F1E2 for ; Fri, 20 Sep 2013 15:05:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B24FE20160 for ; Fri, 20 Sep 2013 15:05:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6643C20319 for ; Fri, 20 Sep 2013 15:05:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CF35E6CFF for ; Fri, 20 Sep 2013 08:05:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) Received: by mail.bwidawsk.net (Postfix, from userid 5001) id ABBE959EDC; Fri, 20 Sep 2013 08:05:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lundgren.intel.com (c-24-21-100-90.hsd1.or.comcast.net [24.21.100.90]) by mail.bwidawsk.net (Postfix) with ESMTPSA id 968BF5820A; Fri, 20 Sep 2013 08:05:13 -0700 (PDT) From: Ben Widawsky To: Intel GFX Date: Fri, 20 Sep 2013 08:05:02 -0700 Message-Id: <1379689502-7462-1-git-send-email-benjamin.widawsky@intel.com> X-Mailer: git-send-email 1.8.4 Cc: Eero Tamminen , Ben Widawsky , Ben Widawsky Subject: [Intel-gfx] [PATCH] [RFT] drm/i915: Don't waste our paultry cache on a context object X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Virus-Scanned: ClamAV using ClamSMTP 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