From patchwork Mon Apr 7 20:01:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3946821 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C42D9BFF02 for ; Mon, 7 Apr 2014 20:02:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED924201FE for ; Mon, 7 Apr 2014 20:02:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BF0D0201FD for ; Mon, 7 Apr 2014 20:02:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6825F6E7A1; Mon, 7 Apr 2014 13:02:24 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 086466E7A1 for ; Mon, 7 Apr 2014 13:02:23 -0700 (PDT) Received: by mail-pa0-f47.google.com with SMTP id lj1so7247740pab.34 for ; Mon, 07 Apr 2014 13:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ECGDPq/4jYBgiWtfomnhOVFNXfFB4IjfaVmHra9xFn8=; b=d6B/Y8/mtQoia9HDhBAmU/ALB4O5CE0m8n7E0B8abhACPULWMwCJlWJG1m4YNGsyLg 9i/ZjPfi0S9vTBVvf9WbCpwOKMQWdr0JSDRXokPScd9cHhqhA/MGjRqsOfS10Ykqy5Uz DR3q55CgnB+4wgp9Kx13ez8Om5V9/C4BHNl+5S3OogaenYVCNvw0bKsalZFp9fettyug Ygx0YLV76wyY6T0cMaj6N9rxetEVzpEGxlUxR2fpTtYUmornsJzurqJ0TlPhsAC+ylCl xTvb9bwlr1SUkWOEQPNg40qmVyBRmRVMXc9TWUlzWF/T0DjfzxkHRpPXnSHxfgA1Zt8t yXNw== X-Received: by 10.66.137.109 with SMTP id qh13mr32738162pab.39.1396900942888; Mon, 07 Apr 2014 13:02:22 -0700 (PDT) Received: from localhost (jfdmzpr04-ext.jf.intel.com. [134.134.137.73]) by mx.google.com with ESMTPSA id ek2sm27298730pbd.30.2014.04.07.13.02.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Apr 2014 13:02:21 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 7 Apr 2014 17:01:51 -0300 Message-Id: <1396900911-12415-7-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396900911-12415-1-git-send-email-rodrigo.vivi@gmail.com> References: <1396900911-12415-1-git-send-email-rodrigo.vivi@gmail.com> Cc: Ben Widawsky , Ben Widawsky Subject: [Intel-gfx] [PATCH 6/6] drm/i915: Don't save/restore RS when not used X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Ben Widawsky Cc: Kenneth Graunke Signed-off-by: Ben Widawsky Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_gem_context.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 8827892..74369b7 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -589,6 +589,7 @@ mi_set_context(struct intel_ring_buffer *ring, struct i915_hw_context *new_context, u32 hw_flags) { + u32 flags = hw_flags | MI_MM_SPACE_GTT; int ret; /* w/a: If Flush TLB Invalidation Mode is enabled, driver must do a TLB @@ -602,6 +603,10 @@ mi_set_context(struct intel_ring_buffer *ring, return ret; } + /* These flags are for resource streamer on HSW+ */ + if (!IS_HASWELL(ring->dev) && INTEL_INFO(ring->dev)->gen < 8) + flags |= (MI_SAVE_EXT_STATE_EN | MI_RESTORE_EXT_STATE_EN); + ret = intel_ring_begin(ring, 6); if (ret) return ret; @@ -614,11 +619,8 @@ mi_set_context(struct intel_ring_buffer *ring, intel_ring_emit(ring, MI_NOOP); intel_ring_emit(ring, MI_SET_CONTEXT); - intel_ring_emit(ring, i915_gem_obj_ggtt_offset(new_context->obj) | - MI_MM_SPACE_GTT | - MI_SAVE_EXT_STATE_EN | - MI_RESTORE_EXT_STATE_EN | - hw_flags); + intel_ring_emit(ring, + i915_gem_obj_ggtt_offset(new_context->obj) | flags); /* * w/a: MI_SET_CONTEXT must always be followed by MI_NOOP * WaMiSetContext_Hang:snb,ivb,vlv