From patchwork Thu Mar 27 18:00:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oscar.mateo@intel.com X-Patchwork-Id: 3898971 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 BCB65BF540 for ; Thu, 27 Mar 2014 17:20:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0F3D20240 for ; Thu, 27 Mar 2014 17:20:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1FBC820237 for ; Thu, 27 Mar 2014 17:20:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 76DA36EA2E; Thu, 27 Mar 2014 10:19:59 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id DDFA96EA2D for ; Thu, 27 Mar 2014 10:19:57 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 27 Mar 2014 10:08:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,743,1389772800"; d="scan'208";a="501087030" Received: from omateolo-linux2.iwi.intel.com ([172.28.253.148]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2014 10:06:32 -0700 From: oscar.mateo@intel.com To: intel-gfx@lists.freedesktop.org Date: Thu, 27 Mar 2014 18:00:09 +0000 Message-Id: <1395943218-7708-41-git-send-email-oscar.mateo@intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1395943218-7708-1-git-send-email-oscar.mateo@intel.com> References: <1395943218-7708-1-git-send-email-oscar.mateo@intel.com> Subject: [Intel-gfx] [PATCH 40/49] drm/i915/bdw: Write the tail pointer, LRC style 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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: Oscar Mateo Writing the tail pointer for the context ringbuffer is quite similar to the legacy ringbuffers. The primary difference is that each context has the ringbuffer pointers in the context object. Signed-off-by: Oscar Mateo --- drivers/gpu/drm/i915/i915_lrc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_lrc.c b/drivers/gpu/drm/i915/i915_lrc.c index 9984a54..e564bac 100644 --- a/drivers/gpu/drm/i915/i915_lrc.c +++ b/drivers/gpu/drm/i915/i915_lrc.c @@ -172,6 +172,19 @@ static void submit_execlist(struct intel_engine *ring, gen6_gt_force_wake_put(dev_priv, FORCEWAKE_ALL); } +static void gen8_write_tail_ctx(struct i915_hw_context *ctx, u32 value) +{ + struct page *page; + uint32_t *reg_state; + + page = i915_gem_object_get_page(ctx->obj, 1); + reg_state = kmap_atomic(page); + + reg_state[CTX_RING_TAIL+1] = value; + + kunmap_atomic(reg_state); +} + static int gen8_write_pdp_ctx(struct i915_hw_context *ctx, struct i915_hw_ppgtt *ppgtt) { @@ -205,12 +218,14 @@ static int gen8_switch_context(struct intel_engine *ring, ppgtt = ctx_to_ppgtt(to0); gen8_write_pdp_ctx(to0, ppgtt); + gen8_write_tail_ctx(to0, tail0); if (to1) { BUG_ON(!i915_gem_obj_is_pinned(to1->obj)); ppgtt = ctx_to_ppgtt(to1); gen8_write_pdp_ctx(to1, ppgtt); + gen8_write_tail_ctx(to1, tail1); } submit_execlist(ring, to0, to1);