From patchwork Tue Nov 13 13:51:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 1734231 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 4D47B3FC64 for ; Tue, 13 Nov 2012 13:52:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 383079EF33 for ; Tue, 13 Nov 2012 05:52:11 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 669CE9F399 for ; Tue, 13 Nov 2012 05:51:39 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 13 Nov 2012 05:51:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,767,1344236400"; d="scan'208";a="241416637" Received: from gaia.fi.intel.com (HELO gaia) ([10.237.72.66]) by orsmga002.jf.intel.com with ESMTP; 13 Nov 2012 05:51:37 -0800 Received: by gaia (Postfix, from userid 1000) id CF6C44269B; Tue, 13 Nov 2012 15:51:36 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Tue, 13 Nov 2012 15:51:36 +0200 Message-Id: <1352814696-2154-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Intel-gfx] [PATCH] drm/i915: Handle sync_seqno correctly when seqno has wrapped. 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 If seqno has wrapped, normal compare operation will give wrong results. i915_seqno_passed can handle the wrap so use it instead. Signed-off-by: Mika Kuoppala --- drivers/gpu/drm/i915/i915_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index cdcf19d..35d5db8 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2138,7 +2138,7 @@ i915_gem_retire_requests_ring(struct intel_ring_buffer *ring) seqno = ring->get_seqno(ring, true); for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++) - if (seqno >= ring->sync_seqno[i]) + if (i915_seqno_passed(seqno, ring->sync_seqno[i])) ring->sync_seqno[i] = 0; while (!list_empty(&ring->request_list)) { @@ -2376,7 +2376,7 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj, idx = intel_ring_sync_index(from, to); seqno = obj->last_read_seqno; - if (seqno <= from->sync_seqno[idx]) + if (i915_seqno_passed(from->sync_seqno[idx], seqno)) return 0; ret = i915_gem_check_olr(obj->ring, seqno);