diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2008-03-10 18:47:16 +0100 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2008-03-10 18:47:16 +0100 |
commit | c5000611168ac73a596a2b20ba8cb587964fdfd4 (patch) | |
tree | 62b11ea9f1b237cd4c29d1d846e19fc881f9b762 | |
parent | 612c22f131a25915196e69d7ec1adb6f4ec84a60 (diff) |
Add a coherency test and an unbind - read - bind test to ttmtest.intel-post-reloc
-rw-r--r-- | shared-core/i915_irq.c | 4 | ||||
-rw-r--r-- | tests/ttmtest/src/ttmtest.c | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index fd08b6e8..4c9e1ff2 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -503,8 +503,8 @@ void i915_user_irq_off(drm_i915_private_t *dev_priv) { DRM_SPINLOCK(&dev_priv->user_irq_lock); if (dev_priv->irq_enabled && (--dev_priv->user_irq_refcount == 0)) { - // dev_priv->irq_enable_reg &= ~USER_INT_FLAG; - // I915_WRITE16(I915REG_INT_ENABLE_R, dev_priv->irq_enable_reg); + dev_priv->irq_enable_reg &= ~USER_INT_FLAG; + I915_WRITE16(I915REG_INT_ENABLE_R, dev_priv->irq_enable_reg); } DRM_SPINUNLOCK(&dev_priv->user_irq_lock); } diff --git a/tests/ttmtest/src/ttmtest.c b/tests/ttmtest/src/ttmtest.c index 36df2428..bc08badf 100644 --- a/tests/ttmtest/src/ttmtest.c +++ b/tests/ttmtest/src/ttmtest.c @@ -173,6 +173,7 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size, int ret; drmBO buf; void *virtual; + int i; /* * Test system memory objects. @@ -229,6 +230,11 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size, curTime = fastrdtsc(); *ticks++ = time_diff(oldTime, curTime); + for (i=0; i<buf.size; ++i) { + if (((uint8_t *)virtual)[i] != 0x0F) + printf("Coherency error at position %d\n", i); + } + oldTime = fastrdtsc(); memset(virtual, 0xF0, buf.size); curTime = fastrdtsc(); @@ -244,8 +250,22 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size, curTime = fastrdtsc(); *ticks++ = time_diff(oldTime, curTime); + oldTime = fastrdtsc(); + BM_CKFATAL(drmBOUnmap(ctx->drmFD, &buf)); + BM_CKFATAL(drmBOSetStatus(ctx->drmFD, &buf, + DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED, DRM_BO_MASK_MEM | DRM_BO_FLAG_CACHED, 0, 0,0)); + BM_CKFATAL(drmBOMap(ctx->drmFD, &buf, + DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0, &virtual)); + readBuf(virtual, buf.size); BM_CKFATAL(drmBOUnmap(ctx->drmFD, &buf)); + BM_CKFATAL(drmBOSetStatus(ctx->drmFD, &buf, + DRM_BO_FLAG_MEM_TT, DRM_BO_MASK_MEM | DRM_BO_FLAG_CACHED, 0, 0,0)); + BM_CKFATAL(drmBOMap(ctx->drmFD, &buf, + DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0, &virtual)); + curTime = fastrdtsc(); + *ticks++ = time_diff(oldTime, curTime); + BM_CKFATAL(drmBOUnmap(ctx->drmFD, &buf)); oldTime = fastrdtsc(); BM_CKFATAL(drmBOSetStatus(ctx->drmFD, &buf, DRM_BO_FLAG_MEM_LOCAL, DRM_BO_MASK_MEM, 0, 0,0)); @@ -330,6 +350,7 @@ testAGP(TinyDRIContext * ctx) printf("Writing to TT took %12lu ticks\n", *pTicks++); printf("Writing again to TT took %12lu ticks\n", *pTicks++); printf("Reading from TT took %12lu ticks\n", *pTicks++); + printf("Moveout Reading took %12lu ticks\n", *pTicks++); printf("Moving to system took %12lu ticks\n", *pTicks++); if (ret == 1) |