From patchwork Mon Dec 17 16:44:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 1888041 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 C8C3DDF266 for ; Mon, 17 Dec 2012 16:49:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C630E5CF2 for ; Mon, 17 Dec 2012 08:49:37 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D83AE5D57 for ; Mon, 17 Dec 2012 08:44:56 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 17 Dec 2012 08:44:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,303,1355126400"; d="scan'208";a="263207425" Received: from gaia.fi.intel.com (HELO gaia) ([10.237.72.69]) by fmsmga001.fm.intel.com with ESMTP; 17 Dec 2012 08:44:33 -0800 Received: by gaia (Postfix, from userid 1000) id B72BC410F7; Mon, 17 Dec 2012 18:44:32 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Mon, 17 Dec 2012 18:44:29 +0200 Message-Id: <1355762669-6806-4-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355762669-6806-1-git-send-email-mika.kuoppala@intel.com> References: <1355762669-6806-1-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH 4/4] drm/i915: Make next_seqno debugs entry to use i915_gem_seqno_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 As this debugs entry can be used to set arbitrary value to next_seqno, use i915_gem_seqno_init to set the next_seqno. Signed-off-by: Mika Kuoppala --- drivers/gpu/drm/i915/i915_debugfs.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 7047c4a..e669e2e 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -903,12 +903,17 @@ i915_next_seqno_write(struct file *filp, if (ret) return ret; - if (i915_seqno_passed(val, dev_priv->next_seqno)) { - dev_priv->next_seqno = val; - DRM_DEBUG_DRIVER("Advancing seqno to %u\n", val); - } else { - ret = -EINVAL; - } + ret = i915_gem_init_seqno(dev, val - 1); + if (ret) + return ret; + + dev_priv->next_seqno = val; + + /* Carefully set the last_seqno value so that + * wrap detection still works */ + dev_priv->last_seqno = val - 1; + if (dev_priv->last_seqno == 0) + dev_priv->last_seqno--; mutex_unlock(&dev->struct_mutex);