diff mbox

[v3,5/5] drm/i915: Make next_seqno debugs entry to use i915_gem_set_seqno

Message ID 1355908389-19097-5-git-send-email-mika.kuoppala@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala Dec. 19, 2012, 9:13 a.m. UTC
This debugs entry can be used to set arbitrary value to next_seqno.
Use i915_gem_set_seqno instead of poking next_seqno.

v2: nasty details of next_seqno and last_seqno handling
moved inside i915_gem_set_seqno as suggested by Chris Wilson.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Chris Wilson Dec. 19, 2012, 9:57 a.m. UTC | #1
On Wed, 19 Dec 2012 11:13:09 +0200, Mika Kuoppala <mika.kuoppala@linux.intel.com> wrote:
> This debugs entry can be used to set arbitrary value to next_seqno.
> Use i915_gem_set_seqno instead of poking next_seqno.
> 
> v2: nasty details of next_seqno and last_seqno handling
> moved inside i915_gem_set_seqno as suggested by Chris Wilson.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>

Series looks good,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Daniel Vetter Dec. 19, 2012, 10:33 a.m. UTC | #2
On Wed, Dec 19, 2012 at 09:57:58AM +0000, Chris Wilson wrote:
> On Wed, 19 Dec 2012 11:13:09 +0200, Mika Kuoppala <mika.kuoppala@linux.intel.com> wrote:
> > This debugs entry can be used to set arbitrary value to next_seqno.
> > Use i915_gem_set_seqno instead of poking next_seqno.
> > 
> > v2: nasty details of next_seqno and last_seqno handling
> > moved inside i915_gem_set_seqno as suggested by Chris Wilson.
> > 
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> 
> Series looks good,
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

And queued for -next, thanks.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 7047c4a..882a735 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -878,7 +878,6 @@  i915_next_seqno_write(struct file *filp,
 		      loff_t *ppos)
 {
 	struct drm_device *dev = filp->private_data;
-	drm_i915_private_t *dev_priv = dev->dev_private;
 	char buf[20];
 	u32 val = 1;
 	int ret;
@@ -896,19 +895,11 @@  i915_next_seqno_write(struct file *filp,
 			return ret;
 	}
 
-	if (val == 0)
-		return -EINVAL;
-
 	ret = mutex_lock_interruptible(&dev->struct_mutex);
 	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_set_seqno(dev, val);
 
 	mutex_unlock(&dev->struct_mutex);