From patchwork Sun Apr 24 07:18:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 8919731 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6E264BF29F for ; Sun, 24 Apr 2016 07:19:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A185201EC for ; Sun, 24 Apr 2016 07:19:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 83978201FA for ; Sun, 24 Apr 2016 07:19:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 408986E117; Sun, 24 Apr 2016 07:19:24 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id C76E86E0D4 for ; Sun, 24 Apr 2016 07:19:18 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id w143so13185376wmw.3 for ; Sun, 24 Apr 2016 00:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=XrPKPfRfehIfQ4TdZ22k51jnmPBlxaL15DaMZP9/ii0=; b=oUZDRew/WOXAKRWt2ntmWN+lZK/6mW4zpghqso3m9ocr0g7cvUMUMFk8hvzYyK/tUZ EpeMA4nqZ0iCe1JZIf85BYooCMTCav77JWVdFccvZT5aeJQ5TeUVfRdVJIhZnN1psQod AsxyFllxMCSETVjxoPGzMwYhOzWG848HRCAKyBpRIOsZNLHK0MBclGzW9A0Vwsco7b3j +3V7dliWUim3GGXSAVb5Z7CWfiFYdlPgKZhRSE3wq8exfJP0agJKAiDZDgPXVdiys1vc dzZnnsR4apHstozV5m7rrrhc/8jNnt4J0e8uAkQ4/qNeYYi1nQGZM3HJ3GpmX0Ca5T6c yNkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=XrPKPfRfehIfQ4TdZ22k51jnmPBlxaL15DaMZP9/ii0=; b=cCYHClqmBAayrOb6a2zE87It5JYdL+5xa9uOATsjb516fUL0IxbPJSVpo+fQSmcnal YYqwGOY3sygrMn1DKsUSq9V0NPnDlYiGwr/S8pMJ7fHir1RyN26wO4R7TEznSEWFkY9j fa8PjADiGftJ/huc9v+fxjpZYxZ33CmQT7FI8OXI7tT21Y20jEpdNsPAX3Gkox/85h9r 4or/Eff5fcLYN8k8ASGxv07/diREC2ERc/+oIFl3QqftZbCWf4DFxTt13yc0THy32qJm 5AVnqO6J32kgVvQMIpzp9gg/xhFwQGm5c8wPwzmvMArioR7EK2pjV6Y5tfcVNKCIqtLo xZHQ== X-Gm-Message-State: AOPr4FUlMJ4jQRe/Z0K5Wy6EG9s+h4GKc34Z8VdDD8zLBOvVUHYEkXy8S7pNkzFGG+d8Gw== X-Received: by 10.28.95.131 with SMTP id t125mr5823270wmb.80.1461482357283; Sun, 24 Apr 2016 00:19:17 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id i11sm16937119wjn.36.2016.04.24.00.19.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Apr 2016 00:19:16 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Sun, 24 Apr 2016 08:18:39 +0100 Message-Id: <1461482332-21975-8-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1461482332-21975-1-git-send-email-chris@chris-wilson.co.uk> References: <1461482332-21975-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 08/21] drm/i915: L3 cache remapping is part of context switching X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the i915_gem_l3_remap function such that it next to the context switching, which is where we perform the L3 remap. Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/i915_gem.c | 31 ------------------------------- drivers/gpu/drm/i915/i915_gem_context.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 7c4630656d7a..d3e226b714fa 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -4734,37 +4734,6 @@ err: return ret; } -int i915_gem_l3_remap(struct drm_i915_gem_request *req, int slice) -{ - struct intel_engine_cs *engine = req->engine; - struct drm_device *dev = engine->dev; - struct drm_i915_private *dev_priv = dev->dev_private; - u32 *remap_info = dev_priv->l3_parity.remap_info[slice]; - int i, ret; - - if (!HAS_L3_DPF(dev) || !remap_info) - return 0; - - ret = intel_ring_begin(req, GEN7_L3LOG_SIZE / 4 * 3); - if (ret) - return ret; - - /* - * Note: We do not worry about the concurrent register cacheline hang - * here because no other code should access these registers other than - * at initialization time. - */ - for (i = 0; i < GEN7_L3LOG_SIZE / 4; i++) { - intel_ring_emit(engine, MI_LOAD_REGISTER_IMM(1)); - intel_ring_emit_reg(engine, GEN7_L3LOG(slice, i)); - intel_ring_emit(engine, remap_info[i]); - } - - intel_ring_advance(engine); - - return ret; -} - void i915_gem_init_swizzling(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index bf31ee1ed914..7b0a82c0d6e0 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -601,6 +601,37 @@ mi_set_context(struct drm_i915_gem_request *req, u32 hw_flags) return ret; } +int i915_gem_l3_remap(struct drm_i915_gem_request *req, int slice) +{ + struct intel_engine_cs *engine = req->engine; + struct drm_device *dev = engine->dev; + struct drm_i915_private *dev_priv = dev->dev_private; + u32 *remap_info = dev_priv->l3_parity.remap_info[slice]; + int i, ret; + + if (!HAS_L3_DPF(dev) || !remap_info) + return 0; + + ret = intel_ring_begin(req, GEN7_L3LOG_SIZE / 4 * 3); + if (ret) + return ret; + + /* + * Note: We do not worry about the concurrent register cacheline hang + * here because no other code should access these registers other than + * at initialization time. + */ + for (i = 0; i < GEN7_L3LOG_SIZE / 4; i++) { + intel_ring_emit(engine, MI_LOAD_REGISTER_IMM(1)); + intel_ring_emit_reg(engine, GEN7_L3LOG(slice, i)); + intel_ring_emit(engine, remap_info[i]); + } + + intel_ring_advance(engine); + + return ret; +} + static inline bool skip_rcs_switch(struct intel_engine_cs *engine, struct intel_context *to) {