Add a coherency test and an unbind - read - bind test to ttmtest.

This commit is contained in:
Thomas Hellstrom 2008-03-10 18:47:16 +01:00
parent 612c22f131
commit c500061116
2 changed files with 23 additions and 2 deletions

View file

@ -503,8 +503,8 @@ void i915_user_irq_off(drm_i915_private_t *dev_priv)
{ {
DRM_SPINLOCK(&dev_priv->user_irq_lock); DRM_SPINLOCK(&dev_priv->user_irq_lock);
if (dev_priv->irq_enabled && (--dev_priv->user_irq_refcount == 0)) { if (dev_priv->irq_enabled && (--dev_priv->user_irq_refcount == 0)) {
// dev_priv->irq_enable_reg &= ~USER_INT_FLAG; dev_priv->irq_enable_reg &= ~USER_INT_FLAG;
// I915_WRITE16(I915REG_INT_ENABLE_R, dev_priv->irq_enable_reg); I915_WRITE16(I915REG_INT_ENABLE_R, dev_priv->irq_enable_reg);
} }
DRM_SPINUNLOCK(&dev_priv->user_irq_lock); DRM_SPINUNLOCK(&dev_priv->user_irq_lock);
} }

View file

@ -173,6 +173,7 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size,
int ret; int ret;
drmBO buf; drmBO buf;
void *virtual; void *virtual;
int i;
/* /*
* Test system memory objects. * Test system memory objects.
@ -229,6 +230,11 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size,
curTime = fastrdtsc(); curTime = fastrdtsc();
*ticks++ = time_diff(oldTime, curTime); *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(); oldTime = fastrdtsc();
memset(virtual, 0xF0, buf.size); memset(virtual, 0xF0, buf.size);
curTime = fastrdtsc(); curTime = fastrdtsc();
@ -244,8 +250,22 @@ benchmarkBuffer(TinyDRIContext * ctx, unsigned long size,
curTime = fastrdtsc(); curTime = fastrdtsc();
*ticks++ = time_diff(oldTime, curTime); *ticks++ = time_diff(oldTime, curTime);
oldTime = fastrdtsc();
BM_CKFATAL(drmBOUnmap(ctx->drmFD, &buf)); 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(); oldTime = fastrdtsc();
BM_CKFATAL(drmBOSetStatus(ctx->drmFD, &buf, BM_CKFATAL(drmBOSetStatus(ctx->drmFD, &buf,
DRM_BO_FLAG_MEM_LOCAL, DRM_BO_MASK_MEM, 0, 0,0)); 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 to TT took %12lu ticks\n", *pTicks++);
printf("Writing again 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("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++); printf("Moving to system took %12lu ticks\n", *pTicks++);
if (ret == 1) if (ret == 1)