#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include "drm.h"
-#include "i915_drm.h"
+
+#include <drm.h>
+
+#include "ioctl_wrappers.h"
#include "drmtest.h"
-#include "intel_bufmgr.h"
-#include "intel_batchbuffer.h"
-#include "intel_gpu_tools.h"
+#include "intel_chipset.h"
+#include "intel_io.h"
+#include "igt_aux.h"
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
drm_intel_bo_get_subdata(bo, 0, size, buf);
for (i = 0; i < size / 4; i++) {
- if (buf[i] != val) {
- fprintf(stderr,
- "Unexpected value 0x%08x instead of "
- "0x%08x at offset 0x%08x (%p)\n",
- buf[i], val, i * 4, buf);
- abort();
- }
+ igt_assert_f(buf[i] == val,
+ "Unexpected value 0x%08x instead of "
+ "0x%08x at offset 0x%08x (%p)\n",
+ buf[i], val, i * 4, buf);
val++;
}
}
drm_intel_bo_get_subdata(bo, offset, PAGE_SIZE, buf);
for (i = 0; i < PAGE_SIZE; i += 4) {
- if (buf[i / 4] != val) {
- fprintf(stderr,
- "Unexpected value 0x%08x instead of "
- "0x%08x at offset 0x%08x\n",
- buf[i / 4], val, i * 4);
- abort();
- }
+ igt_assert_f(buf[i / 4] == val,
+ "Unexpected value 0x%08x instead of "
+ "0x%08x at offset 0x%08x\n",
+ buf[i / 4], val, i * 4);
val++;
}
}
gem_set_caching(fd, tmp[1]->handle, cache_level);
}
- printf("meh");
-
do {
/* First, do a full-buffer read after blitting */
- intel_copy_bo(batch, tmp[0], src[0], width, height);
+ intel_copy_bo(batch, tmp[0], src[0], width*height*4);
verify_large_read(tmp[0], start[0]);
- intel_copy_bo(batch, tmp[0], src[1], width, height);
+ intel_copy_bo(batch, tmp[0], src[1], width*height*4);
verify_large_read(tmp[0], start[1]);
- intel_copy_bo(batch, tmp[0], src[0], width, height);
+ intel_copy_bo(batch, tmp[0], src[0], width*height*4);
verify_small_read(tmp[0], start[0]);
- intel_copy_bo(batch, tmp[0], src[1], width, height);
+ intel_copy_bo(batch, tmp[0], src[1], width*height*4);
verify_small_read(tmp[0], start[1]);
- intel_copy_bo(batch, tmp[0], src[0], width, height);
+ intel_copy_bo(batch, tmp[0], src[0], width*height*4);
verify_large_read(tmp[0], start[0]);
- intel_copy_bo(batch, tmp[0], src[0], width, height);
- intel_copy_bo(batch, tmp[1], src[1], width, height);
+ intel_copy_bo(batch, tmp[0], src[0], width*height*4);
+ intel_copy_bo(batch, tmp[1], src[1], width*height*4);
verify_large_read(tmp[0], start[0]);
verify_large_read(tmp[1], start[1]);
- intel_copy_bo(batch, tmp[0], src[0], width, height);
- intel_copy_bo(batch, tmp[1], src[1], width, height);
+ intel_copy_bo(batch, tmp[0], src[0], width*height*4);
+ intel_copy_bo(batch, tmp[1], src[1], width*height*4);
verify_large_read(tmp[1], start[1]);
verify_large_read(tmp[0], start[0]);
- intel_copy_bo(batch, tmp[1], src[0], width, height);
- intel_copy_bo(batch, tmp[0], src[1], width, height);
+ intel_copy_bo(batch, tmp[1], src[0], width*height*4);
+ intel_copy_bo(batch, tmp[0], src[1], width*height*4);
verify_large_read(tmp[0], start[1]);
verify_large_read(tmp[1], start[0]);
} while (--loop);