From: Mika Kuoppala Subject: [PATCH] drm/i915: Improve the comment on ring_sync after seqno wrap Date: Fri, 31 Jan 2014 13:04:21 +0200 Message-ID: <1391166261-4786-1-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 19158103BF8 for ; Fri, 31 Jan 2014 03:04:24 -0800 (PST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org There are quite alot of nasty things happening inside the seemingly bening intel_ring_begin() if seqno wrap happens. Warn the reader about it. Signed-off-by: Mika Kuoppala --- drivers/gpu/drm/i915/intel_ringbuffer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index d897a19..f99e2ae 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -727,7 +727,13 @@ gen6_ring_sync(struct intel_ring_buffer *waiter, if (ret) return ret; - /* If seqno wrap happened, omit the wait with no-ops */ + /* Seqno allocation is inside intel_ring_begin() so the seqno + * wrap (re init of driver seqno counter) might have happened. + * This means that the seqno we are syncing to, just became + * irrelevant in this brand new seqno universe. And as it does + * not exists anymore, waiting for it to happen is unwise. + * If this is the case, emit no-ops instead. + */ if (likely(!i915_gem_has_seqno_wrapped(waiter->dev, seqno))) { intel_ring_emit(waiter, dw1 | -- 1.7.9.5