From patchwork Sun Jul 14 16:22:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2827232 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 C1A37C0AB2 for ; Sun, 14 Jul 2013 16:22:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D318820124 for ; Sun, 14 Jul 2013 16:22:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D6C7D20117 for ; Sun, 14 Jul 2013 16:22:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B5604E6276 for ; Sun, 14 Jul 2013 09:22:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id D3F61E6184 for ; Sun, 14 Jul 2013 09:19:41 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 99) id 9E67D8862F; Sun, 14 Jul 2013 16:19:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lundgren.kumite (c-24-21-100-90.hsd1.or.comcast.net [24.21.100.90]) by shiva.localdomain (Postfix) with ESMTPSA id EB21F8867F; Sun, 14 Jul 2013 16:19:39 +0000 (UTC) From: Ben Widawsky To: Intel GFX Date: Sun, 14 Jul 2013 09:22:48 -0700 Message-Id: <1373818974-23102-5-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1373818974-23102-1-git-send-email-ben@bwidawsk.net> References: <1373818974-23102-1-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 4/9] drm/i915: Add gen5 support to mi_set_context 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 It's similar enough to the other gens that we don't really need a distinct function to do it. NOTE: The new function removes the MI_FLUSH that was at the end of the old Ironlake switching code. Recent docs can find neither the requirement for the MI_FLUSH or the MI_SUSPEND_FLUSH. Since I remember clearly seeing the latter in a doc at one point however, I am going to leave it there. I had Ken look at his docs as well, and he could also find no note of either. NOTE2: Remember to put NOTE1 in the commit where we start using the new function for ILK. CC: Kenneth Graunke Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_gem_context.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 2c25006..a9beaaa 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -369,11 +369,18 @@ mi_set_context(struct intel_ring_buffer *ring, if (ret) return ret; - /* WaProgramMiArbOnOffAroundMiSetContext:ivb,vlv,hsw */ - if (IS_GEN7(ring->dev)) + switch (INTEL_INFO(ring->dev)->gen) { + case 7: + /* WaProgramMiArbOnOffAroundMiSetContext:ivb,vlv,hsw */ intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_DISABLE); - else + break; + case 5: + intel_ring_emit(ring, MI_SUSPEND_FLUSH | MI_SUSPEND_FLUSH_EN); + break; + default: intel_ring_emit(ring, MI_NOOP); + break; + } intel_ring_emit(ring, MI_NOOP); intel_ring_emit(ring, MI_SET_CONTEXT); @@ -385,14 +392,22 @@ mi_set_context(struct intel_ring_buffer *ring, /* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP */ intel_ring_emit(ring, MI_NOOP); - if (IS_GEN7(ring->dev)) + switch (INTEL_INFO(ring->dev)->gen) { + case 7: intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_ENABLE); - else + break; + case 5: + intel_ring_emit(ring, MI_SUSPEND_FLUSH); + break; + default: intel_ring_emit(ring, MI_NOOP); + break; + } intel_ring_advance(ring); return ret; + } static int do_switch(struct i915_hw_context *to)