From patchwork Tue Jan 22 12:12:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 2018311 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 3417EDF2EB for ; Tue, 22 Jan 2013 12:12:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0086CE637B for ; Tue, 22 Jan 2013 04:12:34 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 05198E5CC7 for ; Tue, 22 Jan 2013 04:12:23 -0800 (PST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 22 Jan 2013 04:12:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,514,1355126400"; d="scan'208";a="246978062" Received: from gaia.fi.intel.com (HELO gaia) ([10.237.72.66]) by azsmga001.ch.intel.com with ESMTP; 22 Jan 2013 04:12:22 -0800 Received: by gaia (Postfix, from userid 1000) id 4A39140C2D; Tue, 22 Jan 2013 14:12:18 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Tue, 22 Jan 2013 14:12:17 +0200 Message-Id: <1358856737-20697-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Intel-gfx] [PATCH 1/1] drm/i915: use gem_set_seqno() on hardware init 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 When machine was rebooted or module was reloaded, gem_hw_init() set last_seqno to be identical to next_seqno. This lead to situation that waits for first ever request always passed immediately regardless if it was actually executed. Use gem_set_seqno() to be consistent how hw is initialized on init, wrap and on resume. Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem.c | 6 ++++-- drivers/gpu/drm/i915/intel_ringbuffer.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index d90d2f9..1a61d99 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3979,8 +3979,6 @@ i915_gem_init_hw(struct drm_device *dev) i915_gem_init_swizzling(dev); - dev_priv->next_seqno = dev_priv->last_seqno = (u32)~0 - 0x1000; - ret = intel_init_render_ring_buffer(dev); if (ret) return ret; @@ -3997,6 +3995,10 @@ i915_gem_init_hw(struct drm_device *dev) goto cleanup_bsd_ring; } + ret = i915_gem_set_seqno(dev, ((u32)~0 - 0x1000)); + if (ret) + return ret; + /* * XXX: There was some w/a described somewhere suggesting loading * contexts before PPGTT. diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 2bd074a..1bb2ec5 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -1184,8 +1184,6 @@ static int intel_init_ring_buffer(struct drm_device *dev, if (IS_I830(ring->dev) || IS_845G(ring->dev)) ring->effective_size -= 128; - intel_ring_init_seqno(ring, dev_priv->last_seqno); - return 0; err_unmap: